Control structure for astep_gsl. More...
#include <astep_gsl.h>
Public Types | |
typedef boost::numeric::ublas::vector< double > | ubvector |
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_y_t &y, vec_yerr_t &yerr, vec_dydx_t &yp, double &h) |
Public Attributes | |
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) | |
Static Public Attributes | |
Adjustment specification | |
static const size_t | hadj_nil =0 |
No adjustment required. | |
static const size_t | hadj_dec =1 |
Recommend step decrease. | |
static const size_t | hadj_inc =2 |
Recommend step increase. | |
Protected Attributes | |
ubvector | scale_abs |
Scalings. | |
This class implements both the "standard" and "scaled" step control methods from GSL. The standard control method is the default. To use the scaled control, 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.
If the user specified fewer scaling parameters than the number of ODEs, then the scaling parameters are reused as follows. If there are ODEs and
scaling parameters, then for
, the ith scaling parameter
is set to be
. If the user selects the scaled control by setting standard to
false
and no scale parameters are specified, this class reverts to the standard control.
Definition at line 130 of file astep_gsl.h.
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).