- 3.0.2 core module.
|
interface class for a general linear system or linearized system More...
#include <SensitivityApproximation.h>
Public Member Functions | |
SensitivityApproximation (const SCALAR &dt, const std::shared_ptr< LinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >> &linearSystem=nullptr, const SensitivityApproximationSettings::APPROXIMATION &approx=SensitivityApproximationSettings::APPROXIMATION::FORWARD_EULER) | |
constructor More... | |
SensitivityApproximation (const SensitivityApproximationSettings &settings, const std::shared_ptr< LinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >> &linearSystem=nullptr) | |
constructor More... | |
SensitivityApproximation (const SensitivityApproximation &other) | |
copy constructor More... | |
virtual | ~SensitivityApproximation () |
destructor More... | |
virtual SensitivityApproximation< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR > * | clone () const override |
deep cloning More... | |
virtual void | setApproximation (const SensitivityApproximationSettings::APPROXIMATION &approx) override |
update the approximation type for the discrete-time system More... | |
SensitivityApproximationSettings::APPROXIMATION | getApproximation () const |
retrieve the approximation type for the discrete-time system More... | |
virtual void | setLinearSystem (const std::shared_ptr< LinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >> &linearSystem) override |
update the linear system More... | |
virtual void | setTimeDiscretization (const SCALAR &dt) override |
update the time discretization More... | |
void | updateSettings (const SensitivityApproximationSettings &settings) |
update the settings More... | |
virtual void | getAandB (const StateVector< STATE_DIM, SCALAR > &x, const ControlVector< CONTROL_DIM, SCALAR > &u, const StateVector< STATE_DIM, SCALAR > &x_next, const int n, const size_t numSteps, state_matrix_t &A, state_control_matrix_t &B) override |
get A and B matrix for linear time invariant system More... | |
Public Member Functions inherited from ct::core::Sensitivity< STATE_DIM, CONTROL_DIM, SCALAR > | |
Sensitivity () | |
virtual | ~Sensitivity () |
void | setSubstepTrajectoryReference (std::vector< StateVectorArrayPtr, Eigen::aligned_allocator< StateVectorArrayPtr >> *xSubstep, std::vector< ControlVectorArrayPtr, Eigen::aligned_allocator< ControlVectorArrayPtr >> *uSubstep) |
virtual void | getAandB (const StateVector< STATE_DIM, SCALAR > &x, const ControlVector< CONTROL_DIM, SCALAR > &u, const StateVector< STATE_DIM, SCALAR > &x_next, const int n, size_t numSteps, StateMatrix< STATE_DIM, SCALAR > &A, StateControlMatrix< STATE_DIM, CONTROL_DIM, SCALAR > &B) override=0 |
Public Member Functions inherited from ct::core::DiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR > | |
DiscreteLinearSystem (const ct::core::SYSTEM_TYPE &type=ct::core::SYSTEM_TYPE::GENERAL) | |
default constructor More... | |
virtual | ~DiscreteLinearSystem () |
destructor More... | |
virtual void | propagateControlledDynamics (const state_vector_t &state, const time_t n, const control_vector_t &control, state_vector_t &stateNext) override |
compute the system dynamics More... | |
virtual void | getAandB (const state_vector_t &x, const control_vector_t &u, const state_vector_t &x_next, const int n, size_t subSteps, state_matrix_t &A, state_control_matrix_t &B)=0 |
retrieve discrete-time linear system matrices A and B. More... | |
void | getAandB (const state_vector_t &x, const control_vector_t &u, const int n, state_matrix_t &A, state_control_matrix_t &B) |
Public Member Functions inherited from ct::core::DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR > | |
DiscreteControlledSystem (const SYSTEM_TYPE &type=SYSTEM_TYPE::GENERAL) | |
default constructor More... | |
DiscreteControlledSystem (std::shared_ptr< DiscreteController< STATE_DIM, CONTROL_DIM, SCALAR >> controller, const SYSTEM_TYPE &type=SYSTEM_TYPE::GENERAL) | |
constructor More... | |
DiscreteControlledSystem (const ControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR > &arg) | |
copy constructor More... | |
virtual | ~DiscreteControlledSystem ()=default |
destructor More... | |
void | setController (const std::shared_ptr< DiscreteController< STATE_DIM, CONTROL_DIM, SCALAR >> &controller) |
set a new controller More... | |
void | getController (std::shared_ptr< DiscreteController< STATE_DIM, CONTROL_DIM, SCALAR >> &controller) const |
get the controller instance More... | |
std::shared_ptr< DiscreteController< STATE_DIM, CONTROL_DIM, SCALAR > > | getController () |
get the controller instace More... | |
virtual void | propagateDynamics (const state_vector_t &state, const time_t n, state_vector_t &stateNext) override |
propagates the system dynamics forward by one step More... | |
Public Member Functions inherited from ct::core::DiscreteSystem< STATE_DIM, CONTROL_DIM, SCALAR > | |
DiscreteSystem (const SYSTEM_TYPE &type=GENERAL) | |
constructor More... | |
virtual | ~DiscreteSystem () |
desctructor More... | |
virtual void | propagateDynamics (const StateVector< STATE_DIM, SCALAR > &state, const time_t n, StateVector< STATE_DIM, SCALAR > &stateNext)=0 |
propagates the system dynamics forward by one step More... | |
SYSTEM_TYPE | getType () const |
get the type of system More... | |
Public Attributes | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef StateMatrix< STATE_DIM, SCALAR > | state_matrix_t |
state Jacobian type More... | |
Public Attributes inherited from ct::core::Sensitivity< STATE_DIM, CONTROL_DIM, SCALAR > | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef std::shared_ptr< StateVectorArray< STATE_DIM, SCALAR > > | StateVectorArrayPtr |
Public Attributes inherited from ct::core::DiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR > | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR > | Base |
Public Attributes inherited from ct::core::DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR > | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef std::shared_ptr< DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR > > | Ptr |
Additional Inherited Members | |
Protected Attributes inherited from ct::core::Sensitivity< STATE_DIM, CONTROL_DIM, SCALAR > | |
std::vector< StateVectorArrayPtr, Eigen::aligned_allocator< StateVectorArrayPtr > > * | xSubstep_ |
std::vector< ControlVectorArrayPtr, Eigen::aligned_allocator< ControlVectorArrayPtr > > * | uSubstep_ |
Protected Attributes inherited from ct::core::DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR > | |
std::shared_ptr< DiscreteController< STATE_DIM, CONTROL_DIM, SCALAR > > | controller_ |
the controller instance More... | |
Protected Attributes inherited from ct::core::DiscreteSystem< STATE_DIM, CONTROL_DIM, SCALAR > | |
SYSTEM_TYPE | type_ |
type of system More... | |
interface class for a general linear system or linearized system
Defines the interface for a linear system
STATE_DIM | size of state vector |
CONTROL_DIM | size of input vector |
typedef StateControlMatrix<STATE_DIM, CONTROL_DIM, SCALAR> ct::core::SensitivityApproximation< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::state_control_matrix_t |
input Jacobian type
|
inline |
constructor
|
inline |
constructor
|
inline |
copy constructor
|
inlinevirtual |
destructor
|
inlineoverridevirtual |
deep cloning
Reimplemented from ct::core::Sensitivity< STATE_DIM, CONTROL_DIM, SCALAR >.
|
inlineoverridevirtual |
update the approximation type for the discrete-time system
Reimplemented from ct::core::Sensitivity< STATE_DIM, CONTROL_DIM, SCALAR >.
References ct::core::SensitivityApproximationSettings::approximation_.
|
inline |
retrieve the approximation type for the discrete-time system
References ct::core::SensitivityApproximationSettings::approximation_.
|
inlineoverridevirtual |
update the linear system
Implements ct::core::Sensitivity< STATE_DIM, CONTROL_DIM, SCALAR >.
|
inlineoverridevirtual |
update the time discretization
Implements ct::core::Sensitivity< STATE_DIM, CONTROL_DIM, SCALAR >.
References ct::core::SensitivityApproximationSettings::dt_.
|
inline |
update the settings
|
inlineoverridevirtual |
get A and B matrix for linear time invariant system
compute discrete-time linear system matrices A and B
x | the state setpoint |
u | the control setpoint |
n | the time setpoint |
numSteps | number of timesteps of trajectory for which to get the sensitivity for |
A | the resulting linear system matrix A |
B | the resulting linear system matrix B |
for an LTI system A and B won't change with time n, hence the linearizations result from the following LTV special case.
the Tustin (also known as 'Heun') approximation uses the state and control at the start and at the end of the ZOH interval to generate linear approximations A and B in a trapezoidal fashion.
continuous-time A and B matrices
tustin approximation
References ct::core::SensitivityApproximationSettings::approximation_, ct::core::SensitivityApproximationSettings::BACKWARD_EULER, dt, ct::core::SensitivityApproximationSettings::dt_, ct::core::SensitivityApproximationSettings::FORWARD_EULER, ct::core::SensitivityApproximationSettings::MATRIX_EXPONENTIAL, n, SYMPLECTIC_DISABLED, SYMPLECTIC_ENABLED, ct::core::SensitivityApproximationSettings::SYMPLECTIC_EULER, ct::core::SensitivityApproximationSettings::TUSTIN, u, and x.
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef StateMatrix<STATE_DIM, SCALAR> ct::core::SensitivityApproximation< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::state_matrix_t |
state Jacobian type