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
评论列表
文章目录