python 绘制流线图

主要用到 pylab 里的 meshgrid,streamplot 函数

绘制如下系统的相图:
x ˙ = 2 x y y ˙ = y + x \dot{x} = 2x - y\\ \dot{y} = y+x

from pylab import meshgrid,  arange, streamplot, show

x, y = meshgrid(arange(-3, 3.1, 0.1), arange(-3, 3.1, 0.1))

vx = 2 * x- y
vy = y + x

streamplot(x, y, vx, vy)

show()

在这里插入图片描述

原创文章 338 获赞 621 访问量 50万+

猜你喜欢

转载自blog.csdn.net/itnerd/article/details/105320661