欧拉算法


import matplotlib.pyplot as plt
targetX = 10.0
step = 0.1
axis1, axis2 = 0.0, 1.0
X, Y = [axis1], [axis2]

def fun(axis1:float, axis2:float):
    return axis2 - 2 * axis1 / axis2

while axis1 <= targetX:
    t1 = fun(axis1, axis2)
    t2 = fun(x + step, axis2 + t1 * step)
    axis2 = axis2 + 0.5 * (t1 + t2) * step
    axis1 = axis1 + step
    X.append(axis1)
    Y.append(axis2)
上一篇:iterm2 + zsh快捷键


下一篇:SpringBoot2 整合 AXIS2 服务端和客户端