Simulates the process to be controlled based on a dynamic model. More...
#include <process.hpp>
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.
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).
[in] | rhs | Right-hand side object. |
Definition at line 100 of file process.cpp.
Process::~Process | ( | ) | [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.
[in] | _dynamicSystem | Dynamic system to be used for simulation. |
[in] | _integratorType | Type of integrator to be used for simulation. |
Definition at line 238 of file process.cpp.
returnValue Process::addStage | ( | const DynamicSystem & | dynamicSystem_, |
const Grid & | stageIntervals, | ||
const IntegratorType & | integratorType_ = INT_UNKNOWN |
||
) | [protected] |
Internally adds a new dynamic system stage to be used for simulation.
[in] | _dynamicSystem | Dynamic system to be used for simulation. |
[in] | stageIntervals | Dummy grid. |
[in] | _integratorType | Type of integrator to be used for simulation. |
Definition at line 778 of file process.cpp.
returnValue Process::calculateOutput | ( | OutputFcn & | _outputFcn, |
const VariablesGrid * | _x, | ||
const DVector & | _xComponents, | ||
const VariablesGrid * | _xa, | ||
const VariablesGrid * | _p, | ||
const VariablesGrid * | _u, | ||
const VariablesGrid * | _w, | ||
VariablesGrid * | _output | ||
) | const [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.
returnValue Process::checkInputConsistency | ( | const VariablesGrid & | _u, |
const VariablesGrid & | _p | ||
) | const [protected] |
Checks consistency of the given inputs (dimensions, time grids etc.).
[in] | _u | Time-varying controls. |
[in] | _p | Time-varying parameters. |
Definition at line 957 of file process.cpp.
returnValue Process::clear | ( | ) | [protected] |
Clears all dynamic systems and all members.
Definition at line 797 of file process.cpp.
uint Process::getNP | ( | uint | stageIdx = 0 | ) | const [inline] |
Returns number of parameter signals (at given stage) expected by the process.
[in] | stageIdx | Index of stage. |
uint Process::getNU | ( | uint | stageIdx = 0 | ) | const [inline] |
Returns number of control signals (at given stage) expected by the process.
[in] | stageIdx | Index of stage. |
uint Process::getNumStages | ( | ) | const [inline] |
Returns number of stages of the dynamic model.
uint Process::getNW | ( | uint | stageIdx = 0 | ) | const [inline] |
Returns number of disturbances (at given stage) used within the process.
[in] | stageIdx | Index of stage. |
uint Process::getNX | ( | uint | stageIdx = 0 | ) | const [inline, protected] |
Returns number of differential states (at given stage) of the dynamic model.
[in] | stageIdx | Index of stage. |
uint Process::getNXA | ( | uint | stageIdx = 0 | ) | const [inline, protected] |
Returns number of algebraic states (at given stage) of the dynamic model.
[in] | stageIdx | Index of stage. |
uint Process::getNY | ( | uint | stageIdx = 0 | ) | const [inline] |
Returns number of process outputs (at given stage).
[in] | stageIdx | Index of stage. |
returnValue Process::getY | ( | VariablesGrid & | _y | ) | const [inline] |
BooleanType Process::hasActuator | ( | ) | const [inline] |
Returns whether process comprises an actuator.
BooleanType Process::hasProcessDisturbance | ( | ) | const [inline] |
Returns whether process comprises a process disturbance.
BooleanType Process::hasSensor | ( | ) | const [inline] |
Returns whether process comprises a sensor.
returnValue Process::init | ( | double | _startTime = 0.0 , |
const DVector & | _xStart = emptyConstVector , |
||
const DVector & | _uStart = emptyConstVector , |
||
const DVector & | _pStart = emptyConstVector |
||
) | [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.
[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.
[in] | _xStart | Initial value for differential states. |
[in] | _xaStart | Initial value for algebraic states. |
Definition at line 330 of file process.cpp.
BooleanType Process::isContinuous | ( | uint | stageIdx = 0 | ) | const [inline] |
Returns whether dynamic model (at given stage) is continuous in time.
[in] | stageIdx | Index of stage. |
BooleanType Process::isDAE | ( | uint | stageIdx = 0 | ) | const [inline] |
Returns whether dynamic model (at given stage) is a DAE.
[in] | stageIdx | Index of stage. |
BooleanType Process::isDiscretized | ( | uint | stageIdx = 0 | ) | const [inline] |
Returns whether dynamic model (at given stage) is discretized in time.
[in] | stageIdx | Index of stage. |
BooleanType Process::isODE | ( | uint | stageIdx = 0 | ) | const [inline] |
Returns whether dynamic model (at given stage) is an ODE.
[in] | stageIdx | Index of stage. |
Assignment operator (deep copy).
[in] | rhs | Right-hand side object. |
Definition at line 150 of file process.cpp.
returnValue Process::projectToComponents | ( | const VariablesGrid & | _x, |
const DVector & | _xComponents, | ||
VariablesGrid & | _output | ||
) | const [protected] |
Projects differential states to global components actually used.
[in] | _x | Differential states. |
[in] | _xComponents | Global components of differential states actually used. |
[out] | _output | Projected differential states. |
Definition at line 1028 of file process.cpp.
returnValue Process::replot | ( | PlotFrequency | _frequency = PLOT_IN_ANY_CASE | ) | [virtual] |
Customized function for plotting process variables.
[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.
returnValue Process::run | ( | const VariablesGrid & | _u, |
const VariablesGrid & | _p = emptyVariablesGrid |
||
) | [virtual] |
Initializes simulation and performs one step based on given inputs.
[in] | _u | Time-varying controls. |
[in] | _p | Time-varying parameters. |
Definition at line 632 of file process.cpp.
returnValue Process::run | ( | const VariablesGrid & | _u, |
const DVector & | _p | ||
) | [virtual] |
Initializes simulation and performs one step based on given inputs.
[in] | _u | Time-varying controls. |
[in] | _p | Time-constant parameters. |
Definition at line 647 of file process.cpp.
returnValue Process::run | ( | double | startTime, |
double | endTime, | ||
const DVector & | _u, | ||
const DVector & | _p = emptyConstVector |
||
) | [virtual] |
Initializes simulation and performs one step based on given inputs.
[in] | startTime | Start time of simulation step. |
[in] | endTime | End time of simulation step. |
[in] | _u | Time-constant controls. |
[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.
[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.
[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.
[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.
[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.
[in] | _sensor | New sensor. |
Definition at line 271 of file process.cpp.
returnValue Process::setupLogging | ( | ) | [protected, virtual] |
Sets-up default logging information.
Reimplemented from Logging.
Definition at line 745 of file process.cpp.
returnValue Process::setupOptions | ( | ) | [protected, virtual] |
Sets-up default options.
Reimplemented from Options.
Definition at line 711 of file process.cpp.
returnValue Process::simulate | ( | const VariablesGrid & | _u, |
const VariablesGrid & | _p, | ||
const VariablesGrid & | _w | ||
) | [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.
returnValue Process::step | ( | const VariablesGrid & | _u, |
const VariablesGrid & | _p = emptyVariablesGrid |
||
) | [virtual] |
Performs one step of the simulation based on given inputs.
[in] | _u | Time-varying controls. |
[in] | _p | Time-varying parameters. |
Definition at line 508 of file process.cpp.
returnValue Process::step | ( | const VariablesGrid & | _u, |
const DVector & | _p | ||
) | [virtual] |
Performs one step of the simulation based on given inputs.
[in] | _u | Time-varying controls. |
[in] | _p | Time-constant parameters. |
Definition at line 601 of file process.cpp.
returnValue Process::step | ( | double | startTime, |
double | endTime, | ||
const DVector & | _u, | ||
const DVector & | _p = emptyConstVector |
||
) | [virtual] |
Performs one step of the simulation based on given inputs.
[in] | startTime | Start time of simulation step. |
[in] | endTime | End time of simulation step. |
[in] | _u | Time-constant controls. |
[in] | _p | Time-constant parameters. |
Definition at line 613 of file process.cpp.
Actuator* Process::actuator [protected] |
Definition at line 610 of file process.hpp.
DynamicSystem** Process::dynamicSystems [protected] |
Dynamic system to be used for simulation.
Definition at line 606 of file process.hpp.
ShootingMethod* Process::integrationMethod [protected] |
Integration method to be used for simulation.
Definition at line 608 of file process.hpp.
IntegratorType Process::integratorType [protected] |
Definition at line 619 of file process.hpp.
double Process::lastTime [protected] |
Definition at line 616 of file process.hpp.
uint Process::nDynSys [protected] |
Number of dynamic systems.
Definition at line 605 of file process.hpp.
Curve* Process::processDisturbance [protected] |
Process disturbance block.
Definition at line 612 of file process.hpp.
Sensor* Process::sensor [protected] |
Definition at line 611 of file process.hpp.
DVector Process::x [protected] |
Definition at line 602 of file process.hpp.
DVector Process::xa [protected] |
Definition at line 603 of file process.hpp.
VariablesGrid Process::y [protected] |
Definition at line 614 of file process.hpp.