Solutions to desolve_odeint seem large

asked 2023-06-23 04:35:56 +0200

Jack Zuffante gravatar image

updated 2023-06-23 09:38:53 +0200

Emmanuel Charpentier gravatar image

I'm trying to figure out what, if anything, is going wrong with this code here. It says in the SageMath documentation that for desolve_odeint, the order of dvars must be the same as that of des. In my case, that means dp/dt=dp, dth/dt=dth, d(dp)/t=g, and d(dth)/t=h. But it's spitting out values that are much larger than what I would expect for t-values between 0 and 10.

edit retag flag offensive close merge delete


Edited for legibility. Indent your code fragmants by four spaces (or use the 101010 button)...

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2023-06-23 09:39:52 +0200 )edit

Replace srange(0,10) by srange(0,10,0.01)

achrzesz gravatar imageachrzesz ( 2023-06-23 17:30:30 +0200 )edit

Thank you, this works. I guess it was mistaking 10 for the step size or something.

Jack Zuffante gravatar imageJack Zuffante ( 2023-06-23 23:40:53 +0200 )edit