twoModes_1.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:nonlinear-dynamics-chaos 作者: nikos-h 项目源码 文件源码
def velocity(stateVec, t):      
    """
    velocity in the full state space.

    stateVec: state vector [x1, y1, x2, y2]
    t: just for convention of odeint, not used.
    return: velocity at stateVec. Dimension [1 x 4]
    """
    x1 = stateVec[0]
    y1 = stateVec[1]
    x2 = stateVec[2]
    y2 = stateVec[3]

    r2 = x1**2 + y1**2

    velo = np.array([(G_mu1-r2) * x1 + G_c1 * (x1*x2 + y1*y2),
             (G_mu1-r2) * y1 + G_c1 * (x1*y2 - x2*y1),
             x2 + y2 + x1**2 - y1**2 + G_a2 * x2 * r2,
             -x2 + y2 + 2.0 * x1 * y1 + G_a2 * y2 * r2])

    return velo
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号