I am starting to use python, currently using scipy odeintto compute a related ODE system, however, when I start, the python shell always tells me that
>>>
Excess work done on this call (perhaps wrong Dfun type).
Run with full_output = 1 to get quantitative information.
>>>
So, I have to change my time step and the last time to make it integrable. To do this, I need to try different combinations, which is pretty painful. Can someone tell me how can I ask to odeintautomatically change the time interval and the final time for the successful integration of this ode system?
and here is the part of the code that called odeint:
def main(t, init_pop_a, init_pop_b, *args, **kwargs):
"""
solve the obe for a given set of parameters
"""
rho_init = zeros((16,16))*1j
rho_init[1,1] = init_pop_a
rho_init[2,2] = init_pop_b
rho_init[0,0] = 1 - (init_pop_a + init_pop_b)
rho_init_ravel, params = to_1d(rho_init)
result = odeint(wrapped_bloch3, rho_init_ravel, t, args=args)
return from_1d(result, params, prepend=(len(t),))
things = [2*pi, 20*pi, 0,0, 0,0, 0.1,100]
Omega_a, Omega_b, Delta_a, Delta_b, \
init_pop_a, init_pop_b, tstep, tfinal = things
args = ( Delta_a, Delta_b, Omega_a, Omega_b )
t = arange(0, tfinal + tstep, tstep)
data = main(t, init_pop_a, init_pop_b, *args)
plt.plot(t,abs(data[:,4,4]))
where wrapped_bloch3 is a calculation of the dy / dt function.