我正在使用scipy.integrate.odeint函数,颂歌是
有溶液
通过解决它odeint
from scipy.integrate import odeint
import numpy as np
import matplotlib.pyplot as plt
def dy_dx(y, x):
return ((x+y)**2 - y)/((x+y)**2 - x)
xs = np.linspace(1,100,100)
y0 = 1
ys = odeint(dy_dx, y0, xs ,atol = 2)
ys = np.array(ys).flatten()
plt.plot(xs, ys)
plt.xlabel("x")
plt.ylabel("y")
这肯定与答案不符。可能出了什么问题?
