[SciPy-user] RE : Re: odeint memoryError

Robert VERGNES robert.vergnes@yahoo...
Tue Jul 31 01:31:59 CDT 2007


Dear Rob,

It is related with step size and accuracy. Is there some way I could know if ODEINT will crash or not ? - hence I would adapt the length of my t_vector...


an example of crashing odeint is below:

from scipy import *
from numpy import *
from scipy.integrate import *

# Equation Parameters
t_step= 1E-12
t_start=1.0172
t_end = 1.01726095276
t_interim = t_range = arange(t_start, t_end,t_step)
print 'Length of t_range: ' + str(len(t_range))
print 'Length should be around: '+ str(((t_end-t_start)/t_step))
w0 =sqrt (10)
fo = 0.075
y0_interim = [-2.20182185029, 0.0120342071085] #[Theta_dot, Theta]

def func_f3(y,t):
    """  Jacobian function """
    return [ - fo*y[0]- w0**2*sin(y[1]), y[0]]

if __name__ == '__main__':
    # ODE calculation
    y, infodict = odeint(func_f3,y0_interim,t_interim, full_output =1)
    print y
    print infodict



Rob Clewley <rhc28@cornell.edu> a écrit : Robert,

You need to post more information about your system of ODEs as there
are many reasons (some even mathematical) why you might be running out
of memory. You may need to adjust some algorithmic parameters such as
step size or accuracy tolerances.

-Rob

On 30/07/07, Robert VERGNES  wrote:
> Hello,
>
> when I have a time vector too thin or long (...), then odeint crash and
> returns a "MemoryError".
>
> Apart from splitting my calculation in parts is there some ways around ? ie
> like a wrapper dealing with this exception?
>
>
> Best Regards
>
> Robert
>
>
>  ________________________________
>  Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo!
> Mail
>
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>
>
_______________________________________________
SciPy-user mailing list
SciPy-user@scipy.org
http://projects.scipy.org/mailman/listinfo/scipy-user


       
---------------------------------
 Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20070731/be4ef717/attachment.html 


More information about the SciPy-user mailing list