/* C program that integrates the chaotic chemical system from J.L.Hudson & O.E.Rossler: Chaos in Simple Three- and Four-variable Chemical Systems in Lecture Notes in Biomathematics 55: Modelling of Patterns in Space and Time pp.135-145 eds. W.Jager & J.D.Murray Springer-Verlag Berlin 1984 To run it (1) save this code in a file hudson.c (2) save easynum library in a file easynum.c (3) compile it by $ cc hudson.c -lm (4) run it by $ a.out To see the results type $ xpplot t ca $ xpplot t cb $ xpplot t cc $ xpplot ca cb $ xpplot ca cc $ xpplot cb cc */ # include "easynum.c" /* http://staff.vscht.cz/~pokornp/easynum */ /******************************/ void hudson (t,y,p, f,g,J,d) real t; vector y,p, f,g; matrix J; { real k1=0.01, k2=0.02, k3=1.0, k=0.08, k4=0.11, k5=0.0005, a=y[0], b=y[1], c=y[2]; f[0] = k1-k2*(a-c)-k3*b*a; f[1] = k3*a*b-k4*b/(b+k)+k5; f[2] = k2*(a-c); } /* hudsun */ /******************************/ int main () { real t = 0,Ts = 1; vector x,p; int i,im=10000,d=3; FILE *ft,*fa,*fb,*fc; ppopenww (&ft ,"t"); ppopenww (&fa,"ca"); ppopenww (&fb,"cb"); ppopenww (&fc,"cc"); x[0] = 0.8; x[1] = 0.01; x[2] = 1.0; for (i=0;i