MTH3007b Weekly Problems 4

Vibes: Stiff systems and chaotic attractors - stability bounds keep things from blowing up, then the Lorenz system makes butterflies cause storms!

Used Techniques:

  • Stability analysis of the explicit Euler method.
  • Explicit Euler method for systems of ODEs.
  • Lorenz system visualisation (phase portraits).

4.1. Solving an ODE

Question

What is the upper bound for the integration step-size to maintain stability using the explicit Euler method, for .

Give a numerical answer and motivation for solution.

The explicit Euler method applied to gives the recurrence:

For stability we need the amplification factor to satisfy , which requires:

Here , so we can quickly compute the bound:

Python
Output

Giving us - a tiny step size, highlighting how stiff this ODE is for explicit methods.


4.2. Solving a System of ODEs

Question

Implement a numerical solver for the Lorenz equations:

Use the explicit Euler method with the parameters , initial conditions , and integrate from to with integration time-step of .

Then, plot against and against , before finding the numerical answer for to 7 significant figures.

First, we should do all required imports.

Python
Output

The explicit Euler method generalises to vector-valued ODEs as:

So we can implement a system-level version of the method…

Python
Output

Then we can write the Lorenz system derivatives as a Python function, just to make things a bit neater…

Python
Output

Now we can specify each of the variables for our specific problem…

Python
Output

Which allows us to solve the system and find !

Python
Output

Now let’s visualise the chaotic behaviour. First, importing matplotlib:

Python
Output

Then plotting against :

Python
Output

And the phase portrait of against :

Python
Output

Both plots clearly show the chaotic behaviour of the Lorenz system - the trajectory oscillates unpredictably between two lobes of the famous butterfly attractor, sensitive to initial conditions as expected.