Phase portraits
This simulation needs WebAssembly, and it could not start in this browser.
The image is a frame from a real run. Check that JavaScript is on, or try another browser.
A two-dimensional system , can be understood without solving it. Draw the direction of the flow across the plane, mark the curves where one of the two velocities vanishes, and follow a handful of trajectories: fixed points, closed orbits and the boundaries between basins then show up directly. This page does that for five standard systems.
What you see
The plane from −3 to 3 in both directions (set by view scale). Short strokes on a 21 × 21 grid give the direction of the flow. They are fainter where the flow is slow and vanish where its speed drops below 1. With nullclines on, a dotted blue curve marks and a dotted red curve ; where they cross, both velocities vanish and there is a fixed point. 24 trajectories start from a 5 × 5 grid of points between −2 and 2, the origin left out, each in its own color with a fading trail.
Simple harmonic oscillator: every trajectory runs around the origin on a circle, all with the same period . Energy is conserved, so the circles neither grow nor shrink.
Van der Pol (μ=1): all trajectories approach the same closed cycle, which reaches . Those starting inside spiral outward, those outside spiral inward.
Hopf, above onset (μ=1): in polar coordinates the system reads , . The origin is unstable, and every trajectory winds counterclockwise onto the circle .
Hopf, below onset (μ=−1): the same system with negative μ. There is no cycle; every trajectory spirals into the stable origin. As μ crosses zero the cycle is born with radius , which makes this a supercritical Hopf bifurcation.
Saddle (unstable): trajectories start from a smaller grid between −0.5 and 0.5. They come in along the axis and leave along the axis on hyperbolas. The four that start on the axis run straight into the origin, and the four on the axis straight out.
Duffing double-well: damping α = 0.2. The origin is a saddle and are stable foci at the bottoms of the two wells. Each trajectory spirals into one of them; the two basins are separated by the pair of trajectories that run into the saddle, which, followed backward in time, wind outward around both wells.
Governing equation
The five systems, chosen with ODE system:
All trajectories are integrated with fourth-order Runge-Kutta, with a step of 0.02 and two steps per frame.
Parameters
ODE system: 0 to 4, in the order above, default 0.
μ (bifurcation param): −3 to 5, default 1. Used by the Van der Pol and Hopf systems.
α (damping, Duffing): 0 to 2, default 0.3. Used by the Duffing system.
trail: the trail length in frames, 10 to 500, default 200.
view scale: half the width of the visible plane, 1 to 5, default 3.