You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using numblsoda to solve couples of first order differential equations. I need to solve those equations backward in time for some particular situations. I could not figure out how I can do that. I tried to use decreasing time step but it does not work as it works for solve_ivp and odeint.
for instance in this code how can I go backward in time?
fromnumbalsodaimportlsoda_sig, lsoda, dop853fromnumbaimportnjit, cfuncimportnumpyasnp@cfunc(lsoda_sig)defrhs(t, u, du, p):
du[0] =u[0]-u[0]*u[1]
du[1] =u[0]*u[1]-u[1]*p[0]
funcptr=rhs.address# address to ODE functionu0=np.array([5.,0.8]) # Initial conditionsdata=np.array([1.0]) # data you want to pass to rhs (data == p in the rhs).t_eval=np.arrange(0.0,50.0,0.1) # times to evaluate solutionusol, success=lsoda(funcptr, u0, t_eval, data=data)
I tried t_eval = np.arrange(50, 0, -0.1) but it does not work. It would be great if someone could help me to fix this issue.
The text was updated successfully, but these errors were encountered:
This is a current drawback of the code. It does not permit backwards integration right now, but it is very fixable. I will leave the issue up, and fix it when I have time
Hi
I am using numblsoda to solve couples of first order differential equations. I need to solve those equations backward in time for some particular situations. I could not figure out how I can do that. I tried to use decreasing time step but it does not work as it works for solve_ivp and odeint.
for instance in this code how can I go backward in time?
I tried
t_eval = np.arrange(50, 0, -0.1)
but it does not work. It would be great if someone could help me to fix this issue.The text was updated successfully, but these errors were encountered: