Implements a linear state feedback law to be used within a Controller. More...
#include <linear_state_feedback.hpp>
Public Member Functions | |
virtual ControlLaw * | clone () const |
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 |
LinearStateFeedback () | |
LinearStateFeedback (const DMatrix &_K, double _samplingTime=DEFAULT_SAMPLING_TIME) | |
LinearStateFeedback (const LinearStateFeedback &rhs) | |
LinearStateFeedback & | operator= (const LinearStateFeedback &rhs) |
virtual returnValue | step (double currentTime, const DVector &_x, const DVector &_p=emptyConstVector, const VariablesGrid &_yRef=emptyConstVariablesGrid) |
virtual | ~LinearStateFeedback () |
Protected Attributes | |
DMatrix | K |
Implements a linear state feedback law to be used within a Controller.
The class LinearStateFeedback implements a linear state feedback law to be used within a Controller.
Definition at line 57 of file linear_state_feedback.hpp.
Default constructor.
Definition at line 46 of file linear_state_feedback.cpp.
LinearStateFeedback::LinearStateFeedback | ( | const DMatrix & | _K, |
double | _samplingTime = DEFAULT_SAMPLING_TIME |
||
) |
Constructor which takes the gain matrix of the linear feedback law together with the sampling time.
[in] | _K | Linear feedback gain matrix. |
[in] | _samplingTime | Sampling time. |
Definition at line 52 of file linear_state_feedback.cpp.
LinearStateFeedback::LinearStateFeedback | ( | const LinearStateFeedback & | rhs | ) |
Copy constructor (deep copy).
[in] | rhs | Right-hand side object. |
Definition at line 61 of file linear_state_feedback.cpp.
LinearStateFeedback::~LinearStateFeedback | ( | ) | [virtual] |
Destructor.
Definition at line 67 of file linear_state_feedback.cpp.
ControlLaw * LinearStateFeedback::clone | ( | ) | const [virtual] |
Clone constructor (deep copy).
Implements ControlLaw.
Definition at line 86 of file linear_state_feedback.cpp.
uint LinearStateFeedback::getNP | ( | ) | const [virtual] |
Returns number of parameters.
Reimplemented from ControlLaw.
Definition at line 165 of file linear_state_feedback.cpp.
uint LinearStateFeedback::getNU | ( | ) | const [virtual] |
Returns number of controls.
Reimplemented from ControlLaw.
Definition at line 159 of file linear_state_feedback.cpp.
uint LinearStateFeedback::getNW | ( | ) | const [virtual] |
Returns number of (estimated) disturbances.
Reimplemented from ControlLaw.
Definition at line 171 of file linear_state_feedback.cpp.
uint LinearStateFeedback::getNX | ( | ) | const [virtual] |
Returns number of (estimated) differential states.
Reimplemented from ControlLaw.
Definition at line 147 of file linear_state_feedback.cpp.
uint LinearStateFeedback::getNXA | ( | ) | const [virtual] |
Returns number of (estimated) algebraic states.
Reimplemented from ControlLaw.
Definition at line 153 of file linear_state_feedback.cpp.
uint LinearStateFeedback::getNY | ( | ) | const [virtual] |
Returns number of process outputs.
Reimplemented from ControlLaw.
Definition at line 177 of file linear_state_feedback.cpp.
returnValue LinearStateFeedback::init | ( | double | startTime = 0.0 , |
const DVector & | x0_ = emptyConstVector , |
||
const DVector & | p_ = emptyConstVector , |
||
const VariablesGrid & | _yRef = emptyConstVariablesGrid |
||
) | [virtual] |
Initializes the feedback 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 92 of file linear_state_feedback.cpp.
BooleanType LinearStateFeedback::isDynamic | ( | ) | const [virtual] |
Returns whether the control law is based on dynamic optimization or a static one.
Implements ControlLaw.
Definition at line 183 of file linear_state_feedback.cpp.
BooleanType LinearStateFeedback::isStatic | ( | ) | const [virtual] |
Returns whether the control law is a static one or based on dynamic optimization.
Implements ControlLaw.
Definition at line 189 of file linear_state_feedback.cpp.
LinearStateFeedback & LinearStateFeedback::operator= | ( | const LinearStateFeedback & | rhs | ) |
Assignment operator (deep copy).
[in] | rhs | Right-hand side object. |
Definition at line 72 of file linear_state_feedback.cpp.
returnValue LinearStateFeedback::step | ( | double | currentTime, |
const DVector & | _x, | ||
const DVector & | _p = emptyConstVector , |
||
const VariablesGrid & | _yRef = emptyConstVariablesGrid |
||
) | [virtual] |
Performs next step of the feedback 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 103 of file linear_state_feedback.cpp.
DMatrix LinearStateFeedback::K [protected] |
Linear state feedback gain matrix.
Definition at line 204 of file linear_state_feedback.hpp.