/* This program integrates the Lorenz II system */ # include "easynum.c" /* http://staff.vscht.cz/~pokornp/easynum/ */ /************************************/ void lorenz2 (time,xyz,pars, xyzdot,g,J,dim) real time; vector xyz,pars,xyzdot,g; matrix J; int dim; { real a = 0.25, b = 4.0, F = 8.0, G = 1.0, x = xyz[0], y = xyz[1], z = xyz[2]; xyzdot[0] = -y*y-z*z-a*(x-F); xyzdot[1] = x*y-b*x*z-y+G; xyzdot[2] = b*x*y+x*z-z; } /* lorenz2 */ /************************************/ int main () { real t = 0, /* time */ Ts = 0.1; /* sampling period */ vector xyz,pars; /* state vector and parameters */ int i,imax=10000,dim=3; xyz[0] = 1.1; /* set initial conditions */ xyz[1] = 0.3; xyz[2] = 2.1; for (i=0;i