Examples#

This gallery walks through every public feature of mathematicskit.ode_dynamics: fixed-point stability classification, phase portraits, the logistic map’s route to chaos, canonical bifurcation normal forms, the Van der Pol limit cycle, Poincare sections of the driven Duffing oscillator, Lyapunov functions and Bendixson’s criterion, population, epidemic, neuron, and chemical models, Kuramoto synchronization, and the Lorenz and Rossler attractors.

See also the narrative tutorials:

Each script in this gallery is self-contained and can be run directly with python examples/ode_dynamics/<section>/<script>.py.

Sections#

  • stability – Jacobian linearization, the trace-determinant classification of node/saddle/spiral/center fixed points, and quadratic Lyapunov functions.

  • phase_portrait – linear and nonlinear planar flows, and vector-field quiver plots.

  • logistic_map – the period-doubling bifurcation cascade and an estimate of the Feigenbaum constant.

  • bifurcations – saddle-node, pitchfork, and Hopf normal forms.

  • limit_cycles – the Van der Pol oscillator’s amplitude-independent limit cycle, Bendixson’s negative criterion, and the Brusselator’s Hopf bifurcation.

  • poincare – stroboscopic Poincare sections of the periodically driven Duffing oscillator.

  • population – Verhulst’s logistic growth and Lotka-Volterra predator-prey cycles.

  • epidemics – the Kermack-McKendrick SIR model’s threshold, peak, and final size.

  • excitable – the FitzHugh-Nagumo neuron’s excitability and spiking.

  • synchronization – the Kuramoto model’s synchronization transition.

  • chaotic_flows – the Lorenz attractor and its butterfly effect, and the Rossler attractor and its return map.

  • integrators – Euler’s method, Runge-Kutta, Stormer-Verlet, Dormand-Prince adaptive stepping, Yoshida’s symplectic composition, and Adams-Bashforth multistep methods.

  • stiffness – Dahlquist’s A-stability, Curtiss and Hirschfelder’s BDF, Robertson’s stiff kinetics, Radau IIA, and collocation for boundary-value problems.

Bifurcation normal forms#

Saddle-node, pitchfork, and Hopf bifurcations.

Saddle-node, pitchfork, and Hopf bifurcation diagrams

Saddle-node, pitchfork, and Hopf bifurcation diagrams

Chaotic flows#

Lorenz’s butterfly attractor and its sensitive dependence on initial conditions, and the Rossler attractor, a minimal three-dimensional chaotic flow.

Lorenz’s butterfly effect: deterministic chaos

Lorenz's butterfly effect: deterministic chaos

The Rossler attractor

The Rossler attractor

Epidemic models#

The Kermack-McKendrick SIR model, its threshold, and its final size.

The Kermack-McKendrick SIR model

The Kermack-McKendrick SIR model

Excitable systems#

The FitzHugh-Nagumo neuron: excitability and periodic spiking.

FitzHugh-Nagumo: excitability and spiking

FitzHugh-Nagumo: excitability and spiking

Numerical integration#

The explicit integrators behind every trajectory in this gallery: Euler’s method, Runge-Kutta, Stormer-Verlet, Dormand-Prince adaptive stepping, Yoshida’s symplectic composition, and the Adams-Bashforth multistep methods and their stability regions.

Euler’s method: first-order convergence

Euler's method: first-order convergence

Runge, Heun and Kutta: Runge-Kutta methods

Runge, Heun and Kutta: Runge-Kutta methods

Stormer-Verlet: bounded energy error over long times

Stormer-Verlet: bounded energy error over long times

Dormand-Prince: embedded pairs and adaptive step size

Dormand-Prince: embedded pairs and adaptive step size

Yoshida’s symplectic composition: fourth order from leapfrog

Yoshida's symplectic composition: fourth order from leapfrog

Bashforth and Adams: linear multistep methods

Bashforth and Adams: linear multistep methods

Limit cycles#

The Van der Pol oscillator’s amplitude-independent limit cycle.

The Van der Pol limit cycle

The Van der Pol limit cycle

Bendixson’s negative criterion

Bendixson's negative criterion

The Brusselator’s Hopf bifurcation

The Brusselator's Hopf bifurcation

The logistic map#

The period-doubling route to chaos and the Feigenbaum constant, and an animated cobweb diagram as \(r\) grows.

Feigenbaum’s universal constant in the period-doubling cascade

Feigenbaum's universal constant in the period-doubling cascade

Animated: the logistic map’s cobweb as r grows

Animated: the logistic map's cobweb as r grows

Phase portraits#

Linear and nonlinear planar flows and their vector fields.

Poincaré’s qualitative method: the pendulum’s phase portrait

Poincaré's qualitative method: the pendulum's phase portrait

Poincare sections#

Stroboscopic Poincare sections of the periodically driven Duffing oscillator.

Poincare sections of the driven Duffing oscillator

Poincare sections of the driven Duffing oscillator

Population models#

Verhulst’s logistic growth and the Lotka-Volterra predator-prey cycles.

Verhulst’s logistic growth

Verhulst's logistic growth

Lotka-Volterra predator-prey cycles

Lotka-Volterra predator-prey cycles

Fixed-point stability#

Jacobian linearization and the trace-determinant classification of node/saddle/spiral/center fixed points.

Poincaré’s classification of fixed points: nodes, saddles, spirals, centers

Poincaré's classification of fixed points: nodes, saddles, spirals, centers

Lyapunov’s direct method

Lyapunov's direct method

Stiffness and boundary-value problems#

Why explicit integrators stall on stiff systems: Dahlquist’s A-stability, Curtiss and Hirschfelder’s BDF, Robertson’s stiff kinetics, Radau IIA implicit Runge-Kutta, and boundary-value problems by collocation.

Dahlquist’s A-stability: backward Euler vs RK4

Dahlquist's A-stability: backward Euler vs RK4

Curtiss and Hirschfelder: stiffness and BDF

Curtiss and Hirschfelder: stiffness and BDF

Robertson’s stiff chemical kinetics

Robertson's stiff chemical kinetics

Butcher, Ehle and Radau IIA: L-stable implicit Runge-Kutta

Butcher, Ehle and Radau IIA: L-stable implicit Runge-Kutta

De Boor and Swartz: collocation for boundary-value problems

De Boor and Swartz: collocation for boundary-value problems

Synchronization#

The Kuramoto model’s transition from incoherence to collective synchrony.

The Kuramoto synchronization transition

The Kuramoto synchronization transition

Gallery generated by Sphinx-Gallery