Python表示欧拉公式

代码如下:

import matplotlib.pyplot as plt
import numpy as np
xx=[]
yy=[]
x=0
y=1
h=0.1
for i in range(10):
    x += h
    y = 1.1 * y - 0.2 * x / y
    xx.append(x)
    yy.append(y)
plt.plot(xx,yy)
plt.show()

运行截图:

Python表示欧拉公式_第1张图片 

 

你可能感兴趣的:(python,numpy,机器学习)