def velocity(stateVec, t):
"""
return the velocity field of Lorentz system.
stateVec : the state vector in the full space. [x, y, z]
t : time is used since odeint() requires it.
"""
x = stateVec[0]
y = stateVec[1]
z = stateVec[2]
# complete the flowing 3 lines.
vx = G_sigma*(y - x)
vy = G_rho*x - y - x*z
vz = x*y - G_b*z
return np.array([vx, vy, vz])
评论列表
文章目录