10
Apr
06

### Lorenz Attractor

The Lorenz Attractor is a famous chaotic strange attractor. The equations were originally developed to model atmospheric convection.
```(* runtime: 1 second *) sigma = 3; rho = 26.5; beta = 1; soln = {x[t], y[t], z[t]} /. NDSolve[{x'[t] == sigma (y[t] - x[t]), y'[t] == rho x[t] - x[t]z[t] - y[t], z'[t] == x[t] y[t] - beta z[t], x[0] == 0, y[0] == 1, z[0] == 1}, {x[t], y[t], z[t]}, {t, 0, 100}, MaxSteps -> 10000][[1]]; ParametricPlot3D[soln, {t, 0, 100}, PlotPoints -> 10000, Compiled -> False];```

Here is some Mathematica code to numerically solve this using the 4th order Runge-Kutta method:
(* runtime: 0.2 second *)
```sigma = 3; rho = 26.5; beta = 1; dt = 0.01; p = {0, 1, 1}; v[{x_, y_, z_}] = {sigma(y - x), rho x - x z - y, x y - beta z}; Show[Graphics3D[Line[Table[k1 = dt v[p]; k2 = dt v[p + k1/2]; k3 = dt v[p +k2/2]; k4 = dt v[p + k3]; p += (k1 + 2 k2 + 2 k3 + k4)/6, {1000}]]]];```

Advertisements

#### 0 Responses to “Lorenz Attractor”

1. Leave a Comment

## Welcome !

You will find here some of my favorite hobbies and interests, especially science and art.

I hope you enjoy it!

Subscribe to the RSS feed to stay informed when I publish something new here.

I would love to hear from you! Please feel free to send me an email : bugman123-at-gmail-dot-com

• 555,424 hits
Advertisements