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.
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?
- 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.
Reference implementations are available in amlab/odes_2d/cdima.py, amlab/odes_2d/van_der_pol.py and amlab/odes_2d/fitzhugh_nagumo.py.