simutil.py 文件源码

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

项目:hylaa 作者: stanleybak 项目源码 文件源码
def raw_sim_one(start, steps, dy_data, settings, include_step_zero=False):
    '''
    simulate from a single point at the given times

    return an nparray of states at those times, possibly excluding time zero
    '''

    start.shape = (dy_data.num_dims,)

    times = np.linspace(0, settings.step * steps, num=steps+1)

    der_func = dy_data.make_der_func()
    jac_func, max_upper, max_lower = dy_data.make_jac_func()
    sim_tol = settings.sim_tol

    result = odeint(der_func, start, times, Dfun=jac_func, col_deriv=True, \
                    mxstep=int(1e8), mu=max_upper, ml=max_lower, \
                    atol=sim_tol, rtol=sim_tol)

    if not include_step_zero:
        result = result[1:]

    return result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号