/* prog4a.c -- Compute the Lorenz System Written Nov 12, 2002 by Eric Olson for Mathematics 483 For information about the Lorenz System see section 4.3 in Applied Analysis of the Navier Stokes Equations by Doering and Gibbon. For information about the Euler and RK methods used in solving this equation see chapter 4 in Numerical Analysis for Applied Mathematics, Science and Engineering by Greenspan and Casulli. */ #include #include #define N 3 double sigma=10.0; double b=2.666666666666666666667; double r=28.0; void force(double F[N],double X[N]){ F[0]=sigma*(X[1]-X[0]); F[1]=r*X[0]-X[1]-X[0]*X[2]; F[2]=X[0]*X[1]-b*X[2]; return; } void euler(double X[N],double tn,int n) { double F[3]; double h=tn/n; int i,j; for(j=0;j