[SciPy-user] odeint rtol and atol default values
Travis Oliphant
oliphant.travis at ieee.org
Tue Jun 27 18:14:39 EDT 2006
Keith Goodman wrote:
> On 6/27/06, Steve Schmerler <elcorto at gmx.net> wrote:
>
>> David M. Cooke wrote:
>>
>>
>>>>>> What are the default values for rtol and atol in
>>>>>> scipy.integrate.odeint?
>>>>>>
>>>>>>
>>> Digging through __odepack.h finds that the defaults are 1.49012e-8.
>>>
>>>
>> Thanks. Maybe doc string should mention this.
>>
>> Not that I would care to much, but this seems a rather random value at
>> the first glance. Is there a special reason for this val?
>>
>
> It looks like sqrt(eps) where eps is the machine precision.
>
> BTW, can scipy return eps?
>
>
>>> dir(numpy.finfo(float))
['__class__', '__delattr__', '__dict__', '__doc__', '__getattribute__',
'__hash__', '__init__', '__module__', '__new__', '__reduce__',
'__reduce_ex__', '__repr__', '__setattr__', '__str__', '__weakref__',
'_finfo_cache', '_init', '_str_eps', '_str_epsneg', '_str_max',
'_str_resolution', '_str_tiny', 'dtype', 'eps', 'epsneg', 'iexp',
'machar', 'machep', 'max', 'maxexp', 'min', 'minexp', 'negep', 'nexp',
'nmant', 'precision', 'resolution', 'tiny']
Thus:
numpy.finfo(float).eps
There is also
scipy.misc.limits
which contains constants as names:
dir(scipy.misc.limits)
['__all__', '__builtins__', '__doc__', '__file__', '__name__',
'double_epsilon', 'double_max', 'double_min', 'double_precision',
'double_resolution', 'double_tiny', 'finfo', 'float_', 'float_epsilon',
'float_max', 'float_min', 'float_precision', 'float_resolution',
'float_tiny', 'single', 'single_epsilon', 'single_max', 'single_min',
'single_precision', 'single_resolution', 'single_tiny']
-Travis
More information about the SciPy-User
mailing list