This project is an exploration of the Lorenz system, one of the most iconic chaotic dynamical systems.
Using C++, I simulate the attractor in different ways:
-
clean 2D projection
-
velocity-colored rendering
-
parameter sweeps over σ, ρ, β
Every program outputs frames or images in PPM format, which can be turned into PNGs or GIF animations.
lorenz_attr/
│
├── lorenz_attr_clean/
│ ├── main.cpp
│ └── lorenz.ppm
│
├── lorenz_attr_vel/
│ ├── main.cpp
│ └── lorenz_speed.ppm
│
└── lorenz_attr_sweep/
├── beta_sweep/
│ ├── main.cpp
│ └── frame_000.ppm ...
├── rho_sweep/
│ ├── main.cpp
│ └── frame_000.ppm ...
└── sigma_sweep/
├── main.cpp
└── frame_000.ppm ...
Each folder contains one fully standalone simulation. .ppm files replaced by .png or .gif for easy viewing, they can still be generated by running the code.
The Lorenz system is defined by:
dx/dt = σ (y − x)
dy/dt = x (ρ − z) − y
dz/dt = x y − β z
This simple set of equations produces:
-
butterfly-shaped attractors
-
sensitivity to initial conditions
-
chaotic switching between “wings”
-
fractal interior structures
-
emergent order inside chaos
Every visualization in this repo is a different lens on the same underlying physics.
Simple 2D projection (x vs z).
Shows the pure shape of the attractor with white pixels on black background.
Colors each point by instantaneous speed ‖dx/dt‖.
Reveals fast and slow regions of the dynamics.
Three sub-projects that animate the attractor as:
-
σ varies
-
ρ varies
-
β varies
This produces a morphing butterfly — a visual story of how chaos emerges as parameters change.
All programs follow the same pattern:
g++ -O2 main.cpp -o lorenz
./lorenz
The program will output .ppm image(s).
If you generate animation frames (from parameter sweeps),
use ImageMagick:
magick -delay 6 -loop 0 frame_*.ppm lorenz.gif
-
All simulations use Euler integration unless otherwise noted.
-
No external libraries required — everything is pixel-by-pixel rendered.
-
The PPM format is used intentionally for simplicity and speed.
-
These programs are part of a broader exploration of chaotic systems, numerical ODEs, and scientific visualization.