Advanced Octave A75 — Dynamical systems in phase space

by Giux GX-TXT, octave-en, scripts-en 2 min read

Advanced GNU Octave with GX-TXT · Module 13

Three dynamic variables can be represented as a trajectory in phase space. The Lorenz system offers an example rich in forms, but a figure alone is not enough to demonstrate the properties of the system.

Objectives and prerequisites

We repeat ode45 of A49 and the 3D graphics of A41. The test uses GX-TXT dev112-P011-bis and GNU Octave 9.4.0. Import and run lorenz.m, then distanza.m. The octave_lorenz_trajectory and octave_lorenz_separation IDs are created-only: use a new Session or change the IDs in the two scripts to repeat.

The system and the trajectory

The dimensional model is x' = sigma*(y-x), y' = x*(rho-z)-y, z' = x*y-beta*z. We use sigma = 10, rho = 28 and beta = 8/3, integrating from 0 to 20 with 1001 output times and explicit tolerances. The first initial condition is [1;1;1].

The line connects computed consecutive states; the axes represent the three variables, not positions in the geographical space. The perspective and color help visualization but do not provide a measure of time or stability alone.

Initial conditions

The second integration starts from [1,000001;1;1]. We calculate the euclidea distance between the two states at the same time and publish it as a series:

In the test the initial distance is 1e-6 and the final one about 0.000929329; in the middle the distance does not grow monotonously. The trend depends on interval, parameters, perturbation and accuracy of the solver. This simulation illustrates sensitivity in the chosen case: a single figure or pair of trajectories is not a complete demonstration of chaos or a universal prediction for physical systems.

Exercise

  1. What sizes are the axes of the 3D chart?
  2. How much do the two conditions initially differ?
  3. Does the distance always grow during the test?

Worked solution

  1. The three variables of dimensionless state x, y and z.
  2. Of 1e-6 in the first component.
  3. No: the curve shows increases and decreases.

Download the Module 13 scripts (ZIP)

#GNU Octave #GX-TXT #GX-TXT public APIs

Other steps of this project

Leave a Reply

Your email address will not be published. Required fields are marked *