centroidal_control_collection
|
Sequential extension for time-invariant system. More...
#include <InvariantSequentialExtension.h>
Public Types | |
using | _StateSpaceModel = StateSpaceModel< StateDim, InputDim, OutputDim > |
Type of state-space model with fixed dimensions of state, input, and output. More... | |
Public Member Functions | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW | InvariantSequentialExtension (const std::shared_ptr< _StateSpaceModel > &model, int seq_len, bool extend_for_output=false) |
Constructor. More... | |
int | totalStateDim () const |
Get total state dimension. More... | |
int | totalInputDim () const |
Get total input dimension. More... | |
int | totalOutputDim () const |
Get total output dimension. More... | |
Public Attributes | |
std::shared_ptr< _StateSpaceModel > | model_ |
State-space model. More... | |
int | seq_len_ = 0 |
Sequence length. More... | |
Eigen::Matrix< double, Eigen::Dynamic, StateDim > | A_seq_ |
Sequential extension matrix \(\boldsymbol{\hat{A}}\). More... | |
Eigen::MatrixXd | B_seq_ |
Sequential extension matrix \(\boldsymbol{\hat{B}}\). More... | |
Eigen::VectorXd | E_seq_ |
Sequential extension vector (i.e., offset vector) \(\boldsymbol{\hat{e}}\). More... | |
Protected Member Functions | |
void | setup (bool extend_for_output) |
Setup coefficients. More... | |
Sequential extension for time-invariant system.
StateDim | state dimension |
InputDim | input dimension |
OutputDim | output dimension |
Given the following time-invariant linear discrete state equation.
\begin{align*} \boldsymbol{x}_{k+1} = \boldsymbol{A} \boldsymbol{x}_{k} + \boldsymbol{B} \boldsymbol{u}_{k} + \boldsymbol{e} \end{align*}
The following equation is called "sequential extension" here. In this class, the coefficients \(\boldsymbol{\hat{A}}\), \(\boldsymbol{\hat{B}}\), and \(\boldsymbol{\hat{e}}\) are calculated.
\begin{align*} \boldsymbol{\hat{x}}_{k+1} &= \boldsymbol{\hat{A}} \boldsymbol{x}_{k} + \boldsymbol{\hat{B}} \boldsymbol{\hat{u}}_{k} + \boldsymbol{\hat{e}} \\ \Leftrightarrow \begin{bmatrix} \boldsymbol{x}_{k+1} \\ \boldsymbol{x}_{k+2} \\ \boldsymbol{x}_{k+3} \\ \vdots \\ \boldsymbol{x}_{k+N} \end{bmatrix} &= \begin{bmatrix} \boldsymbol{A} \\ \boldsymbol{A}^2 \\ \boldsymbol{A}^3 \\ \vdots \\ \boldsymbol{A}^N \end{bmatrix} \boldsymbol{x}_{k} + \begin{bmatrix} \boldsymbol{B} & \boldsymbol{O} & \boldsymbol{O} & \boldsymbol{O} & \cdots & \boldsymbol{O} \\ \boldsymbol{A} \boldsymbol{B} & \boldsymbol{B} & \boldsymbol{O} & \boldsymbol{O} & \cdots & \boldsymbol{O} \\ \boldsymbol{A}^2 \boldsymbol{B} & \boldsymbol{A} \boldsymbol{B} & \boldsymbol{B} & \boldsymbol{O} & \cdots & \boldsymbol{O} \\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\ \boldsymbol{A}^{N-1} \boldsymbol{B} & \cdots & \cdots & \cdots & \boldsymbol{A} \boldsymbol{B} & \boldsymbol{B} \end{bmatrix} \begin{bmatrix} \boldsymbol{u}_{k} \\ \boldsymbol{u}_{k+1} \\ \boldsymbol{u}_{k+2} \\ \vdots \\ \boldsymbol{u}_{k+N-1} \end{bmatrix} + \begin{bmatrix} \boldsymbol{e} \\ (\boldsymbol{A} + \boldsymbol{I}) \boldsymbol{e} \\ (\boldsymbol{A}^2 + \boldsymbol{A} + \boldsymbol{I}) \boldsymbol{e} \\ \vdots \\ (\boldsymbol{A}^{N-1} + \cdots + \boldsymbol{A} + \boldsymbol{I}) \boldsymbol{e} \end{bmatrix} \end{align*}
Such a sequential extension is often used to formulate linear MPC as quadratic programming. For example, the following papers uses it.
Definition at line 61 of file InvariantSequentialExtension.h.
using CCC::InvariantSequentialExtension< StateDim, InputDim, OutputDim >::_StateSpaceModel = StateSpaceModel<StateDim, InputDim, OutputDim> |
Type of state-space model with fixed dimensions of state, input, and output.
Definition at line 65 of file InvariantSequentialExtension.h.
|
inline |
Constructor.
model | state-space model |
seq_len | sequence length |
extend_for_output | whether to extend for output instead of state |
Definition at line 75 of file InvariantSequentialExtension.h.
|
inlineprotected |
Setup coefficients.
Definition at line 103 of file InvariantSequentialExtension.h.
|
inline |
Get total input dimension.
Definition at line 90 of file InvariantSequentialExtension.h.
|
inline |
Get total output dimension.
Definition at line 96 of file InvariantSequentialExtension.h.
|
inline |
Get total state dimension.
Definition at line 84 of file InvariantSequentialExtension.h.
Eigen::Matrix<double, Eigen::Dynamic, StateDim> CCC::InvariantSequentialExtension< StateDim, InputDim, OutputDim >::A_seq_ |
Sequential extension matrix \(\boldsymbol{\hat{A}}\).
Definition at line 191 of file InvariantSequentialExtension.h.
Eigen::MatrixXd CCC::InvariantSequentialExtension< StateDim, InputDim, OutputDim >::B_seq_ |
Sequential extension matrix \(\boldsymbol{\hat{B}}\).
Definition at line 194 of file InvariantSequentialExtension.h.
Eigen::VectorXd CCC::InvariantSequentialExtension< StateDim, InputDim, OutputDim >::E_seq_ |
Sequential extension vector (i.e., offset vector) \(\boldsymbol{\hat{e}}\).
Definition at line 197 of file InvariantSequentialExtension.h.
std::shared_ptr<_StateSpaceModel> CCC::InvariantSequentialExtension< StateDim, InputDim, OutputDim >::model_ |
State-space model.
Definition at line 185 of file InvariantSequentialExtension.h.
int CCC::InvariantSequentialExtension< StateDim, InputDim, OutputDim >::seq_len_ = 0 |
Sequence length.
Definition at line 188 of file InvariantSequentialExtension.h.