Scipy 的 integrate 模块的 odeint 函数可以用来以数值积分法求解常微分方程。...import numpy as np
from math import sqrt
import sympy
import scipy
from scipy import integrate
from matplotlib...import pyplot as plt
# 上篇的向量场绘图函数
def plot_directtion_field(x, y_x, f_xy, x_lim=(-1,1), y_lim=(-1,1...# 绘出向量场以作对比
plot_directtion_field(x, y(x), f, x_lim=(-5,5), y_lim=(-2,10), n=80, ax=ax) # 向量场图...ax.plot(xn,yn,"r")
ax.plot(xp,yp,"r") # 两段拼一起
plt.show()