This is a small collection of Python scripts which illustrate how to integrate ODEs in Python and how to plot trajectories in phase space.
Either clone this repository as
git clone git@github.com:benmaier/phase_space_example.git
As an illustration example, you could begin with a simple pendulum. In
01_ode_example_pendulum.py
,
I illustrated how to write down the equations of motion as a function
and then integrated it to obtain a limit cycle in phase space.
In 02_scan_pendulum.py
I added a few lines of code to illustrate how one would scan different
initial conditions and parameters to see how the trajectories change.
In 03_ode_example_lotka_volterra.py
,
I show how to integrate a Lotka-Volterra system and how
to plot both the time evolution as well as the phase space trajectory.
Finally, in 04_ode_example_lorenz.py
,
I replicated the figures from Dave's lecture for the Lorenz system.
Playing around with this system is the most fun because it shows chaotic behavior.