I have code that will work for plotting the following predator prey model:
dx/dt = x − xy, dy/dt = −y + xy
from pylab import *
xvalues, yvalues = meshgrid(arange(0, 3, 0.1), arange(0, 3, 0.1))
xdot = xvalues - xvalues * yvalues
ydot = - yvalues + xvalues * yvalues
streamplot(xvalues, yvalues, xdot, ydot)
show()
But I am not sure how to use these functions to draw a phase plane (using streamplot) to model pendulum motion, defined as
d^2θ/dt^2 = (−g/L)sin(θ)
How can I implement this model to produce a phase plane using matplotlib and pylab?