import matplotlib.pyplot as plt
a = 0
b = 1
y0 = b
x0 = a
m= a
xx = [0] * 101
yy = [0] * 101
for i in range(1,101):
x1=x0+0.1
z= 1.1*y0-0.2*x0/y0
m=y0+0.1*z
z0 = m-2*x1/m
y1=y0 +1/2*0.1*(z+z0)
x0=x1
y0=y1
xx[i]=x1
yy[i]=y1
print(xx[i],yy[i])
plt.plot(xx,yy)
plt.show()
欧拉算法作业
最新推荐文章于 2024-07-25 21:13:04 发布