phase

ODE Solvers

Generate a phase portrait for a 2D ODE system. Shows vector field (quiver arrows), sample trajectories, and equilibrium points with stability classification (stable node/spiral, unstable, saddle, center). One-liner visualization of dynamical systems.

Syntax

phase(f, [-4 4], [-3 3])
phase(f, xrange, yrange, struct('trajectories', 12))

Examples

% Pendulum
phase(@(t,y) [y(2); -sin(y(1))], [-4 4], [-3 3])
▶ Run
% Damped oscillator
phase(@(t,y) [y(2); -0.5*y(2) - 2*y(1)], [-3 3], [-3 3])
▶ Run

See Also

Try SimLab — Free MATLAB® Alternative

466 functions. Runs in your browser. No install.

Open SimLab

Stay Updated

Get notified about new simulations and tools. We send 1-2 emails per month.