YANE-Framework 1.1.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes

yane::OdeSolve::Radau5913Config Class Reference

Class to configure the Radau5913 solver. More...

Inheritance diagram for yane::OdeSolve::Radau5913Config:
[legend]
Collaboration diagram for yane::OdeSolve::Radau5913Config:
[legend]

List of all members.

Public Member Functions

virtual OdeConfigclone ()
 Function to clone the current yane::OdeSolve::OdeConfig object.
yane::Utils::UuidconfigID ()
 Function to obtain the ID of the current configuration.
void copyTo (OdeConfig *target)
 Function to copy default data to a supplied configuration object.
void getHessenbergTransformation (int &enable)
 Function to obtain the decision variable on transforming the Jacobina into Hessenberg form.
void getInitialStepsize (double &hinit)
 Function to obtain the initial step size of the used solution method for differential equations.
void getJacobiRecomputation (double &step)
 Function to obtain the value of how often the Jacobian is recomputed.
void getMaxNewtonSteps (int &steps)
 Function to obtain the maximal number of newton steps.
void getMaxSteps (int &steps)
 Function to obtain the current maximal number of steps allowed for the step size control methods.
void getMaxStepsize (double &stepsize)
 Function to obtain the maximal step size length.
void getOrderSelectionParameters (double &inc_factor, double &dec_factor, double &hfac1, double &hfac2)
 Function to obtain the parameters for the defintion of the order of consistency to be used for the integration method.
void getSafetyFactor (double &safetyfactor)
 Function to obtain the safety factor used within the step size control method.
void getStages (int &minstage, int &maxstage, int &firststage)
 Function to obtain the bounds for the stages.
void getStepsizeFixingParameters (double &fac1, double &fac2)
 Function to set the bounds on accepting an integration step.
void getStepsizeSelectionParameters (double &fac1, double &fac2)
 Function to obtain the bounds for the allowed change in the step size.
void getStepsizeStrategy (T_STEPSIZESTRATEGY &strategy)
 Function to obtain the strategy of step size computation.
void getTolerance (double &rtol, double &atol)
 Function to obtain the error tolerances.
void getToleranceVector (double *&rtol, double *&atol)
 Function to obtain the vectors of currently used error tolerances.
 Radau5913Config ()
 Constructor.
void setHessenbergTransformation (int enable=0)
 Function to set the decision variable on transforming the Jacobina into Hessenberg form.
void setInitialStepsize (double hinit=0.0)
 Function to set the initial step size.
void setJacobiRecomputation (double step=0.001)
 Function to define how often the Jacobian is recomputed.
void setMaxNewtonSteps (int steps=7)
 Function to set the maximal number of newton steps.
void setMaxSteps (int steps=10000000)
 Function to set the maximal numer of allowed.
void setMaxStepsize (double stepsize=0.0)
 Function to set the maximal step size length.
void setOrderSelectionParameters (double inc_factor=0.002, double dec_factor=0.8, double hfac1=0.8, double hfac2=1.2)
 Function to set the parameters for the defintion of the order of consistency to be used for the integration method.
void setSafetyFactor (double safetyfactor=0.9)
 Function to set the safety factor used within the step size control method.
void setStages (int minstage=3, int maxstage=7, int firststage=3)
 Function to set the bounds for the stages.
void setStepsizeFixingParameters (double fac1=1.0, double fac2=1.2)
 Function to set the bounds on accepting an integration step.
void setStepsizeSelectionParameters (double fac1=0.2, double fac2=10.0)
 Function to set the bounds for the allowed change in the step size

\[ \mbox{fac}_1 \leq \frac{h_{new}}{h_{old}} \leq \mbox{fac}_2 \]

.

void setStepsizeStrategy (T_STEPSIZESTRATEGY strategy=Gustaffson)
 Function to set the strategy of step size computation.
void setTolerance (double rtol=1E-6, double atol=1E-6)
 Function to set scalar error tolerances for the adaptive step size control algorithms.
void setToleranceVector (double *rtol=0, double *atol=0)
 Function to set the vectors of error tolerances for the adaptive step size control algorithms.
virtual ~Radau5913Config ()
 Destructor.

Static Public Member Functions

static void assertValidConfigObject (OdeConfig *config)
 Function to check whether a supplied configuration object is of type yane::OdeSolve::RadauConfig.

Protected Member Functions

virtual void copyToNoInvalidation (OdeConfig *target)
 Function to copy all internal configuration data to the supplied configuration object.
void invalidateOldConfig ()
 Function to change the ID of the configuration object.

Static Protected Member Functions

static bool isValidStage (int stage)
 Function to check whether the stage number is valid.

Protected Attributes

double _atol
 Absolute Tolerance.
double * _atol_vec
 Vector of absolute Tolerances.
int _enable_hessenberg
 Decision variable if Jacobian shall be transformed into Hessenberg form

  • 1: Transformation
  • 0: No transformation (default)

double _initial_stepsize
 Initial step size.
double _jac_step
 Step size after which a new Jacobian is to be computed.
int _max_steps
 Maximal number of steps of the iterative method.
double _max_stepsize
 Maximal step size.
int _newton_steps
 Maximal number of Newton steps.
double _os_dec
 The order is decrease if the contraction is larger than this factor.
double _os_fac1
 The order is only decreased if $ hfac1 \leq \frac{h_{new}}{h_{old}} \leq hfac2 $ holds.
double _os_fac2
 The order is only decreased if $ hfac1 \leq \frac{h_{new}}{h_{old}} \leq hfac2 $ holds.
double _os_inc
 The order is increase if the contraction is smaller than this factor.
double _rtol
 Relative tolerance.
double * _rtol_vec
 Vector of relative Tolerances.
int _s_first
 Stages for the initial step.
int _s_max
 Upper bound for the stages.
int _s_min
 Lower bound for the stages.
double _safety_factor
 Safty factor.
yane::Utils::Uuid_setting_uuid
 ID of the yane::OdeSolve::OdeConfig object.
double _sf_fac1
 Lower bound for step size acceptance.
double _sf_fac2
 Upper bound for step size acceptance.
double _ss_fac1
 Lower bound for the change of the step size.
double _ss_fac2
 Upper bound for the change of the step size.
T_STEPSIZESTRATEGY _strat
 Strategy of the step size control algorithm.

Detailed Description

This class includes all configuration methods for the Radau5913 solver.
Atter construction of an object of this class it is initialized with default values which usually give good results. Still, the parameters of the class should be adapted to the considered yane::Model::Model object.


Member Function Documentation

LIB_EXPORT void yane::OdeSolve::Radau5913Config::assertValidConfigObject ( OdeConfig config) [static]

This function overloads the standard method. It checks whether the supplied yane::OdeSolve::OdeConfig object possesses the ID of a yane::OdeSolve::Radau5913Config class and is therefore valid.

Parameters:
configConfiguration object to be checked

Reimplemented from yane::OdeSolve::RadauConfig.

LIB_EXPORT yane::OdeSolve::OdeConfig * yane::OdeSolve::Radau5913Config::clone ( ) [virtual]

This function can be used to clone the current yane::OdeSolve::OdeConfig object.

Returns:
Cloned yane::OdeSolve::OdeConfig object

Reimplemented from yane::OdeSolve::RadauConfig.

LIB_EXPORT yane::Utils::Uuid * yane::OdeSolve::OdeConfig::configID ( ) [inherited]

This function can be used to obtain the ID of the current configuration. If one data values has been changed, then the ID is modified. Using this ID the solver can automatically recognize that it has to update itself using the new values.

Returns:
ID of the current configuration
LIB_EXPORT void yane::OdeSolve::OdeConfig::copyTo ( OdeConfig target) [inherited]

This function can be used to copy current data of the object to a (different) supplied configuration object. It automatically resets the ID of the supplied object.

Parameters:
targetConfiguration object which shall be configured
LIB_EXPORT void yane::OdeSolve::Radau5913Config::copyToNoInvalidation ( OdeConfig target) [protected, virtual]

This function copies all internal configuration data to the supplied configuration object.

Parameters:
targetConfiguration object to hold data of calling yane::OdeSolve::OdeConfig object

Reimplemented from yane::OdeSolve::RadauConfig.

LIB_EXPORT void yane::OdeSolve::RadauConfig::getHessenbergTransformation ( int &  enable) [inherited]

This function can be used to obtain the decision variable on whether the Jacobian shall be transformed into Hessenberg form. This can be advantageous for large systems.

Parameters:
enableDecision variable if Jacobian shall be transformed into Hessenberg form

  • 1: Transformation
  • 0: No transformation (default)
See also:
getHessenbergTransformation
setHessenbergTransformation
LIB_EXPORT void yane::OdeSolve::OdeConfig::getInitialStepsize ( double &  hinit) [inherited]

This function can be used to obtain the initial step size of the used solution method for differential equations.

Parameters:
hinitInitial step size
See also:
setInitialStepsize
LIB_EXPORT void yane::OdeSolve::RadauConfig::getJacobiRecomputation ( double &  step) [inherited]

This function can be used to obtain the value of how often the Jacobian is recomputed. For large systems where the Jacobian is computationally expensive, 0.1 has shown to be reasonable. Negative values will cause a recomputation in every step of the step size control method.

Parameters:
stepStep size of the recomputation of the Jacobian
See also:
setJacobiRecomputation
LIB_EXPORT void yane::OdeSolve::RadauConfig::getMaxNewtonSteps ( int &  steps) [inherited]

This function can be used to obtain the maximal number of newton steps per step of the differential equation solver

Parameters:
stepsMaximal number of newton steps
See also:
setMaxNewtonSteps
LIB_EXPORT void yane::OdeSolve::OdeConfig::getMaxSteps ( int &  steps) [inherited]

This function can be used to obtain the current maximal number of steps allowed for the step size control methods.

Parameters:
stepsMaximal number of computation steps of the differential equation solver
See also:
setMaxSteps
LIB_EXPORT void yane::OdeSolve::OdeConfig::getMaxStepsize ( double &  stepsize) [inherited]

This function can be used to obtain the maximal set size length.

Parameters:
stepsizeMaximal step size length
See also:
setMaxStepsize
LIB_EXPORT void yane::OdeSolve::Radau5913Config::getOrderSelectionParameters ( double &  inc_factor,
double &  dec_factor,
double &  hfac1,
double &  hfac2 
)

This function can be used to obtain the parameters for the definition of the order of consistency to be used for the integration method

Parameters:
inc_factorThe order is increase if the contraction is smaller than this factor
dec_factorThe order is decrease if the contraction is larger than this factor
hfac1The order is only decreased if $ hfac1 \leq \frac{h_{new}}{h_{old}} \leq hfac2 $ holds
hfac2see hfac1
See also:
setOrderSelectionParameters
LIB_EXPORT void yane::OdeSolve::OdeConfig::getSafetyFactor ( double &  safetyfactor) [inherited]

This function can be used to obtain the safety factor used within the step size control method.

Parameters:
safetyfactorSafety factor
See also:
setSafetyFactor
LIB_EXPORT void yane::OdeSolve::Radau5913Config::getStages ( int &  minstage,
int &  maxstage,
int &  firststage 
)

This function can be used to obtain the bounds for the stages (valid stage values are 1, 3, 5 und 7).

Parameters:
minstageLower bound for the stages
maxstageUpper bound for the stages
firststageStages for the first step
See also:
setStages
LIB_EXPORT void yane::OdeSolve::RadauConfig::getStepsizeFixingParameters ( double &  fac1,
double &  fac2 
) [inherited]

This function can be used to obtain the factors for accepting an integration step which is given by the condition

\[ \mbox{fac}_1 /leq /frac{h_{new}}{h_{old}} \le \mbox{fac}_2 \]

Parameters:
fac1Lower bound for the acceptance of an integration step
fac2Upper bound for the acceptance of an integration step
See also:
setStepsizeFixingParameters
LIB_EXPORT void yane::OdeSolve::OdeConfig::getStepsizeSelectionParameters ( double &  fac1,
double &  fac2 
) [inherited]

This function can be used to obtain the bounds for the allowed change in the step size.

Parameters:
fac1Lower bound
fac2Upper bound
See also:
setStepsizeSelectionParameters
LIB_EXPORT void yane::OdeSolve::RadauConfig::getStepsizeStrategy ( T_STEPSIZESTRATEGY strategy) [inherited]

This function can be used to obtain the strategy of step size computation

See also:
STEPSIZESTRATEGY
setStepsizeStrategy
Parameters:
strategyStrategy of step size computation
LIB_EXPORT void yane::OdeSolve::OdeConfig::getTolerance ( double &  rtol,
double &  atol 
) [inherited]

This function can be used to obtain the currently used error tolerances

Parameters:
rtolRelative tolerance
atolAbsolute tolerance
See also:
setTolerance
LIB_EXPORT void yane::OdeSolve::OdeConfig::getToleranceVector ( double *&  rtol,
double *&  atol 
) [inherited]

This function can be used to obtain the vectors of currently used error tolerances

Parameters:
rtolPointer of the relative error tolerance vector
atolPointer of the absolute error tolerance vector
See also:
setToleranceVector
LIB_EXPORT void yane::OdeSolve::OdeConfig::invalidateOldConfig ( ) [protected, inherited]

This function changes the ID of the configuration object. Hence, all solvers which use this configuration object will notice that they need to be reconfigured using the new configuration data. Each derived class must call this method if any of its set-methods is called.

LIB_EXPORT bool yane::OdeSolve::Radau5913Config::isValidStage ( int  stage) [static, protected]

This function checks whether the stage number is valid

Parameters:
stageStage number
Returns:
true if valid, else false
See also:
setStages
LIB_EXPORT void yane::OdeSolve::RadauConfig::setHessenbergTransformation ( int  enable = 0) [inherited]

This function sets the decision variable on whether the Jacobian shall be transformed into Hessenberg form. This can be advantageous for large systems.

Parameters:
enableDecision variable if Jacobian shall be transformed into Hessenberg form

  • 1: Transformation
  • 0: No transformation (default)
See also:
getHessenbergTransformation
LIB_EXPORT void yane::OdeSolve::OdeConfig::setInitialStepsize ( double  hinit = 0.0) [inherited]

This function sets the initial step size which is used upon start of the used solution method for differential equations. If the value is set to zero then a guess for the initial step size is computed numerically.

Parameters:
hinitInitial step size
Exceptions:
WrongSolverInputExceptionIs thrown if unapplicable data values are supplied
See also:
getInitialStepsize
LIB_EXPORT void yane::OdeSolve::RadauConfig::setJacobiRecomputation ( double  step = 0.001) [inherited]

This function defines how often the Jacobian is recomputed. For large systems where the Jacobian is computationally expensive, 0.1 has shown to be reasonable. Negative values will cause a recomputation in every step of the step size control method.

Parameters:
stepStep size of the recomputation of the Jacobian
See also:
getJacobiRecomputation
LIB_EXPORT void yane::OdeSolve::RadauConfig::setMaxNewtonSteps ( int  steps = 7) [inherited]

This function sets the maximal number of newton steps per step of the differential equation solver

Parameters:
stepsMaximal number of newton steps
Exceptions:
WrongSolverInputExceptionIs thrown if an invalid number of steps is provided
See also:
getMaxNewtonSteps
LIB_EXPORT void yane::OdeSolve::OdeConfig::setMaxSteps ( int  steps = 10000000) [inherited]

This function sets the maximal number of allowed integration steps of the differential equation solver. If a computation requires more iteration steps then the method yane::OdeSolve::OdeSolve::calc is terminated with exception yane::OdeSolve::TooManyStepsException.

Parameters:
stepsMaximal number of computation steps of the differential equation solver
Exceptions:
WrongSolverInputExceptionIs thrown if unapplicable data values are supplied
See also:
getMaxSteps
LIB_EXPORT void yane::OdeSolve::OdeConfig::setMaxStepsize ( double  stepsize = 0.0) [inherited]

This function sets the maximal step size length. If zero is supplied to this method, then the maximal step size is set to the length of the integration interval.

Parameters:
stepsizeMaximal step size length
Exceptions:
WrongSolverInputExceptionIs thrown if unapplicable data values are supplied
See also:
getMaxStepsize
LIB_EXPORT void yane::OdeSolve::Radau5913Config::setOrderSelectionParameters ( double  inc_factor = 0.002,
double  dec_factor = 0.8,
double  hfac1 = 0.8,
double  hfac2 = 1.2 
)

This function sets the parameters for the definition of the order of consistency to be used for the integration method

Parameters:
inc_factorThe order is increase if the contraction is smaller than this factor
dec_factorThe order is decrease if the contraction is larger than this factor
hfac1The order is only decreased if $ hfac1 \leq \frac{h_{new}}{h_{old}} \leq hfac2 $ holds
hfac2see hfac1
Exceptions:
WrongSolverInputExceptionIs thrown if $ hfac1 > hfac2 $
See also:
getOrderSelectionParameters
LIB_EXPORT void yane::OdeSolve::OdeConfig::setSafetyFactor ( double  safetyfactor = 0.9) [inherited]

This function sets the safety factor used within the step size control method.

Parameters:
safetyfactorSafety factor
See also:
getSafetyFactor
Exceptions:
WrongSolverInputExceptionIs thrown if unapplicable data values are supplied
LIB_EXPORT void yane::OdeSolve::Radau5913Config::setStages ( int  minstage = 3,
int  maxstage = 7,
int  firststage = 3 
)

This function sets the bounds for the stages (valid stage values are 1, 3, 5 und 7).
The order of consistency is fixed by the choice of the stage which is done computed by the method. The order of the method is then given by

\[ 2 \cdot \mbox{Stage} - 1 \]

Parameters:
minstageLower bound for the stages
maxstageUpper bound for the stages
firststageStages for the first step
Exceptions:
WrongSolverInputExceptionIs thrown if no valid values are supplied
See also:
getStages
LIB_EXPORT void yane::OdeSolve::RadauConfig::setStepsizeFixingParameters ( double  fac1 = 1.0,
double  fac2 = 1.2 
) [inherited]

This function sets the factors for accepting an integration step which is given by the condition

\[ \mbox{fac}_1 /leq /frac{h_{new}}{h_{old}} \le \mbox{fac}_2 \]

For large systems the parameters 0.99 and 2.0 appear to be reasonable.

Parameters:
fac1Lower bound for the acceptance of an integration step
fac2Upper bound for the acceptance of an integration step
See also:
getStepsizeFixingParameters
Exceptions:
WrongSolverInputExceptionIs thrown if $ fac2 < fac1 $
LIB_EXPORT void yane::OdeSolve::OdeConfig::setStepsizeSelectionParameters ( double  fac1 = 0.2,
double  fac2 = 10.0 
) [inherited]

This function sets the bounds for the allowed change in the step size. Within the algorithms the condition

\[ \mbox{fac}_1 \leq \frac{h_{new}}{h_{old}} \leq \mbox{fac}_2 \]

is checked and the new step size is set accordingly.

Parameters:
fac1Lower bound
fac2Upper bound
Exceptions:
WrongSolverInputExceptionIs thrown if unapplicable data values are supplied
See also:
getStepsizeSelectionParameters
LIB_EXPORT void yane::OdeSolve::RadauConfig::setStepsizeStrategy ( T_STEPSIZESTRATEGY  strategy = Gustaffson) [inherited]

This function sets the strategy of step size computation

See also:
STEPSIZESTRATEGY
getStepsizeStrategy
Parameters:
strategyStrategy of step size computation
Exceptions:
WrongSolverInputExceptionIs thrown if an invalid strategy is to be used
LIB_EXPORT void yane::OdeSolve::OdeConfig::setTolerance ( double  rtol = 1E-6,
double  atol = 1E-6 
) [inherited]

This function sets scalar error tolerances for the adaptive step size control algorithms.

Parameters:
rtolRelative tolerance
atolAbsolute tolerance
See also:
getTolerance
Exceptions:
WrongSolverInputExceptionIs thrown if unapplicable data values are supplied
LIB_EXPORT void yane::OdeSolve::OdeConfig::setToleranceVector ( double *  rtol = 0,
double *  atol = 0 
) [inherited]

This function sets vectors of error tolerances for the adaptive step size control algorithms. Here, the dimension of the vectors of error tolerances are required to be identical to the dimension of the state variable.
If a null pointer is supplied to this routine, then the usage of error tolerance vectors is switched to scalar error tolerances base on the internally stored values.

Parameters:
rtolPointer of the relative error tolerances
atolPointer of the absolute error tolerances
Exceptions:
WrongSolverInputExceptionIs thrown if unapplicable data values are supplied
See also:
getToleranceVector