This is the same question as this one, except for Python instead of Mathematica. Basically, the MATLAB software PPLANE is a staple in ODE courses. Is there a Python equivalent?

I don't know much about the software since my class just started using it, but I basically need it for plotting nullclines and trajectories, as well as finding fixed points and their stability. PPLANE can basically do all of this through a nice GUI without having to write any code.

Sample outputs from pplane:

PPLANE example slope field

PPLANE example slope field

  • 1
    $\begingroup$ What does the software do? $\endgroup$
    – nicoguaro
    Oct 18, 2021 at 3:36
  • 2
    $\begingroup$ following up on @nicoguaro's question, what parts of the software do you need? Plotting some streamlines and fixed points is relatively easy to do yourself. Finding closed orbits is a bit harder. $\endgroup$ Oct 18, 2021 at 6:23
  • $\begingroup$ @ThijsSteel see edit to the question $\endgroup$ Oct 18, 2021 at 14:05
  • $\begingroup$ @nicoguaro see edit ^ $\endgroup$ Oct 18, 2021 at 14:06
  • $\begingroup$ Please point your teaching assistant to the following resource: github.com/MathWorks-Teaching-Resources/…. The old pplane is now severely outdated and no longer works for the latest versions of Matlab. $\endgroup$ Oct 18, 2021 at 14:52

2 Answers 2


I'm not aware of any alternatives written in python.

However, i don't think an alternative is strictly necessary. Firstly, even if you don't know how to write Matlab code, you should be able to figure out the GUI. Secondly, The app https://github.com/MathWorks-Teaching-Resources/Phase-Plane-and-Slope-Field is the latest version of pplane and is written as a Matlab app, so it should be possible to run it without Matlab installed (if you can't get it working without a license, you can maybe ask your TA to help you create an executable).

If neither of these work, you'll probably have to write some python code to simulate the system and plot it yourself.

  • $\begingroup$ There are multiple reasons to want an alternative. You could want to enable your students to run it on their own laptop and use It in homework for example. In this case, a commercial Matlab license is not an option. $\endgroup$
    – BlaB
    Oct 19, 2021 at 10:24
  • $\begingroup$ I believe that it should be possible to run that GUI without a matlab license. But sure, a python/c++ version would be useful to not have to go through the process. You might also want students to be able to edit the graph easily without knowing matlab. $\endgroup$ Oct 19, 2021 at 11:32

I do not really know how much this can help you, but maybe you can use this code for rough sketches of the dynamics of planar vector fields. I know that it does not have the functionality that you may really wish for, but it may come in handy to guide the analysis in the right direction.

import numpy as np
import matplotlib.pyplot as plt

def plot_dynamics(vector_field, x_left, x_right, x_res, y_down, y_up, y_res):
    x, y = np.meshgrid(np.linspace(x_left, x_right, x_res), np.linspace(y_down, y_up, y_res))
    Vx, Vy = vector_field(x, y)
    if type(Vx) != object:
        Vx = Vx * np.ones(x.shape, dtype=float)
    if type(Vy) != object:
        Vy = Vy * np.ones(x.shape, dtype=float)
    fig, ax = plt.subplots()
    #ax.set_aspect( 1 )
    ax.streamplot(x, y, Vx, Vy)
    return None

# type the formulas for the x and y components of the vector fields 
# (use np.cos and np.sin etc if not polynomial vector fields):
def V(x, y):    
    return  ( 2*x - y + 3*(x**2-y**2) + 2*x*y,   x - 3*y - 3*(x**2-y**2) + 3*x*y )

def f(x, y):    
    return  ( 1,  y**2 - x ) 

plot_dynamics(V, -2, 4, 100, -4, 2, 100)
plot_dynamics(f, -2, 10, 100, -4, 4, 100)

enter image description here

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.