2次元の写像 〜 『計算物理学入門』読み(その6)
以下の2本の連立差分方程式で表される動的な系を描画してみる。
プログラムは以下の通り。stream-takeの第2引数の値を変えると、プロットする点の数を簡単に変更できる。
(use graph)
(use util.stream)(graph-init 800 600 :title "Simple Map" :display 2 :x-min -6 :x-max 10 :y-min -4 :y-max 8)
(graph-grid 16 12 'gray)(define (simple-map-stream x y)
(stream-cons (cons x y)
(simple-map-stream (+ 1 (- y) (abs x))
x)))(graph-plot-point-stream
(stream-take (simple-map-stream -0.1 0) 10000)
'red)