PhysSandbox
Classical MechanicsWaves & SoundElectricity & MagnetismOptics & LightGravity & OrbitsLabs
🌙Astronomy & The Sky🌡️Thermodynamics🌍Biophysics, Fluids & Geoscience📐Math Visualization🔧Engineering🧪Chemistry

More from Math Visualization

Other simulators in this category — or see all 61.

View category →
School

Lissajous Curves

Beautiful patterns from two frequencies with adjustable ratio.

Launch Simulator
NewKids

Harmonograph

Two damped harmonic sums in x and y: decaying rosette trace vs Lissajous loops.

Launch Simulator
NewKids

Spirograph (Trochoids)

Hypo- or epitrochoid: fixed R, rolling r, pen d; hue trail and period hints.

Launch Simulator
NewKids

Sorting Algorithms (parallel)

Bubble, insertion, merge, quicksort, and heapsort on the same shuffled permutation — five bar rows advance in lockstep so you can compare how each method moves values.

Launch Simulator
NewSchool

SIR Epidemic Model

S + I + R = 1: βSI and γI; ℛ₀ ≈ β/γ, herd threshold 1 − 1/ℛ₀; RK4 time plot.

Launch Simulator
NewSchool

Sandpile (SOC)

BTW abelian model: add grains, ≥4 topples to neighbors; critical avalanches.

Launch Simulator
PhysSandbox

Interactive physics, chemistry, and engineering simulators for students, teachers, and curious minds.

Physics

  • Classical Mechanics
  • Waves & Sound
  • Electricity & Magnetism

Science

  • Optics & Light
  • Gravity & Orbits
  • Astronomy & The Sky

More

  • Thermodynamics
  • Biophysics, Fluids & Geoscience
  • Math Visualization
  • Engineering
  • Chemistry

© 2026 PhysSandbox. Free interactive science simulators.

PrivacyTermsContact
Home/Math Visualization/2D Phase Portrait (ODE)

2D Phase Portrait (ODE)

A phase portrait for a planar autonomous ordinary differential equation plots the state (x, y) and shows how it evolves under x′ = f(x, y) and y′ = g(x, y) without displaying time explicitly. This simulator draws a uniform grid of short arrows whose directions match the vector field (f, g), normalized for readability so you can read the flow at a glance. Clicking inside the plot seeds a fourth-order Runge–Kutta integrator that marches both forward and backward in time until the trajectory leaves an expanded viewport, building a single curve through the clicked point. Presets include the undamped harmonic oscillator (elliptic orbits around a center), a damped linear oscillator whose damping ratio ζ controls decay to a stable spiral, a hyperbolic saddle with separatrices, stable and unstable nodes, stable and unstable spirals from fixed 2×2 linearizations, and the ideal pendulum written as θ′ = ω, ω′ = −sin θ so x is angle and y is angular velocity. Equilibrium locations are marked with small dots. The tool is intentionally lightweight: no bifurcation scanning, no nullclines, and no detection of limit cycles—those are natural follow-ons after students grasp orbits in the plane.

Who it's for: Undergraduate ODE or dynamical systems students learning equilibria, linearization, and qualitative behavior before quantitative time-series plots.

Key terms

  • Phase plane
  • Autonomous ODE
  • Vector field
  • Trajectory
  • Equilibrium
  • Saddle
  • Spiral
  • Center
  • Runge–Kutta

Phase plane

Click or tap inside the plot to trace a solution forward and backward in time (RK4). R clears all trajectories.

1

Harmonic: x′=y, y′=−ω²x. Damped adds −2ζωy. Saddle: x′=x, y′=−y. Stable node: x′=−x, y′=−y; unstable: x′=x, y′=y. Foci: fixed linear spirals. Pendulum: x=θ, y=ω with ω′=−sin θ.

Shortcuts

  • •R — clear all trajectories

Measured values

PresetHarmonic
Trajectories0

How it works

The phase plane plots (x, y) for a planar autonomous system x′ = f(x, y), y′ = g(x, y). A direction field shows the tangent to trajectories; clicking seeds a high-order Runge–Kutta integration forward and backward in time. Presets include the harmonic oscillator (center), damped oscillator (stable spiral when ζ > 0), a saddle, stable and unstable nodes, stable and unstable spirals from a fixed linearization, and the undamped pendulum angle–angular velocity system.

Key equations

x′ = f(x, y), y′ = g(x, y)
Harmonic: x′ = y, y′ = −ω²x
Pendulum: θ′ = ω, ω′ = −sin θ

Frequently asked questions

Why do some trajectories stop at the edge of the window?
Integration halts when the state leaves a slightly expanded box around the visible axes. That keeps the numeric solution from running forever on unbounded orbits (for example along unstable manifolds of a saddle) and keeps the display responsive.
Why does the damped preset look like a center when ζ = 0?
With ζ = 0 the equations reduce to the same undamped harmonic form as the harmonic preset (up to the shared ω scaling). Any tiny ζ > 0 breaks the closed loops and produces a spiral in toward the origin for this linear model.
What do the yellow dots mean?
They mark equilibrium points where f = g = 0 at the resolution of the model. The origin is always shown for the linear presets; the pendulum preset also marks ±π on the angle axis where sin θ = 0.
Is this a substitute for a full ODE solver or bifurcation tool?
No. It is a visual sketchpad: fixed viewing window, fixed step RK4, no error control, no phase or eigenvalue readouts beyond what you infer from the picture. Use a dedicated solver for publication-quality plots or parameter scans.