Assignment
ODEs in 2D
You will build a Matplotlib animation for one 2D ODE model.
Choose a model
Write one Python script that, when executed, opens a figure showing:
- the nullclines
- the equilibrium point, telling whether it’s stable or unstable
- an animated trajectory in the phase plane (line + moving point)
Use the pipeline showed for the CDIMA model as a starting point, and adapt it to the model you choose. For the animation, follow the steps outlined in the animation page.
Then, add a second subplot that animates the time evolution of one variable (as indicated in the page for each model).
Extra Mile (Optional): Make the figure interactive: clicking on the phase plane sets the initial condition, and the animation restarts.
Tips for Success
- Start simple: Get the ODE function working first, then build up.
- Test incrementally: Verify each function works before moving to the next.
- Use the reference: The provided code (and additional documentation) is there to help you understand the structure.
- Experiment: Try different parameter values and see what happens.
- Collaborate: Discuss with your teammates, divide the work if needed. You can also work separately and then compare your implementations.
- Ask questions: If you’re stuck, ask for help!
Good luck and enjoy your coding!