Phase Portraits of Nonlinear Systems
Plot direction fields and trajectories for arbitrary systems \(\dot{x}=f(x,y)\), \(\dot{y}=g(x,y)\). Click the canvas to integrate from any initial condition.
Nonlinear Autonomous Systems
A planar nonlinear autonomous system has the form \(\dot{x}=f(x,y)\), \(\dot{y}=g(x,y)\) where \(f\) and \(g\) are arbitrary (possibly nonlinear) functions. Unlike linear systems, the qualitative behaviour can vary across the phase plane: a single system can have multiple equilibria, limit cycles, homoclinic orbits, and chaotic regions in different parts of the plane.
Equilibria and Linearisation
An equilibrium is a point \((x^*,y^*)\) satisfying \(f(x^*,y^*)=g(x^*,y^*)=0\). Near each equilibrium, the system behaves like a linear system governed by the Jacobian matrix \(J = \partial(f,g)/\partial(x,y)\). The eigenvalues of \(J\) at the equilibrium determine the local classification — saddle, node, spiral, or center. Away from equilibria, the nonlinear terms dominate and the global portrait can differ substantially from any local linearisation.
Limit Cycles
A limit cycle is an isolated closed orbit that neighbouring trajectories spiral toward (stable) or away from (unstable). Limit cycles cannot occur in linear systems. The Van der Pol and FitzHugh-Nagumo systems in the example dropdown both exhibit stable limit cycles. The Poincaré-Bendixson theorem guarantees that if a trajectory is bounded and avoids equilibria, it must approach a limit cycle.
Numerical Solvers
- RK4 (Runge-Kutta 4th order): The classical explicit solver. Four function evaluations per step, 4th-order accurate. Suitable for most non-stiff systems. Fixed step size \(\Delta t = 0.03\), forward and backward in time.
- SDIRK2 (Singly Diagonally Implicit RK, 2nd order): An A-stable, L-stable implicit solver designed for stiff systems, where the Jacobian has widely separated eigenvalues forcing explicit solvers to take impractically small steps. Uses Newton iterations at each stage with numerical Jacobian, and adaptive step size via embedded error estimation. Recommended for Van der Pol with large \(\mu\), Brusselator, and Selkov models.
Expression Syntax
- Use standard math notation:
x^2,sin(x),exp(-x),sqrt(y),pi,e. - Multiplication must be explicit:
x*ynotxy. - Powered by math.js — see its documentation for the full list of supported functions.
How to Use
- Enter \(f(x,y)\) and \(g(x,y)\) in the expression fields, or select an example from the dropdown.
- Set the domain \([x_\min, x_\max]\times[y_\min, y_\max]\) and adjust arrow settings.
- Click Generate to draw the direction field. Then click anywhere on the phase plane to integrate a trajectory through that initial condition.
- For stiff systems, select SDIRK2 as the solver. Enable Nonneg to constrain \(x,y\ge0\) (useful for population models).
- Open the Time Series panel to plot \(x(t)\) and/or \(y(t)\) for all current trajectories.
- Use Download PNG to save the current portrait.