Building ODEs, Isoclines Using Python

I am looking for a Python package that will allow me to display something similar to the Java applet shown below:

http://math.mit.edu/mathlets/mathlets/isoclines/

Does anyone know of any ODE building plans for this? I can do something from scratch using Numpy, Matplotlib, but first wanted to ask.

Thank,

+3
source share
3 answers

I wrote something like this, it seems to work for y '= y ^ 2-x

from pylab import *
xmax = 4.0
xmin = -xmax
D = 20
ymax = 4.0
ymin = -ymax
x = linspace(xmin, xmax, D)
y = linspace(ymin, ymax, D)
X, Y = meshgrid(x, y)
deg = arctan(Y**2 - X)
QP = quiver(X,Y,cos(deg),sin(deg))
show()

enter image description here

+2
source

Sage will do this:

x,y = var("x y")
eq = y^3-3*y-x
p = implicit_plot(eq==0,(x,-4,4),(y,-4,4))
p += plot_slope_field(eq, (x,-4,4),(y,-4,4), headlength=1e-8)
p.show(aspect_ratio=1)

although it just wraps matplotlib functionality for graphics. (Honestly, matplotlib packaging is not as good as it could be, which often causes me headaches.)

example

+2
source

In these answers there is no way to change parameters using the drag and drop tool. If you want this option, then these two exemplary dynamic systems show you how to do this. They are written in Sage Python. Think of it like Python with many pre-built math functions.


Sage Example 1 - phase plot .
Sage Example 2 - a plot of the trajectory .

0
source

All Articles