ローレンツアトラクタ

0

// Dolittle + GNUPLOT(ローレンツアトラクタ)
data=array! create.
x=0.01. y=0.01. z=0.01. dt=0.01.
p=10. r=30. b=8/3.
[
dx=(-1*p*x+p*y)*dt.
dy=(-1*x*z+r*x-y)*dt.
dz=(x*y-b*z)*dt.
x=x+dx.
y=y+dy.
z=z+dz.
data! (""! (x)(" ")(y)(" ")(z) concat) add.
]! (50000) repeat.
f=textfile! ((path)+"tmp.dat") create. f! (data) writeall.

fnm=random(9999).
source="
set terminal jpeg size 1600,1200
set output '"+(fnm)+".jpg
splot 'tmp.dat' with lines lw 0.01 title ''
".

script=array! create.
f=textfile! ((path)+"tmp.txt") create. script! (source) add. f! (script) writeall.
rrt=system! ("/usr/local/bin/gnuplot "+(path)+"tmp.txt") execute.
turtle! create ((path)+(fnm)+".jpg") setshape (0.5)(0.5) scale.

ローレンツアトラクタ webGL version
http://etext-music.com/webGL/

Default