Practice: Planar Systems

Module 1: Low-Dimensional Dynamics

This is ungraded practice. You will build a Matplotlib animation for one planar ODE model (Strogatz 2024; Hunter 2007). The goal is to connect the geometry of the phase plane with the time evolution of the solution.

You can use these pages as guides:

CDIMA: Phase Plane Van der Pol Oscillator FitzHugh-Nagumo Model Animations and Interactivity

Goals

Your work should show that you can:

  • simulate a two-dimensional ODE correctly;
  • visualize the model in the phase plane and in time;
  • interpret nullclines, equilibria, and transient or oscillatory behaviour.
Model choice

Choose one model: the Van der Pol oscillator or the FitzHugh-Nagumo model (Session 9).

Tasks

  • Write one Python script that opens a figure for your chosen model.
  • Plot the nullclines and the equilibrium point.
  • State whether the equilibrium is stable or unstable.
  • Animate one trajectory in the phase plane using a line and a moving point.
  • Add a second subplot that animates one variable as a function of time.

Use the pipeline from CDIMA: Phase Plane as the structural template, and adapt it to your chosen system. Use Animations and Interactivity for the animation logic.

Short discussion

Include a brief paragraph that answers these questions:

  • What qualitative behaviour did your model show: convergence, oscillation or excitability?
  • How do the nullclines explain the geometry of the trajectories?
  • Which parameter had the clearest effect on the behaviour you observed?
Optional extension
  • Make the figure interactive so clicking on the phase plane resets the initial condition.
  • Compare two parameter values in the same report.
  • Add a short explanation of the fixed-point stability from the Jacobian or the observed flow.

Tips

  • Start with a static phase-plane plot before you animate anything.
  • Reuse the CDIMA structure instead of writing the whole script from scratch.
  • Test the ODE, nullclines, and fixed point separately.
  • Keep the first animation simple, then add labels or interaction.
  • Use the model page to decide which variable to show in the time subplot.
Tip

Reference implementations are available in amlab/odes_2d/cdima.py, amlab/odes_2d/van_der_pol.py and amlab/odes_2d/fitzhugh_nagumo.py.

Next

Hunter, John D. 2007. “Matplotlib: A 2D Graphics Environment.” Computing in Science & Engineering 9 (3): 90–95. https://doi.org/10.1109/MCSE.2007.55.
Strogatz, Steven H. 2024. Nonlinear Dynamics and Chaos: With Applications to Physics, Biology, Chemistry, and Engineering. Chapman; Hall/CRC.