Simulates the process to be controlled based on a dynamic model. More...
#include <process.hpp>
Protected Attributes | |
Actuator * | actuator |
DynamicSystem ** | dynamicSystems |
ShootingMethod * | integrationMethod |
IntegratorType | integratorType |
double | lastTime |
uint | nDynSys |
Curve * | processDisturbance |
Sensor * | sensor |
DVector | x |
DVector | xa |
VariablesGrid | y |
Protected Attributes inherited from SimulationBlock | |
BlockName | name |
RealClock | realClock |
double | samplingTime |
Protected Attributes inherited from UserInteraction | |
BlockStatus | status |
Protected Attributes inherited from Options | |
std::vector< OptionsList > | lists |
Protected Attributes inherited from Logging | |
std::vector< LogRecord > | logCollection |
int | logIdx |
Protected Attributes inherited from Plotting | |
PlotCollection | plotCollection |
Simulates the process to be controlled based on a dynamic model.
The class Process is one of the two main building-blocks within the SimulationEnvironment and complements the Controller. It simulates the process to be controlled based on a dynamic model.
The Process simulates the dynamic model based on the controls, and optionally parameters, passed. Before using these inputs, they can be transformed by an Actuator. After the simulation, the outputs can be transformed by a Sensor. That way, actuator/sensor delays or noise can be introduced to yield more realistic simulation results. Moreover, in case the dynamic model depends on Disturbances, their values are specified by the user by assigning the processDisturbance member.
Definition at line 71 of file process.hpp.
BEGIN_NAMESPACE_ACADO Process::Process | ( | ) |
Default constructor.
Definition at line 50 of file process.cpp.
Process::Process | ( | const DynamicSystem & | _dynamicSystem, |
IntegratorType | _integratorType = INT_UNKNOWN |
||
) |
Constructor which takes the dynamic system and the type of the integrator used for simulation.
[in] | _dynamicSystem | Dynamic system to be used for simulation. |
[in] | _integratorType | Type of integrator to be used for simulation. |
Definition at line 71 of file process.cpp.
Process::Process | ( | const Process & | rhs | ) |
Copy constructor (deep copy).
@param[in] rhs Right-hand side object.
Definition at line 100 of file process.cpp.
|
virtual |
Destructor.
Definition at line 144 of file process.cpp.
returnValue Process::addDynamicSystemStage | ( | const DynamicSystem & | _dynamicSystem, |
IntegratorType | _integratorType = INT_UNKNOWN |
||
) |
Assigns new dynamic system stage to be used for simulation.
@param[in] _dynamicSystem Dynamic system to be used for simulation. @param[in] _integratorType Type of integrator to be used for simulation. \note Multi-stage models are not yet supported!
Definition at line 238 of file process.cpp.
|
protected |
Internally adds a new dynamic system stage to be used for simulation.
@param[in] _dynamicSystem Dynamic system to be used for simulation. @param[in] stageIntervals Dummy grid. @param[in] _integratorType Type of integrator to be used for simulation. \note Multi-stage models are not yet supported!
Definition at line 778 of file process.cpp.
|
protected |
Calculates the process output based on the simulated states by evaluating the output function of the dynamic system.
[in] | _x | Differential states. |
[in] | _xComponents | Global components of differential states actually used. |
[in] | _xa | Algebraic states. |
[in] | _p | Parameters. |
[in] | _u | Controls. |
[in] | _w | Disturbances. |
[in] | _p | Parameters. |
[out] | _output | Time-varying process output. |
Definition at line 992 of file process.cpp.
|
protected |
Checks consistency of the given inputs (dimensions, time grids etc.).
@param[in] _u Time-varying controls. @param[in] _p Time-varying parameters.
Definition at line 957 of file process.cpp.
|
protected |
Clears all dynamic systems and all members.
Definition at line 797 of file process.cpp.
Returns number of parameter signals (at given stage) expected by the process.
@param[in] stageIdx Index of stage.
Returns number of control signals (at given stage) expected by the process.
@param[in] stageIdx Index of stage. \return Number of control signals (at given stage)
|
inline |
Returns number of stages of the dynamic model.
Returns number of disturbances (at given stage) used within the process.
@param[in] stageIdx Index of stage.
Returns number of differential states (at given stage) of the dynamic model.
@param[in] stageIdx Index of stage.
Returns number of algebraic states (at given stage) of the dynamic model.
@param[in] stageIdx Index of stage.
Returns number of process outputs (at given stage).
@param[in] stageIdx Index of stage.
|
inline |
Returns output of the process.
@param[out] _y Output of the process.
|
inline |
Returns whether process comprises an actuator.
|
inline |
Returns whether process comprises a process disturbance.
|
inline |
Returns whether process comprises a sensor.
|
virtual |
Initializes the simulation with given start values and performs a number of consistency checks.
[in] | _startTime | Start time of simulation. |
[in] | _xStart | Initial value for differential states. |
[in] | _uStart | Initial value for controls. |
[in] | _pStart | Initial value for parameters. |
Definition at line 353 of file process.cpp.
returnValue Process::initializeAlgebraicStates | ( | const DVector & | _xaStart | ) |
Initializes simulation with given start value for algebraic states.
@param[in] _xaStart Initial value for algebraic states.
Definition at line 345 of file process.cpp.
returnValue Process::initializeStartValues | ( | const DVector & | _xStart, |
const DVector & | _xaStart = emptyConstVector |
||
) |
Initializes simulation with given start values.
@param[in] _xStart Initial value for differential states. @param[in] _xaStart Initial value for algebraic states.
Definition at line 330 of file process.cpp.
|
inline |
Returns whether dynamic model (at given stage) is continuous in time.
@param[in] stageIdx Index of stage.
|
inline |
Returns whether dynamic model (at given stage) is a DAE.
@param[in] stageIdx Index of stage.
|
inline |
Returns whether dynamic model (at given stage) is discretized in time.
@param[in] stageIdx Index of stage.
|
inline |
Returns whether dynamic model (at given stage) is an ODE.
@param[in] stageIdx Index of stage.
Assignment operator (deep copy).
@param[in] rhs Right-hand side object.
Definition at line 150 of file process.cpp.
|
protected |
Projects differential states to global components actually used.
@param[in] _x Differential states. @param[in] _xComponents Global components of differential states actually used. @param[out] _output Projected differential states.
Definition at line 1028 of file process.cpp.
|
virtual |
Customized function for plotting process variables.
@param[in] _frequency Frequency determining at which time instants the window is to be plotted.
Reimplemented from Plotting.
Definition at line 678 of file process.cpp.
|
virtual |
Initializes simulation and performs one step based on given inputs.
@param[in] _u Time-varying controls. @param[in] _p Time-varying parameters.
Definition at line 632 of file process.cpp.
|
virtual |
Initializes simulation and performs one step based on given inputs.
@param[in] _u Time-varying controls. @param[in] _p Time-constant parameters.
Definition at line 647 of file process.cpp.
|
virtual |
Initializes simulation and performs one step based on given inputs.
@param[in] startTime Start time of simulation step. @param[in] endTime End time of simulation step. @param[in] _u Time-constant controls. @param[in] _p Time-constant parameters.
Definition at line 659 of file process.cpp.
returnValue Process::setActuator | ( | const Actuator & | _actuator | ) |
Assigns new actuator to be used for simulation.
@param[in] _actuator New actuator.
Definition at line 254 of file process.cpp.
returnValue Process::setDynamicSystem | ( | const DynamicSystem & | _dynamicSystem, |
IntegratorType | _integratorType = INT_UNKNOWN |
||
) |
Assigns new dynamic system to be used for simulation. All previously assigned dynamic systems will be deleted.
[in] | _dynamicSystem | Dynamic system to be used for simulation. |
[in] | _integratorType | Type of integrator to be used for simulation. |
Definition at line 204 of file process.cpp.
returnValue Process::setProcessDisturbance | ( | const Curve & | _processDisturbance | ) |
Assigns new process disturbance to be used for simulation.
@param[in] _processDisturbance New sensor.
Definition at line 289 of file process.cpp.
returnValue Process::setProcessDisturbance | ( | const VariablesGrid & | _processDisturbance | ) |
Assigns new process disturbance to be used for simulation.
@param[in] _processDisturbance New sensor.
Definition at line 303 of file process.cpp.
returnValue Process::setProcessDisturbance | ( | const char * | _processDisturbance | ) |
Assigns new process disturbance to be used for simulation.
@param[in] _processDisturbance New sensor.
Definition at line 316 of file process.cpp.
returnValue Process::setSensor | ( | const Sensor & | _sensor | ) |
Assigns new sensor to be used for simulation.
@param[in] _sensor New sensor.
Definition at line 271 of file process.cpp.
|
protectedvirtual |
Sets-up default logging information.
Reimplemented from Logging.
Definition at line 745 of file process.cpp.
|
protectedvirtual |
Sets-up default options.
Reimplemented from Options.
Definition at line 711 of file process.cpp.
|
protected |
Actually calls the integrator for performing a simulation. All simulated results are logged internally.
[in] | _u | Time-varying controls. |
[in] | _p | Time-varying parameters. |
[in] | _w | Time-varying disturbances. |
Definition at line 827 of file process.cpp.
|
virtual |
Performs one step of the simulation based on given inputs.
@param[in] _u Time-varying controls. @param[in] _p Time-varying parameters.
Definition at line 508 of file process.cpp.
|
virtual |
Performs one step of the simulation based on given inputs.
@param[in] _u Time-varying controls. @param[in] _p Time-constant parameters.
Definition at line 601 of file process.cpp.
|
virtual |
Performs one step of the simulation based on given inputs.
@param[in] startTime Start time of simulation step. @param[in] endTime End time of simulation step. @param[in] _u Time-constant controls. @param[in] _p Time-constant parameters.
Definition at line 613 of file process.cpp.
|
protected |
Definition at line 610 of file process.hpp.
|
protected |
Dynamic system to be used for simulation.
Definition at line 606 of file process.hpp.
|
protected |
Integration method to be used for simulation.
Definition at line 608 of file process.hpp.
|
protected |
Definition at line 619 of file process.hpp.
|
protected |
Definition at line 616 of file process.hpp.
|
protected |
Number of dynamic systems.
Definition at line 605 of file process.hpp.
|
protected |
Process disturbance block.
Definition at line 612 of file process.hpp.
|
protected |
Definition at line 611 of file process.hpp.
|
protected |
Definition at line 602 of file process.hpp.
|
protected |
Definition at line 603 of file process.hpp.
|
protected |
Definition at line 614 of file process.hpp.