Tools / 01

Differential equations

Direction fields, phase planes, and numerical solutions.

The calculator needs JavaScript. If it does not open, reload this page. The equation and method notes are available below.

Direction field0 solutions
Equations ↑

Direction field and solution curves appear here.

Horizontal: t · Vertical: yClick to add a solution

Choose an equation, then add an initial value.

Adaptive RK4 · max. step 0.1

Parameters

Use a, b, and c in your equations.

Plot window

Integration

Time span applies in each selected direction. For Euler, max. step is the fixed step size.

Equation and method notes

02 / Reference
Writing an equation

Enter only the right-hand side. Use t, y for a direction field and x, y for an autonomous phase plane. Parameters a, b, c are numbers you can adjust.

Operators: + - * / ^ and parentheses. Powers are right-associative: 2^3^2 = 512. Write 2*y, not 2y.

Functions: sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, exp, log, ln, sqrt, abs. Use parentheses, as in sin(t). Angles are in radians; log and ln are natural logarithms. Constants: pi, e.

Reading the plots

Direction-field segments show dy/dt. Phase-plane arrows show the direction of (dx/dt, dy/dt); their lengths are normalized and do not represent speed.

Click or tap to add a curve through that point. You can also enter coordinates, or focus the plot and use arrow keys followed by Enter. The selected curve is darker. Its time plot and value slider show the numerical samples.

Nullclines mark where either derivative is zero. Equilibria satisfy both equations. The search uses starting points across the visible window; it may miss roots. A nonhyperbolic linearization does not determine nonlinear stability.

For a second-order autonomous equation, set x to position and y to velocity: x′ = y, y′ = f(x,y). The oscillator and pendulum examples use this form.

Numerical methods and limits

Adaptive RK4 compares one full step with two half steps to estimate local error. Tolerance controls this estimate, not the total error. Euler uses a fixed step and can become unstable even when a true solution is stable.

Reduce the step size and compare results. These explicit methods are intended for smooth, non-stiff ordinary differential equations. Singularities, discontinuities, and stiff systems need additional care. Curves stop at a numerical or work limit and report the reason.

Up to 16 curves can be displayed. Values are computed in your browser. The CSV contains the selected curve's numerical samples; the SVG contains the current plot.

References

The interaction follows John Polking's dfield and pplane: fields, initial-value curves, and phase-plane analysis. This page uses its own implementation.

See NIST DLMF §3.7(v) for the fourth-order Runge–Kutta rule and MathWorks' Phase Plane and Slope Field tools for related numerical analysis.