YANE-Framework 1.1.0
Public Member Functions

yane::MPC::CacheOdeManager Class Reference

Implementation of a manager class for solving the control system and its derivative optimized with respect to function evaluations.

Inheritance diagram for yane::MPC::CacheOdeManager:
[legend]
Collaboration diagram for yane::MPC::CacheOdeManager:
[legend]

List of all members.

Public Member Functions

 CacheOdeManager ()
 Constructor.
virtual void calcObjectiveFunction (double *t, double *x, double *u, double *fx)
 Function to evaluate the objective function using the supplied differential equation manager.
virtual void calcObjectiveFunctionGrad (double *t, double *x, double *u, double *fx)
 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)
 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)
 Function to evaluate the Jacobian of the restrictions using the supplied differential equation manager.
virtual OdeManagerclone ()
 Function to generate a clone of the current OdeManager object.
virtual void * configuration ()
 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 *points)
 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)
 Function to set required auxilliary objects.
virtual void setFunctions (int horizon, int total_restr, yane::Model::Model *model, T_DISCRRESTRFUNC restrfunc, int sdatalength=0, T_SHOOTINGDATA *sdata=0)
 Function to supply required data for defining and evaluating the restrictions.
 ~CacheOdeManager ()
 Destructor.

Member Function Documentation

LIB_EXPORT void yane::MPC::CacheOdeManager::calcObjectiveFunction ( double *  t,
double *  x,
double *  u,
double *  fx 
) [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

Implements yane::MPC::OdeManager.

LIB_EXPORT void yane::MPC::CacheOdeManager::calcObjectiveFunctionGrad ( double *  t,
double *  x,
double *  u,
double *  fx 
) [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

Implements yane::MPC::OdeManager.

LIB_EXPORT void yane::MPC::CacheOdeManager::calcRestrFunction ( double *  t,
double *  x,
double *  u,
double *  fx 
) [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

Implements yane::MPC::OdeManager.

LIB_EXPORT void yane::MPC::CacheOdeManager::calcRestrFunctionGrad ( double *  t,
double *  x,
double *  u,
double *  fx,
yane::MinProg::T_MEMMODEL  memmodel,
int *  needc = 0 
) [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

Implements yane::MPC::OdeManager.

LIB_EXPORT yane::MPC::OdeManager * yane::MPC::CacheOdeManager::clone ( ) [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

Implements yane::MPC::OdeManager.

LIB_EXPORT void * yane::MPC::CacheOdeManager::configuration ( ) [virtual]

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

Returns:
Pointer of the configuration of the discretized object

Implements yane::MPC::OdeManager.

LIB_EXPORT void yane::MPC::CacheOdeManager::getObjFunValues ( double *  t,
double *  x,
double *  u,
double *  fx,
double *  trajectory 
) [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

Implements yane::MPC::OdeManager.

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

Function to set required auxilliary objects

Parameters:
discretizationClass Discretization objects
configurationClass MPCConfig object

Implements yane::MPC::OdeManager.

LIB_EXPORT void yane::MPC::CacheOdeManager::setFunctions ( int  horizont,
int  total_restr,
yane::Model::Model model,
T_DISCRRESTRFUNC  restrfunc,
int  sdatalength = 0,
T_SHOOTINGDATA sdata = 0 
) [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

Implements yane::MPC::OdeManager.