#include <gsl_astep.h>
This class implements both the "standard" and "scaled" step control methods from GSL. The standard control method is the default. To use the scaled controle, set standard to false
and set the scale for each component using set_scale().
The control object is a four parameter heuristic based on absolute and relative errors eps_abs and eps_rel, and scaling factors a_y and a_dydt for the system state and derivatives
respectively.
The step-size adjustment procedure for this method begins by computing the desired error level for each component. In the unscaled version,
while in the scaled version the user specifies the scale for each component, ,
The desired error level is compared to then observed error
. If the observed error
exceeds the desired error level
by more than 10 percent for any component then the method reduces the step-size by an appropriate factor,
where is the consistency order of the method (e.g.
for 4(5) embedded RK), and
is a safety factor of 0.9. The ratio
is taken to be the maximum of the ratios
.
If the observed error E is less than 50 percent of the desired error level for the maximum ratio
then the algorithm takes the opportunity to increase the step-size to bring the error in line with the desired level,
This encompasses all the standard error scaling methods. To avoid uncontrolled changes in the stepsize, the overall scaling factor is limited to the range 1/5 to 5.
Definition at line 110 of file gsl_astep.h.
Public Member Functions | |
template<class svec_t > | |
int | set_scale (size_t nscal, const svec_t &scale) |
Set the scaling for each differential equation. | |
virtual int | hadjust (size_t dim, unsigned int ord, const vec_t &y, vec_t &yerr, vec_t &yp, double *h) |
Automatically adjust step-size. | |
Data Fields | |
double | eps_abs |
Absolute precision (default ![]() | |
double | eps_rel |
Relative precision (default 0). | |
double | a_y |
Function scaling factor (default 1). | |
double | a_dydt |
Derivative scaling factor (default 0). | |
bool | standard |
Use standard or scaled algorithm (default true). | |
Protected Attributes | |
size_t | sdim |
Number of scalings. | |
double * | scale_abs |
Scalings. |
Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.
Project hosting provided by
,
O2scl Sourceforge Project Page