Advanced Octave A75 — Dynamical systems in phase space
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
- What sizes are the axes of the 3D chart?
- How much do the two conditions initially differ?
- Does the distance always grow during the test?
Worked solution
- The three variables of dimensionless state x, y and z.
- Of 1e-6 in the first component.
- No: the curve shows increases and decreases.
Other steps of this project
- Advanced Octave A81 — Geography of the waves and a 3D surface
- Advanced Octave A82 — Age, sex and demographic inequalities
- Advanced Octave A83 — All-cause mortality, certified COVID deaths and surveillance
- Advanced Octave A84 — A reproducible public account
- Advanced Octave A73 — Optimization landscapes and 3D trajectories
- Advanced Octave A74 — RLC response surfaces