www.delorie.com/gnu/docs/mcsim/mcsim_30.html | search |
Buy GNU books! | |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Integrate()
specification The integrator settings can be changed with the Integrate specification. Two integration routines are provided: Lsodes (which originates from the SLAC Fortran library and is originally based on Gear's routine) (Gear, 1971b; Gear, 1971a; Press et al., 1989) (see section Bibliographic References) and Euler (Press et al., 1989).
The syntax for Lsodes
is:
Integrate(Lsodes, <rtol>, <atol>, <method>); |
Rtol is a scalar specifying the relative error tolerance for each integration step. Atol is a scalar specifying the absolute error tolerance parameter. They apply to all integration variables (state variables). The estimated local error in a state variable y(i) will be controlled so as to be roughly less (in magnitude) than rtol*|y(i)| + atol. Thus the local error test passes if, in each component, either the absolute error is less than atol, or the relative error is less than rtol. Set rtol toÊzero for pure absolute error control, and use atol to zero for pure relative error control. Caution: actual (global) errors may exceed these local tolerances, so choose them conservatively. The method flag should be 0 (zero) for non-stiff differential systems and 1 for stiff systems. You should try both and select the fastest for equal accuracy of output, unless insight from your system leads you to choose a priori. In our experience, a good starting point for atol and rtol is about 1e-6.
The syntax for Euler
is:
Integrate(Euler, <time-step>, 0, 0); |
time-step is a scalar specifying the constant time-step to be taken at each integration step. The next two scalars are reserved for future use and should be set to zero.
If the Integrate()
specification is not used, the default integration
method is Lsodes
with parameters
1e-5, 1e-7 and 1.
We recommend using Lsodes
, since is it highly accurate and
efficient. Euler
can be used for special applications (e.g., in
system dynamics) where a constant time step and a simple algorithm are
needed.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
webmaster | delorie software privacy |
Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |