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

yane::Model::Simulator Class Reference

This class provides methods to simulate a given model of a process defined by a class yane::Model::Model object. More...

Collaboration diagram for yane::Model::Simulator:
[legend]

List of all members.

Public Member Functions

virtual void initialize (double t, double *x, double *u)
 Function to initialize the class yane::Model::Simulator object.
virtual void predictSequence (int seqlength, double *t, double *x, double *u)
 Function to trigger the simulator to solve the dynamics of the control system under consideration on a given sampling grid and control.
virtual void run (double targettime)
 Function to start the simulator.
virtual void setControl (double *u)
 Function to set solution output function.
virtual void setSolutionOutput (OdeSolve::T_SOLOUTFUNC func)
 Function to set solution output function.
 Simulator (Model *model, yane::OdeSolve::OdeConfig *odeconf=0)
 Constructor.
virtual void trajectory (int seqlength, double *t, double *x, double *u, double *trajectory)
 Function to trigger the simulator to compute the state trajectory of the control system under consideration on a given sampling grid and control.
virtual ~Simulator ()
 Destructor.

Static Protected Member Functions

static void staticdftfunc (int *n, double *t, double *y, double *dft, double *rpar, int *ipar)
 Static function of the time derivative of the control system.
static void staticjacfunc (int *n, double *t, double *y, double *dfy, int *ldfy, double *rpar, int *ipar)
 Static function of the Jacobian of the constraints.
static void staticmassfunc (int *n, double *mas, int *lmas, double *rpar, int *ipar)
 Static function of the mass matrix of the system.
static void staticodefunc (int *n, double *t, double *y, double *dy, double *rpar, int *ipar)
 Static differential or difference equation which has been transformed from a control system to a parametrized system.

Protected Attributes

int _dimensionu
 Dimension of the control.
int _dimensionx
 Dimension of the state.
Model_model
 Pointer of class yane::Model::Model object.
yane::OdeSolve::OdeConfig_odeconfig
 Pointer of class yane::OdeSolve::OdeConfig object.
yane::OdeSolve::OdeFunction_odefunc
 Pointer of class yane::OdeSolve::OdeFunction object.
yane::OdeSolve::OdeSolveFirst_odesolver
 Pointer of class yane::OdeSolve::OdeSolveFirst object.
double * _u
 Control variable.
double * _x
 State variable.

Detailed Description

Simulator This class provides methods to simulate a given model

\[ \dot{x}_{u}(t) = f(x_{u}(t, x_0), u(t, x_0)) \]

on a fixed time interval $ [t_0, T] $ with initial value $ x_{u}(t_0, x_0) = x_0 $ and given control $ u(\cdot, x_0) $. That is, for a given class yane::Model::Model object and a given control $ u $ the simulator can solve the differential or difference equation forward in time.


Constructor & Destructor Documentation

LIB_EXPORT yane::Model::Simulator::Simulator ( Model model,
yane::OdeSolve::OdeConfig odeconf = 0 
)
Parameters:
modelPointer to a class yane::Model::Model object of the model under consideration
odeconfPointer to a class yane::OdeSolve::OdeConfig object of the model
Exceptions:
UndefinedExceptionIs thrown if mass matrix, Jacobian or gradient with respect to time of the control system is not defined
yane::Utils::MemoryExceptionIs thrown if memory allocation failed

Member Function Documentation

LIB_EXPORT void yane::Model::Simulator::initialize ( double  t,
double *  x,
double *  u 
) [virtual]

This function initializes the class yane::Model::Simulator object.

Parameters:
tTime instant
xState vector
uControl vector
LIB_EXPORT void yane::Model::Simulator::predictSequence ( int  seqlength,
double *  t,
double *  x,
double *  u 
) [virtual]

This function triggers the simulator to solve the dynamics of the control system under consideration on a given sampling grid and control.

Parameters:
seqlengthTime index of endpoint on time grid
tTime grid
xState vector
uControl on the time grid
LIB_EXPORT void yane::Model::Simulator::run ( double  targettime) [virtual]

This function triggers the simulator to solve the dynamics of the control system under consideration up to a time instant defined in the call of this function.

Parameters:
targettimeEndpoint of the simulation
LIB_EXPORT void yane::Model::Simulator::setControl ( double *  u) [virtual]

This function sets the solution output function.

Parameters:
solout
LIB_EXPORT void yane::Model::Simulator::setSolutionOutput ( OdeSolve::T_SOLOUTFUNC  func) [virtual]

This function sets the solution output function.

Parameters:
solout
LIB_EXPORT void yane::Model::Simulator::staticdftfunc ( int *  n,
double *  t,
double *  y,
double *  dft,
double *  rpar,
int *  ipar 
) [static, protected]
Parameters:
nDimension of the state
tTime grid
yState vector
dftTime derivative of the system
rparReal valued parameters
iparInteger valued parameters
LIB_EXPORT void yane::Model::Simulator::staticjacfunc ( int *  n,
double *  t,
double *  y,
double *  dfy,
int *  ldfy,
double *  rpar,
int *  ipar 
) [static, protected]
Parameters:
nDimension of the state
tTime grid
yState vector
dfyJacobian of the constraints
ldfyDimension of the Jacobian
rparReal valued parameters
iparInteger valued parameters
LIB_EXPORT void yane::Model::Simulator::staticmassfunc ( int *  n,
double *  mas,
int *  lmas,
double *  rpar,
int *  ipar 
) [static, protected]
Parameters:
nDimension of the state
masMass matrix of the system
lmasDimension of the mass matrix
rparReal valued parameters
iparInteger valued parameters
LIB_EXPORT void yane::Model::Simulator::staticodefunc ( int *  n,
double *  t,
double *  y,
double *  dy,
double *  rpar,
int *  ipar 
) [static, protected]
Parameters:
nDimension of the state
tTime grid
yState vector
dyDerivative of the state
rparReal valued parameters
iparInteger valued parameters
LIB_EXPORT void yane::Model::Simulator::trajectory ( int  seqlength,
double *  t,
double *  x,
double *  u,
double *  trajectory 
) [virtual]

This function triggers the simulator to compute the state trajectory of the control system under consideration on a given sampling grid and control.

Parameters:
seqlengthLength of the computed state trajectory
tTime grid
xState vector
uControl on the time grid