Home / Science / Maths, statistics and computing / Applied mathematics / ODE solver with phase portraitsTool #548

ODE solver online: phase portrait, direction field, nullclines, equilibria, bifurcation diagram (RK4, RK45)

Type a system of differential equations and solve it in your browser with RK4 or adaptive RK45 (as SciPy). Time plots, phase portrait with direction field and nullclines, equilibria with eigenvalues, a bifurcation diagram, and a heat and wave equation playground.

Keep it one tap away for everyday use.

Bookmark ODE solver with phase portraits?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. Equations
  2. Start values
  3. Solve
  4. Equilibria
Nothing is uploadedWorks offline once open

Equations

Use + − * / ^, brackets, t (time), pi, and sin, cos, tan, exp, ln, log, sqrt, abs, sinh, cosh, tanh, atan2, min, max. Anything after # is a comment.

Start values and time

Heat and wave equation playground

One space dimension, solved by explicit finite differences. A time step past the stability limit makes the numbers blow up; try it.

What it does

Type a system of ordinary differential equations (ODEs), one per line, and this tool solves it in your browser. You get:

  • A time plot of every variable, and the solution as a CSV file.
  • A phase portrait: one variable against another, with a direction field (little arrows showing where the system is heading from each point) and the nullclines (curves where one variable stops changing). Tap the picture to start another path from any point.
  • Equilibria (points where nothing changes), found by Newton’s method, with the eigenvalues of the Jacobian and what they mean: stable or unstable node, spiral, saddle or centre.
  • A bifurcation diagram: sweep a parameter and see where the behaviour changes, for example where a resting state starts to oscillate.
  • A heat and wave equation playground: the 1D diffusion and wave equations solved by explicit finite differences, with the stability limit shown, so you can watch a too-large time step blow up.

How to use it

  1. Pick an example, or type your own. Write equations as x' = y or dx/dt = y, and parameters as mu = 1. You may use t, pi, brackets and functions such as sin, exp, ln and sqrt.
  2. Set the start value of each variable, and the start and end time.
  3. Choose the method. Adaptive RK45 (Dormand-Prince) picks its own step size to keep each step’s estimated error below the tolerance; it takes exactly the same steps as SciPy’s solve_ivp with method="RK45". RK4 uses equal steps you choose.
  4. Below the time plot, choose which variables go across and up in the phase portrait. Leave the window on “auto” or type the range.
  5. To draw a bifurcation diagram, pick a parameter and its range and press Draw the diagram.

Worked example

The default is the Van der Pol oscillator, x’ = y, y’ = μ(1 − x²)y − x with μ = 1, starting at x = 2, y = 0. With tolerance 10⁻⁶ the solver takes 262 steps (and rejects 92 that were too large) to reach t = 30, where x = −2.00791 and y = 0.0519762. The path settles on a closed loop, a limit cycle, whose largest x is about 2.01. The only equilibrium is the origin. Its Jacobian has eigenvalues 0.5 ± 0.866i, so it is an unstable spiral: paths spiral out of it onto the loop. Sweep μ from −1 to 3 and the diagram shows the origin is stable for μ < 0 and that a swing of size about 2 appears for μ > 0, a Hopf bifurcation at μ = 0.

In the heat equation playground, with D = 0.1, 51 grid points (Δx = 0.02) and Δt = 0.001, the number r = DΔt/Δx² is 0.25, below the limit of ½, so the scheme is stable. The middle of the bar falls from 1 to 0.61045 at t = 0.5; the exact answer is e^(−0.05π²) = 0.61050. Change Δt to 0.0025 (r = 0.625) and the numbers blow up.

How the maths was checked

RK45 was compared with SciPy 1.18.1: for the Van der Pol example at SciPy’s default tolerance, both take 52 steps and 434 evaluations and agree to 10⁻¹¹; dense output at chosen times agrees to 10⁻¹³. The Lorenz system agrees with SciPy’s DOP853 at tight tolerance. Eigenvalues were compared with NumPy, and the heat and wave schemes with the same schemes written in NumPy and with exact solutions.

Good to know

  • Stiff equations (very fast and very slow parts together, as in some chemistry) need tiny steps with these explicit methods. The tool stops after 200,000 steps and says so. It has no implicit (stiff) solver.
  • A centre found by the linear test may really be a slow spiral: the nonlinear terms decide.
  • The bifurcation diagram follows one path: it can miss branches you never visit. It does not do numerical continuation of unstable cycles.
  • For the heat equation the explicit scheme needs r = DΔt/Δx² ≤ ½; for the wave equation the Courant number cΔt/Δx must be ≤ 1. Halving Δx means a four times smaller step for heat.

Frequently asked questions

Is anything uploaded? No. All the solving happens in your browser, and nothing is stored.

How do I solve a second-order equation? Write it as two first-order ones: for x” = −x, use x’ = v and v’ = −x.

Why does the direction field ignore t? If your equations depend on time, the arrows show the directions at the start time only.

What is the CSV? 1001 evenly spaced times (RK45, from its dense output) or every step (RK4), one column per variable.

Where the numbers come from

  • Methods: Dormand and Prince (1980) RK5(4) pair with Shampine's (1986) dense output, step control as SciPy's solve_ivp RK45; classic RK4; explicit finite differences (FTCS, leapfrog). Example systems are textbook models with round, made-up parameter values.

Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

Last updated 2026-11-09.

Related tools

Trend and anomaly analyser #138 Paste or open a time series (yearly, monthly or any steps) and test for a trend with Mann-Kendall, the Hamed-Rao autocorrelation correction or the seasonal test, get Sen's slope with its confidence interval, a Pettitt change point and anomalies from a baseline period. Light curve period finder #48 Paste times and brightness measurements, even with gaps and uneven spacing, and find the period with a Lomb-Scargle periodogram, false alarm probabilities, alias checks and a folded light curve. Publication plot maker #27 Paste columns or open a CSV or Excel file and get a clean scientific figure with error bars, sized for a journal column. Download vector SVG or PDF, or PNG at 300 or 600 dpi. Your data stays in your browser. Fourier series and FFT visualiser #549 See how sines and cosines build a square, sawtooth or any typed wave, watch the Gibbs overshoot, draw shapes with epicycles, and take the FFT of a formula or your own data with Hann, Hamming, Blackman or flat-top windows. All in your browser. Dimensional analysis (Buckingham Pi) helper #551 List your variables with their dimensions (M L T Θ I N J) and get the dimension matrix, its rank, an integer null-space basis and the dimensionless Π groups for the repeating variables you choose. Exact arithmetic, in your browser. Chaos explorer #552 Explore chaos in your browser: the logistic map (or any typed map) with cobweb, orbit diagram, Lyapunov exponent and Feigenbaum period-doubling points; the Lorenz and Rössler attractors in a 3D view you can turn, with their Lyapunov spectrum; and the Hénon map. Agent-based model playground #587 Watch simple local rules make large patterns: boids that flock, Schelling's model of segregation and an epidemic spreading on a grid. Change the parameters, set a seed to repeat a run exactly, step or run, and chart what happens over time.