Implements a feedforward law to be used within a Controller. More...
#include <feedforward_law.hpp>
Public Member Functions | |
virtual ControlLaw * | clone () const |
FeedforwardLaw () | |
FeedforwardLaw (const uint _nx, const Curve &_u, double _samplingTime=DEFAULT_SAMPLING_TIME) | |
FeedforwardLaw (const FeedforwardLaw &rhs) | |
virtual uint | getNP () const |
virtual uint | getNU () const |
virtual uint | getNW () const |
virtual uint | getNX () const |
virtual uint | getNXA () const |
virtual uint | getNY () const |
virtual returnValue | init (double startTime=0.0, const DVector &x0_=emptyConstVector, const DVector &p_=emptyConstVector, const VariablesGrid &_yRef=emptyConstVariablesGrid) |
virtual BooleanType | isDynamic () const |
virtual BooleanType | isStatic () const |
FeedforwardLaw & | operator= (const FeedforwardLaw &rhs) |
virtual returnValue | step (double currentTime, const DVector &_x, const DVector &_p=emptyConstVector, const VariablesGrid &_yRef=emptyConstVariablesGrid) |
virtual | ~FeedforwardLaw () |
Protected Attributes | |
uint | nx |
Curve | uRef |
Implements a feedforward law to be used within a Controller.
The class FeedforwardLaw allows to implement a predefined feedforward law to be evaluated at the sampling instants.
Definition at line 55 of file feedforward_law.hpp.
Default constructor.
The objective of this class is to be able to use precomputed controls to run a simulation. If the precomputed controls are given as a Curve mycontrols, use: FeedforwardLaw( numberofstates, mycontrols[,sampleTime])
Definition at line 54 of file feedforward_law.cpp.
FeedforwardLaw::FeedforwardLaw | ( | const uint | _nx, |
const Curve & | _u, | ||
double | _samplingTime = DEFAULT_SAMPLING_TIME |
||
) |
Constructor which takes the predefined control signals as curve together with the sampling time.
[in] | _nx | Number of differential states. |
[in] | _u | Predefined control signal. |
[in] | _samplingTime | Sampling time. |
Definition at line 60 of file feedforward_law.cpp.
FeedforwardLaw::FeedforwardLaw | ( | const FeedforwardLaw & | rhs | ) |
Copy constructor (deep copy).
[in] | rhs | Right-hand side object. |
Definition at line 71 of file feedforward_law.cpp.
FeedforwardLaw::~FeedforwardLaw | ( | ) | [virtual] |
Destructor.
Definition at line 78 of file feedforward_law.cpp.
ControlLaw * FeedforwardLaw::clone | ( | ) | const [virtual] |
Clone constructor (deep copy).
Implements ControlLaw.
Definition at line 95 of file feedforward_law.cpp.
uint FeedforwardLaw::getNP | ( | ) | const [virtual] |
Returns number of parameters.
Reimplemented from ControlLaw.
Definition at line 166 of file feedforward_law.cpp.
uint FeedforwardLaw::getNU | ( | ) | const [virtual] |
Returns number of controls.
Reimplemented from ControlLaw.
Definition at line 160 of file feedforward_law.cpp.
uint FeedforwardLaw::getNW | ( | ) | const [virtual] |
Returns number of (estimated) disturbances.
Reimplemented from ControlLaw.
Definition at line 172 of file feedforward_law.cpp.
uint FeedforwardLaw::getNX | ( | ) | const [virtual] |
Returns number of (estimated) differential states.
Reimplemented from ControlLaw.
Definition at line 148 of file feedforward_law.cpp.
uint FeedforwardLaw::getNXA | ( | ) | const [virtual] |
Returns number of (estimated) algebraic states.
Reimplemented from ControlLaw.
Definition at line 154 of file feedforward_law.cpp.
uint FeedforwardLaw::getNY | ( | ) | const [virtual] |
Returns number of process outputs.
Reimplemented from ControlLaw.
Definition at line 178 of file feedforward_law.cpp.
returnValue FeedforwardLaw::init | ( | double | startTime = 0.0 , |
const DVector & | x0_ = emptyConstVector , |
||
const DVector & | p_ = emptyConstVector , |
||
const VariablesGrid & | _yRef = emptyConstVariablesGrid |
||
) | [virtual] |
Initializes the feedforward law with given start values and performs a number of consistency checks.
[in] | _startTime | Start time. |
[in] | _x | Initial value for differential states. |
[in] | _p | Initial value for parameters. |
[in] | _yRef | Initial value for reference trajectory. |
Implements ControlLaw.
Definition at line 101 of file feedforward_law.cpp.
BooleanType FeedforwardLaw::isDynamic | ( | ) | const [virtual] |
Returns whether the control law is based on dynamic optimization or a static one.
Implements ControlLaw.
Definition at line 184 of file feedforward_law.cpp.
BooleanType FeedforwardLaw::isStatic | ( | ) | const [virtual] |
Returns whether the control law is a static one or based on dynamic optimization.
Implements ControlLaw.
Definition at line 190 of file feedforward_law.cpp.
FeedforwardLaw & FeedforwardLaw::operator= | ( | const FeedforwardLaw & | rhs | ) |
Assignment operator (deep copy).
[in] | rhs | Right-hand side object. |
Definition at line 83 of file feedforward_law.cpp.
returnValue FeedforwardLaw::step | ( | double | currentTime, |
const DVector & | _x, | ||
const DVector & | _p = emptyConstVector , |
||
const VariablesGrid & | _yRef = emptyConstVariablesGrid |
||
) | [virtual] |
Performs next step of the feedforward law based on given inputs.
[in] | currentTime | Current time. |
[in] | _x | Most recent value for differential states. |
[in] | _p | Most recent value for parameters. |
[in] | _yRef | Current piece of reference trajectory. |
Implements ControlLaw.
Definition at line 119 of file feedforward_law.cpp.
uint FeedforwardLaw::nx [protected] |
Number of differential states.
Definition at line 202 of file feedforward_law.hpp.
Curve FeedforwardLaw::uRef [protected] |
Predefined control signal.
Definition at line 203 of file feedforward_law.hpp.