From: 3blue1brown
The Lorenz Attractor is a “bizarre shape” that emerged in the early history of chaos theory [00:10:44], [00:10:45]. It is derived from a set of deterministic differential equations in three dimensions [00:10:49]. These equations describe how a point in 3D space should change at any given moment in time [00:10:55], [00:10:59]. The system includes tunable parameters that, when adjusted, can yield interesting diagrams [00:13:56], [00:14:01].
The Lorenz Attractor is considered “nice fodder for animation” [00:11:08]. Its characteristics are often illustrated by plotting the paths of multiple points starting from very slightly different initial conditions [00:20:26].
Characteristics of the Lorenz Attractor
The system’s behavior is inherently chaotic [00:20:22]. While points starting extremely close to each other will initially evolve similarly, they soon diverge, eventually appearing to follow “completely different things” [00:20:30], [00:28:45], [00:28:50]. This sensitive dependence on initial conditions is a hallmark of chaos.
Despite this unpredictability, the Lorenz Attractor possesses a surprising property: regardless of where a point starts, its trajectory will eventually be “attracted to a certain shape” [00:36:29], [00:36:40], [00:36:52]. Unlike other differential equations that might attract to a single point, blow up to infinity, or settle into a cycle, the Lorenz Attractor is a “strange attractor” [00:36:43], [00:36:52]. This shape is not simple and exhibits a fractal nature [00:36:55], [00:36:59].
The paradoxical nature of the Lorenz Attractor lies in its combination of unpredictability and predictability: one knows that the trajectory will be confined to a specific subset of 3D space, but the exact location within that subset remains unknown [00:37:00], [00:37:06], [00:37:11].
Animation with Manim
The Lorenz Attractor is animated using a custom Python library called Manim [00:00:05]. The animation workflow involves:
- Setting up the 3D environment: While Manim defaults to 2D for pedagogical reasons, the Lorenz Attractor requires 3D axes [00:11:35], [00:12:05], [00:17:17]. Objects are placed on an XY plane by default unless specified [00:12:12].
- Solving the differential equations: A Python function describes the Lorenz system’s differential equations, which define the derivative of the state (XYZ coordinates) at a given time [00:13:35], [00:13:40], [00:13:42]. SciPy’s numerical ODE solver (
solve_initial_value_problem
) is used to find solutions based on initial conditions [00:12:54], [00:13:18], [00:14:15]. - Generating curves and points: The solutions from the ODE solver provide a set of points in 3D space [00:15:28], [00:15:32]. These points are interpreted by Manim as a curve using
set_points_as_corners
[00:16:17]. Thecoords_to_points
function converts mathematical coordinates to Manim’s rendering system [00:16:49], [00:16:53]. - Animating the evolution:
- The
ShowCreation
animation type is used to draw the curve over time, representing the system’s evolution [00:19:03], [00:19:09]. - Crucially, for physically accurate representation, the
rate_function
forShowCreation
is set tolinear
instead of the defaultsmooth
(which applies a cubic Bezier easing) [00:19:27], [00:19:33], [00:19:38], [00:19:42]. - Multiple curves can be animated simultaneously by iterating through a list of initial conditions and colors [00:20:37], [00:21:02], [00:22:18]. The
zip
function in Python is used to pair initial states with corresponding colors [00:22:00], [00:25:12]. - “Glow dots” are used to mark the endpoints of each curve, updating their position with an
updater
function at every frame [00:23:47], [00:23:59], [00:24:27], [00:24:58]. - A “Tracing Tail” effect can be applied to the dots, creating a fading trail behind them that smoothly transitions from full opacity to zero opacity and stroke width [00:39:04], [00:39:07], [00:51:00].
- The
- Camera movement: The camera frame can be animated using
frame.animate.reorient
to slowly pan and rotate, providing a better 3D perspective [00:33:55], [00:34:26]. - Displaying equations: LaTeX objects can be rendered on screen using
self.add(MathTex(...))
[00:44:41]. These can be “fixed in frame” to stay in view regardless of camera movement [00:45:16]. Manim also allows selective styling and manipulation of individual characters or variables within a LaTeX expression [00:45:56], [00:46:42]. Tools like MathPix can generate LaTeX code from images [00:44:50].
Related Concepts
- Differential Equations: The Lorenz Attractor is derived from a system of differential equations [00:10:49].
- Initial Conditions: The chaotic nature of the Lorenz Attractor is demonstrated by how slightly varied initial conditions lead to widely divergent paths [00:20:26].
- Attractors: While some systems are attracted to points or cycles, the Lorenz system is attracted to a “strange attractor” [00:36:43], [00:36:52].
- Fractal Geometry: The strange attractor of the Lorenz system possesses a fractal nature [00:36:59].
Further Reading
- Book: Chaos: Making a New Science by James Gleick [00:11:20], [00:11:22]
- Video: Veritasium video on the Lorenz Attractor [00:11:12]