Slope Field & Phase Plane Plotter
See the shape of every solution of a differential equation at once, trace any solution with a click, and get each equilibrium found and classified.
Runs in your browser. Nothing is uploaded.
Equations
Every solution approaches the line y = x − 1.
Read as: x − y
Use x and y (or t and y in a slope field). Any other letter, such as a, k or r, becomes a slider. Functions include sin, cos, exp, ln, sqrt and abs; angles are in radians.
Slope field
Show
Click or tap the plot to draw the solution through that point. Drag to move the view; pinch, Ctrl + scroll or the buttons zoom. With the keyboard, focus the plot: arrow keys move the cursor, Enter draws a solution, Shift + arrows move the view, + and − zoom, Home resets it.Drag to move the view; pinch or the + and − buttons zoom.
Draw a solution to download its values as CSV.
Settings
Parameters
Add a letter such as a, k or r to an equation and it gets a slider here.
Slider ranges
| Name | Lowest | Highest | Step |
|---|
A value typed outside the range is kept, and the slider widens to fit it.
Window
Constant solutions
Your result appears here.
Solutions
No solutions yet. Click the plot, or add one by its starting point.
Add a solution through
Draw a solution to see x and y against time.
Follow the selected solution with a fixed step h, using Euler’s method and classical Runge–Kutta (RK4), and see how far each drifts from the adaptive solver.
| Method | Steps | y at the end | Largest gap |
|---|
Step by step
Each row is one step of size h. Euler’s next value is its value plus h times its slope.
| x | y |
|---|
How to use
- Choose Slope field for one equation dy/dx = f(x, y), or Phase plane for a system x′ = f(x, y), y′ = g(x, y).
- Type the right-hand side, or pick an example under Start from. Any letter other than x and y, such as a, k or r, gets a slider.
- Click or tap the plot to draw the solution through that point. To start at an exact point, type it under Add a solution through.
- Read the equilibria: each one comes with its Jacobian, trace, determinant, eigenvalues and type, and a numbered dot on the trace–determinant chart. Where a formula has a corner, as abs(x) has at 0, the point is listed as “Can’t classify here” instead.
- Drag to move the view. Zoom with the buttons, a pinch, or Ctrl + scroll.
- Download the figure as SVG or PNG and a solution as CSV. Copy link keeps the equations, sliders, window and solutions.
Worked example
In Slope field mode, Try an example loads logistic growth (shown at the end of this section); in Phase plane mode it loads the predator–prey system below.
Rabbits x and foxes y (in thousands) follow the predator–prey equations x′ = 1.0x − 0.5xy and y′ = −0.75y + 0.25xy. Choose Phase plane, then Try an example, to load them with the window x from −1 to 8 and y from −1 to 6.
Input
x′ = a x − b x y and y′ = −c y + d x y with a = 1, b = 0.5, c = 0.75 and d = 0.25. Solutions start at (3, 3) and (3, 4.5).
Equilibria found
(0, 0): Jacobian [[1, 0], [0, −0.75]], eigenvalues 1 and −0.75, a saddle.
(3, 2): Jacobian [[0, −1.5], [0.5, 0]], trace 0, determinant 0.75, eigenvalues ±0.866i, a center of the linearization.
Solutions
The orbit through (3, 3) closes with period 7.389. The larger orbit through (3, 4.5) takes 7.887. Small cycles near (3, 2) take about 2π/0.866 = 7.255.
Why the orbits really close: V = 0.25x − 0.75 ln x + 0.5y − ln y stays constant along every solution, because dV/dt = 0. So the center of the linearization is a true center here. Along the tool’s solution from (3, 3), V changes by less than one part in a million.
Second example, the damped pendulum θ″ + 0.5θ′ + sin θ = 0. As a system it is x′ = y, y′ = −sin(x) − 0.5y, with x the angle and y the angular velocity. (0, 0) is a stable spiral with eigenvalues −0.25 ± 0.9682i. (π, 0) is a saddle with eigenvalues 0.7808 and −1.281, and its separatrices split the solutions that swing over the top from those that don’t.
Slope field example: logistic growth dy/dt = 0.8y(1 − y/10). The constant solutions are y = 0 (unstable, ∂f/∂y = 0.8) and y = 10 (stable, ∂f/∂y = −0.8). From y(0) = 1 the tool gives y = 9.97 at t = 10, and the exact solution 10/(1 + 9e−0.8t) gives 9.9699. With a step of h = 0.5, Euler’s method drifts up to 0.514 from the accurate curve, while RK4 stays within 0.00027.
How it works
What a slope field shows
Each short segment has the slope dy/dx = f(x, y) at its center. A solution curve is tangent to every segment it passes. Where f and ∂f/∂y are continuous, exactly one solution passes through each point, so solution curves never cross. A phase plane does the same for a system: each arrow points along (x′, y′).
How solutions are drawn
Euler’s method steps along the tangent line, so its error grows in proportion to the step h. The classical Runge–Kutta method (RK4) averages four slopes per step, and its error shrinks like h⁴:
Euler: y(n+1) = y(n) + h·f(y(n)) RK4: k1 = f(y), k2 = f(y + h·k1/2), k3 = f(y + h·k2/2), k4 = f(y + h·k3) y(n+1) = y(n) + h·(k1 + 2·k2 + 2·k3 + k4)/6
The curves you click use the adaptive Dormand–Prince 5(4) method. Each step computes a fifth-order and a fourth-order result from the same seven slopes; their difference estimates the error. Steps are accepted when that error is below 10⁻⁹ of the values (plus 10⁻¹² of the window), and the next step grows or shrinks to match. Each solution is followed forward and backward in time.
In each direction of time, a solution stops when it:
- leaves the area three times the size of the window;
- settles on an equilibrium, or onto a cycle;
- comes back to its start: a closed orbit, listed with its period;
- comes back close to its start but not onto it: a slow spiral, listed with how much closer or further a turn ends;
- reaches a point where the equations have no value;
- needs a step smaller than a billionth of the window;
- grows beyond 10¹² in x or y, or runs past t = 10⁹;
- has taken 20,000 steps, or a path 40 times the window’s size.
To tell a closed orbit from a slow spiral, the tool solves that first turn again with tolerances 1,000 times smaller. A gap left by rounding shrinks with the tolerance; a real drift stays. Then it solves one more turn: a solution settling onto a cycle changes less and less, while a slow spiral keeps changing.
Equilibria and the Jacobian
An equilibrium is a point where x′ = 0 and y′ = 0 together. The tool runs Newton’s method from a 16 × 16 grid of starting points across the window, merges the copies, and lists up to 50. Near each equilibrium the system behaves like its linear part, the Jacobian matrix J of partial derivatives. The derivatives come from automatic differentiation, so they are exact up to rounding:
J = [ ∂f/∂x ∂f/∂y ] trace τ = ∂f/∂x + ∂g/∂y [ ∂g/∂x ∂g/∂y ] determinant Δ = ∂f/∂x·∂g/∂y − ∂f/∂y·∂g/∂x eigenvalues λ = (τ ± √(τ² − 4Δ)) / 2
Classifying by trace and determinant
| Condition | Type |
|---|---|
| Δ < 0 | Saddle: one eigenvalue above 0, one below |
| Δ > 0 and τ² > 4Δ | Node: stable if τ < 0, unstable if τ > 0 |
| Δ > 0 and τ² < 4Δ | Spiral: stable if τ < 0, unstable if τ > 0 |
| Δ > 0 and τ = 0 | Center of the linearization |
| τ² = 4Δ | Star node when J is a multiple of the identity, otherwise a degenerate node |
| Δ = 0 | The linearization can’t decide |
The Hartman–Grobman theorem says that when no eigenvalue has zero real part, solutions near the equilibrium look like those of the linear system. Centers and zero determinants are exactly the cases it leaves open. There the tool says so and lets the solutions you draw settle the question.
Nullclines and separatrices
The x-nullcline is the curve where x′ = 0: solutions cross it moving straight up or down. On the y-nullcline (y′ = 0) they move sideways. Equilibria sit where the two meet. The curves are traced by marching squares on a grid, and sign changes through a pole such as 1/x are left out. A rate that touches 0 without changing sign, such as x′ = x² along x = 0, gives no curve. Its equilibria are still listed. For every saddle the tool starts solutions a hair’s breadth away along each eigenvector and follows them out: the stable and unstable separatrices. They split the plane into regions whose solutions share a fate.
Second-order equations
Write a second-order equation as a system by naming the derivative. For θ″ + bθ′ + sin θ = 0, set x = θ and y = θ′. Then x′ = y and y′ = −sin(x) − b·y.
Sources
- J. R. Dormand and P. J. Prince, “A family of embedded Runge–Kutta formulae”, Journal of Computational and Applied Mathematics 6(1), 19–26, 1980: doi.org/10.1016/0771-050X(80)90013-3. The coefficients are also listed in the Dormand–Prince method article.
- Hartman–Grobman theorem: when linearization can be trusted.
- Lotka–Volterra equations: the conserved quantity V and the small-cycle period 2π/√(ac).
- Steven H. Strogatz, Nonlinear Dynamics and Chaos: the classification of fixed points and the rabbits-versus-sheep example behind the competing species preset.
FAQ
What does a slope field show, and how do I sketch one?
It shows the slope dy/dx = f(x, y) as a short segment at each point of a grid. Solutions run along the segments, never across them. To sketch one by hand, work out f at a grid of points, draw a short line with that slope at each, then draw curves that follow the lines. Here you get 20 segments per row, and a click draws the solution through that point.
How do I classify an equilibrium point?
Solve x′ = 0 and y′ = 0 together. Work out the Jacobian there, then its trace τ and determinant Δ. If Δ < 0 it is a saddle. If Δ > 0, compare τ² with 4Δ: larger means a node, smaller a spiral. Either is stable when τ < 0. The equilibria list shows each of these numbers.
What’s the difference between a node and a spiral?
Both pull nearby solutions in (stable) or push them out (unstable). At a node the eigenvalues are real, so solutions come in along curves without circling. At a spiral they are complex, so solutions turn as they go; the imaginary part sets how fast they turn.
The tool says “center of the linearization”. Is it really a center?
Not always. With τ = 0 and Δ > 0 the linear part circles forever, but the nonlinear terms can make real solutions spiral slowly in or out. Draw a solution near the point. After one turn the tool solves that turn again, 1,000 times more precisely. If the gap to the start shrinks with the precision, it lists a closed orbit with its period. If the gap stays, it says the solution spirals in or out, and by how much each turn. A drift too small for the solver to measure, about a billionth of the window per turn on most orbits, can still look closed. For x′ = y − x³, y′ = −x from (0.02, 0), each turn ends 0.094% closer to (0, 0). In the predator–prey example the orbits do close, because V = 0.25x − 0.75 ln x + 0.5y − ln y stays constant.
What are nullclines?
Curves where one of the rates is zero. On the x-nullcline (x′ = 0) solutions move straight up or down; on the y-nullcline (y′ = 0) they move sideways. Equilibria are where the two cross. In a slope field the matching curve is where the slope is 0, where solutions reach a high or low point.
Why did my solution curve stop?
The Solutions list says which of these happened, in each direction of time:
- it left the area three times the size of the window;
- it settled on an equilibrium or onto a cycle;
- it came back to its start (a closed orbit), or close to its start but not onto it (a slow spiral);
- it reached a point where the equations have no value, such as a division by zero;
- it needed a step smaller than a billionth of the window;
- it grew too large or ran for a very long time;
- it took 20,000 steps or a very long path.
How do I get an Euler’s method table?
Draw a solution, open Compare methods and type the step h. Step by step lists x, Euler’s y and the slope it uses at every step, next to RK4 and the adaptive solver. Take dy/dt = 0.8y(1 − y/10) from y(0) = 1 with h = 0.5. Euler gives 1.36 after one step and 1.83002 after two; the exact value at t = 1 is 1.98257. Download steps CSV saves every row.
Can I plot a second-order equation?
Yes, as a system. For θ″ + bθ′ + sin θ = 0, set x = θ and y = θ′; then x′ = y and y′ = −sin(x) − b·y. The damped pendulum example is set up this way.
Does it work on a Chromebook or a phone?
Yes. It runs in the browser with nothing to install, and it works with touch: tap to draw a solution, drag to move and pinch to zoom. On a phone the plot sits under the equations, with the sliders just below it.
Step by step: how to classify equilibrium points with the Jacobian matrix.
Updated