YANE-Framework 1.1.0
Public Member Functions

yane::MPC::OdeManager Class Reference

Implementation of a parenting manager class for solving control systems and computing their derivatives.

Inheritance diagram for yane::MPC::OdeManager:
[legend]

List of all members.

Public Member Functions

virtual void calcObjectiveFunction (double *t, double *x, double *u, double *fx)=0
 Function to evaluate the objective function using the supplied differential equation manager.
virtual void calcObjectiveFunctionGrad (double *t, double *x, double *u, double *fx)=0
 Function to evaluate the gradient of the objective function using the supplied differential equation manager.
virtual void calcRestrFunction (double *t, double *x, double *u, double *fx)=0
 Function to evaluate the restrictions using the supplied differential equation manager.
virtual void calcRestrFunctionGrad (double *t, double *x, double *u, double *fx, yane::MinProg::T_MEMMODEL memmodel, int *needc=0)=0
 Function to evaluate the Jacobian of the restrictions using the supplied differential equation manager.
virtual OdeManagerclone ()=0
 Function to generate a clone of the current OdeManager object.
virtual void * configuration ()=0
 Function to return an internal pointer of the configuration of the discretized object.
virtual void getObjFunValues (double *t, double *x, double *u, double *fx, double *trajectory)=0
 Function to compute the state and objective function values for each point of the current time grid.
virtual void setAuxilliaryObjects (void *discretization, void *configuration=0)=0
 Function to set required auxilliary objects.
virtual void setFunctions (int horizont, int total_restr, yane::Model::Model *model, T_DISCRRESTRFUNC restrfunc, int sdatalength=0, T_SHOOTINGDATA *sdata=0)=0
 Function to supply required data for defining and evaluating the restrictions.
virtual ~OdeManager ()
 Destructor.

Member Function Documentation

virtual void yane::MPC::OdeManager::calcObjectiveFunction ( double *  t,
double *  x,
double *  u,
double *  fx 
) [pure virtual]

Function to evaluate the objective function using the supplied differential equation manager. This function has to be defined in every derived class.

Parameters:
tCurrent time grid
xInitial state vector
uControl vector
fxValue of the objective function
Exceptions:
yane::OdeSolve::OdeSolExis thrown if the ode solver returns with an error message

Implemented in yane::MPC::CacheOdeManager, yane::MPC::MultiThreadCacheOdeManager, yane::MPC::SimpleOdeManager, and yane::MPC::SyncOdeManager.

virtual void yane::MPC::OdeManager::calcObjectiveFunctionGrad ( double *  t,
double *  x,
double *  u,
double *  fx 
) [pure virtual]

Function to evaluate the gradient of the objective function using the supplied differential equation manager. This function has to be defined in every derived class.

Parameters:
tCurrent time grid
xInitial state vector
uControl vector
fxGradient of the objective function
Exceptions:
yane::OdeSolve::OdeSolExis thrown if the ode solver returns with an error message

Implemented in yane::MPC::CacheOdeManager, yane::MPC::MultiThreadCacheOdeManager, yane::MPC::SimpleOdeManager, and yane::MPC::SyncOdeManager.

virtual void yane::MPC::OdeManager::calcRestrFunction ( double *  t,
double *  x,
double *  u,
double *  fx 
) [pure virtual]

Function to evaluate the restrictions using the supplied differential equation manager. This function has to be defined in every derived class.

Parameters:
tCurrent time grid
xInitial state vector
uControl vector
fxVector of restriction values
Exceptions:
yane::OdeSolve::OdeSolExis thrown if the ode solver returns with an error message

Implemented in yane::MPC::CacheOdeManager, yane::MPC::MultiThreadCacheOdeManager, yane::MPC::SimpleOdeManager, and yane::MPC::SyncOdeManager.

virtual void yane::MPC::OdeManager::calcRestrFunctionGrad ( double *  t,
double *  x,
double *  u,
double *  fx,
yane::MinProg::T_MEMMODEL  memmodel,
int *  needc = 0 
) [pure virtual]

Function to evaluate the Jacobian of the restrictions using the supplied differential equation manager. This function has to be defined in every derived class.

Parameters:
tCurrent time grid
xInitial state vector
uControl vector
fxJacobian of the restrictions
memmodelMemory model
needcVariable containing a list of the derivatives which need to be updated
Exceptions:
yane::OdeSolve::OdeSolExis thrown if the ode solver returns with an error message

Implemented in yane::MPC::CacheOdeManager, yane::MPC::MultiThreadCacheOdeManager, yane::MPC::SimpleOdeManager, and yane::MPC::SyncOdeManager.

virtual OdeManager* yane::MPC::OdeManager::clone ( ) [pure virtual]

Function to generate a clone of the current OdeManager object. The object itself is not initialized yet and has to be destructed manually.

Returns:
Pointer of the cloned class OdeManager objects

Implemented in yane::MPC::CacheOdeManager, yane::MPC::MultiThreadCacheOdeManager, yane::MPC::SimpleOdeManager, and yane::MPC::SyncOdeManager.

virtual void* yane::MPC::OdeManager::configuration ( ) [pure virtual]

Function to return an internal pointer of the configuration of the discretized object

Returns:
Pointer of the configuration of the discretized object

Implemented in yane::MPC::CacheOdeManager, yane::MPC::MultiThreadCacheOdeManager, yane::MPC::SimpleOdeManager, and yane::MPC::SyncOdeManager.

virtual void yane::MPC::OdeManager::getObjFunValues ( double *  t,
double *  x,
double *  u,
double *  fx,
double *  trajectory 
) [pure virtual]

Function to compute the state and objective function values for each point of the current time grid.

Parameters:
tCurrent time grid
xInitial state vector
uControl vector
fxObjective function values for the current time grid
trajectoryState vectors for the current time grid
Exceptions:
yane::OdeSolve::OdeSolExis thrown if the ode solver returns with an error message

Implemented in yane::MPC::CacheOdeManager, yane::MPC::MultiThreadCacheOdeManager, yane::MPC::SimpleOdeManager, and yane::MPC::SyncOdeManager.

virtual void yane::MPC::OdeManager::setAuxilliaryObjects ( void *  discretization,
void *  configuration = 0 
) [pure virtual]

Function to set required auxilliary objects

Parameters:
discretizationClass Discretization objects
configurationClass MPCConfig object

Implemented in yane::MPC::CacheOdeManager, yane::MPC::MultiThreadCacheOdeManager, yane::MPC::SimpleOdeManager, and yane::MPC::SyncOdeManager.

virtual void yane::MPC::OdeManager::setFunctions ( int  horizont,
int  total_restr,
yane::Model::Model model,
T_DISCRRESTRFUNC  restrfunc,
int  sdatalength = 0,
T_SHOOTINGDATA sdata = 0 
) [pure virtual]

Function to supply required data for defining and evaluating the restrictions

Parameters:
horizontLength of the horizon
total_restrNumber of restrictions
modelPointer of the model
restrfuncPointer of the restriction function
sdatalengthNumber of shooting nodes
sdataStructure of the shooting nodes
Exceptions:
yane::Utils::MemoryExceptionis thrown if internal memory allocation failed
yane::OdeSolve::OdeSolExis thrown if the reset of the ode solver failed

Implemented in yane::MPC::CacheOdeManager, yane::MPC::MultiThreadCacheOdeManager, yane::MPC::SimpleOdeManager, and yane::MPC::SyncOdeManager.