Tools › Numerical Methods › Equation Solvers › ODE and Nonlinear Equation Solver › Example

Lorenz equations to t = 25: adaptive Dormand-Prince RK45, the butterfly and how far chaos lets the digits be trusted

ToolODE and Nonlinear Equation Solver
SourceOriginal case on the equations of Lorenz, E. N. (1963). "Deterministic Nonperiodic Flow." Journal of the Atmospheric Sciences, Vol. 20, No. 2, pp. 130–141 (σ = 10, ρ = 28, β = 8/3; the starting point is this example's own choice), checked against scipy.integrate.solve_ivp (DOP853, rtol 1e-12) and against scipy's own RK45 step for step in test_ode_nonlinear_solver.php.
LevelUndergraduate

Problem

Integrate x′ = σ(y − x), y′ = x(ρ − z) − y, z′ = xy − βz with σ = 10, ρ = 28, β = 8/3 from (x, y, z) = (0, 1, 0) at t = 0 to t = 25. Report the end values, show the first step of the method, and say how many digits of the end values can be trusted.

Inputs to Enter

  • Problem: differential equations; three lines x' = sigma*(y - x), y' = x*(rho - z) - y, z' = x*y - beta*z and the values sigma = 10, rho = 28, beta = 8/3
  • Initial values x = 0, y = 1, z = 0; start time 0, end time 25
  • Method: adaptive Dormand-Prince RK45, tolerance 1e-10
Open the ODE and Nonlinear Equation Solver tool (loaded with this example)

Answers

  • First step chosen by the solver: h = 0.001575; k₁ = (10, −1, 0); x after the step = 0.015616 (fifth-order weights 35/384, 500/1113, 125/192, −2187/6784, 11/84)
  • 5,574 steps accepted and 10 rejected, step sizes from 0.00017 to 0.0086
  • At t = 25: x = 7.01967, y = −1.56404, z = 34.1865
  • A second run at a tenth of the tolerance moves these by up to 0.017; the DOP853 reference gives 7.00572, −1.56771, 34.16752, so the true errors are 0.014, 0.004 and 0.019
  • The phase plane (y against x, z against x) is the two-lobed butterfly; the path spirals outward around one lobe until about t = 16.7 and then changes sides seven times before t = 25

Notes

Open this case in the tool: /analysis-tools/numerical-methods/equation-solvers/ode-nonlinear-solver/?try=lorenz-butterfly. A tolerance of 1e-10 per step still leaves an error of about 0.02 at t = 25, because the equations themselves keep multiplying every small error; at a tolerance of 1e-6, or to t = 40, the tool warns that the end values are not settled. The shape of the butterfly is reliable long after the individual numbers are not.

More Examples for This Tool