centroidal_control_collection
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | List of all members
CCC::InvariantSequentialExtension< StateDim, InputDim, OutputDim > Class Template Reference

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< _StateSpaceModelmodel_
 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...
 

Detailed Description

template<int StateDim, int InputDim, int OutputDim>
class CCC::InvariantSequentialExtension< StateDim, InputDim, OutputDim >

Sequential extension for time-invariant system.

Template Parameters
StateDimstate dimension
InputDiminput dimension
OutputDimoutput 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.

Member Typedef Documentation

◆ _StateSpaceModel

template<int StateDim, int InputDim, int OutputDim>
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.

Constructor & Destructor Documentation

◆ InvariantSequentialExtension()

template<int StateDim, int InputDim, int OutputDim>
EIGEN_MAKE_ALIGNED_OPERATOR_NEW CCC::InvariantSequentialExtension< StateDim, InputDim, OutputDim >::InvariantSequentialExtension ( const std::shared_ptr< _StateSpaceModel > &  model,
int  seq_len,
bool  extend_for_output = false 
)
inline

Constructor.

Parameters
modelstate-space model
seq_lensequence length
extend_for_outputwhether to extend for output instead of state

Definition at line 75 of file InvariantSequentialExtension.h.

Member Function Documentation

◆ setup()

template<int StateDim, int InputDim, int OutputDim>
void CCC::InvariantSequentialExtension< StateDim, InputDim, OutputDim >::setup ( bool  extend_for_output)
inlineprotected

Setup coefficients.

Definition at line 103 of file InvariantSequentialExtension.h.

◆ totalInputDim()

template<int StateDim, int InputDim, int OutputDim>
int CCC::InvariantSequentialExtension< StateDim, InputDim, OutputDim >::totalInputDim ( ) const
inline

Get total input dimension.

Definition at line 90 of file InvariantSequentialExtension.h.

◆ totalOutputDim()

template<int StateDim, int InputDim, int OutputDim>
int CCC::InvariantSequentialExtension< StateDim, InputDim, OutputDim >::totalOutputDim ( ) const
inline

Get total output dimension.

Definition at line 96 of file InvariantSequentialExtension.h.

◆ totalStateDim()

template<int StateDim, int InputDim, int OutputDim>
int CCC::InvariantSequentialExtension< StateDim, InputDim, OutputDim >::totalStateDim ( ) const
inline

Get total state dimension.

Definition at line 84 of file InvariantSequentialExtension.h.

Member Data Documentation

◆ A_seq_

template<int StateDim, int InputDim, int OutputDim>
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.

◆ B_seq_

template<int StateDim, int InputDim, int OutputDim>
Eigen::MatrixXd CCC::InvariantSequentialExtension< StateDim, InputDim, OutputDim >::B_seq_

Sequential extension matrix \(\boldsymbol{\hat{B}}\).

Definition at line 194 of file InvariantSequentialExtension.h.

◆ E_seq_

template<int StateDim, int InputDim, int OutputDim>
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.

◆ model_

template<int StateDim, int InputDim, int OutputDim>
std::shared_ptr<_StateSpaceModel> CCC::InvariantSequentialExtension< StateDim, InputDim, OutputDim >::model_

State-space model.

Definition at line 185 of file InvariantSequentialExtension.h.

◆ seq_len_

template<int StateDim, int InputDim, int OutputDim>
int CCC::InvariantSequentialExtension< StateDim, InputDim, OutputDim >::seq_len_ = 0

Sequence length.

Definition at line 188 of file InvariantSequentialExtension.h.


The documentation for this class was generated from the following file: