HQP  1.9.6
Omu_IntOdeTs Class Reference

Solving autonomous ordinary differential equations using Taylor series expansion. More...

#include <Omu_IntOdeTs.h>

Inheritance diagram for Omu_IntOdeTs:
[legend]

Public Member Functions

 Omu_IntOdeTs (int)
 constructor
 
 Omu_IntOdeTs ()
 constructor
 
 ~Omu_IntOdeTs ()
 destructor
 
Implementation of predefined methods.
const char * name ()
 Name of a specific integrator. More...
 
void init_stage (int k, const Omu_VariableVec &x, const Omu_VariableVec &u, const Omu_DependentVec &Ft, bool sa)
 Initialize solution of differential equations for stage k. More...
 
void solve (int kk, double tstart, double tend, const Omu_VariableVec &x, const Omu_VariableVec &u, Omu_Program *sys, Omu_DependentVec &Ft, Omu_StateVec &xt)
 Solve differential equations over one sample period. More...
 
- Public Member Functions inherited from Omu_Integrator
 Omu_Integrator ()
 constructor
 
virtual ~Omu_Integrator ()
 destructor
 
virtual void setup_stages (const Omu_Program *sys)
 Setup stages for integrator. More...
 
virtual void setup_struct (int k, const Omu_VariableVec &x, const Omu_VariableVec &u, const Omu_DependentVec &Ft)
 Setup struct for one stage k. More...
 
virtual void init (int k, const Omu_StateVec &xc, const Omu_Vec &q, const Omu_DependentVec &Fc, bool sa)
 Initialize integrator, like adaptation of array dimensions and test of pre-conditions, like explicit ODE. More...
 
virtual void solve (int kk, double tstart, double tend, Omu_StateVec &xc, Omu_StateVec &dxc, Omu_Vec &q, Omu_DependentVec &Fc)
 Solve differential equations over one sample period. More...
 
virtual void residual (int kk, double t, const Omu_StateVec &xc, const Omu_StateVec &dxc, const Omu_Vec &q, Omu_DependentVec &Fc)
 Callback to evaluate residuals of continuous-time equations. More...
 
int K () const
 get number of stages for which integrator has been set up
 

Protected Attributes

int _max_deg
 maximum degree of the taylor series expansion of the ode
 
double _tau
 time scaling of the taylor series
 
- Protected Attributes inherited from Omu_Integrator
Omu_Program_sys
 Pointer to problem definition that is valid during solve.
 
int _K
 number of stages for which integrator was set up
 
int _k
 index of current stage
 
int _kk
 index of current sample period
 
int _nxt
 total number of DAE states
 
int _nd
 number of discrete-time states
 
int _nv
 number of expansion variables
 
int _na
 number of algebraic states (no time derivative)
 
int _nx
 number of states treated by optimizer (nx=nxt-nv)
 
int _nu
 number of control parameters
 
int _nq
 number of sensitivity parameters (nq=nx+nu)
 
bool _sa
 Indicate if sensitivity analysis is required together with solution of differential equations.
 
bool _serr
 Boolean to indicate if sensitivities should be considered for error tolerance (default: false).
 
int _n
 Number of continuous-time states during integration (nxt-nd: total number minus discrete-time states).
 
int _m
 Number of control parameters during integration (nd+nu: discrete-time states and actual control parameters).
 
If_List _ifList
 container for interface elements
 
double _stepsize
 Constant stepsize to be taken by integator. More...
 
double _min_stepsize
 Minimal stepsize to be taken by integator. More...
 
double _rtol
 Relative integration error tolerance (only for variable stepsize).
 
double _atol
 Absolute integration error tolerance (only for variable stepsize).
 
int _res_evals
 number of residual evaluations
 
int _sen_evals
 number of sensitivity evaluations
 
int _jac_evals
 number of Jacobian evaluations
 

Additional Inherited Members

- Protected Member Functions inherited from Omu_Integrator
virtual void init_stage (int k, const Omu_States &x, const Omu_Vector &u, bool sa=false)
 Initialize solution of differential equations for stage k. More...
 
virtual void solve (int kk, double tstart, double tend, const Omu_States &x, const Omu_Vector &u, Omu_Program *sys, VECP xt, MATP Sx=MNULL, MATP Su=MNULL)
 Solve differential equations over sample period. More...
 

Detailed Description

Solving autonomous ordinary differential equations using Taylor series expansion.

The implementation is adapted from the driver routine forodec of the adol-c automatic differentiation code.

Member Function Documentation

void Omu_IntOdeTs::init_stage ( int  k,
const Omu_VariableVec x,
const Omu_VariableVec u,
const Omu_DependentVec Ft,
bool  sa 
)
virtual

Initialize solution of differential equations for stage k.

Note: The numbers of variables and equation structure (given in F) shall be the same for all sample periods of a stage.

Parameters
kstage
xstate variables for optimization, including bounds etc.
ucontrol parameters for optimization
Ftpre-initialized data structures for resisuals and Jacobians
satrue if sensitivity analysis shall be performed

Reimplemented from Omu_Integrator.

const char* Omu_IntOdeTs::name ( )
inlinevirtual

Name of a specific integrator.

Implements Omu_Integrator.

void Omu_IntOdeTs::solve ( int  kk,
double  tstart,
double  tend,
const Omu_VariableVec x,
const Omu_VariableVec u,
Omu_Program sys,
Omu_DependentVec Ft,
Omu_StateVec xt 
)
virtual

Solve differential equations over one sample period.

The differential-algebraic equations can be evaluated by calling Omu_Program::continuous for sys. Note that the first _nd elements of xt are discrete-time states that need to be treated like control parameters u by an integrator. Furthermore, the last _nv elements of xt are expansion variables that are not seen by the optimizer and accordingly no sensitivities are required with respect to them. The default implementation of solve calls the high-level version.

Parameters
kksample period
tstartstart time for integration
tendend time for integration
xstate variables for optimization, including bounds etc.
ucontrol parameters for optimization
sysproblem definition for calling Omu_Program::continuous
Ftpre-initialized data structures for resisuals and Jacobians
xtstart values for integration at tstart, dim(xt)=_nxt; initial sensitivity matrices xt.Sx, dim(xt.Sx)=_nxt._nx, and xt.Su, dim(xt.Su)=_nxt._nu, if _sa is true
Return values
xtresult at tend; xt.Sx and xt.Su at tend if _sa is true
Exceptions
E_CONVindicate that the integrator failed to converge; may be caught during optimization step length test

Reimplemented from Omu_Integrator.


The documentation for this class was generated from the following file: