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

Sequential extension for time-variant system. More...

#include <VariantSequentialExtension.h>

Public Types

using _StateSpaceModel = StateSpaceModel< StateDim, Eigen::Dynamic, Eigen::Dynamic >
 Type of state-space model with fixed state dimension. More...
 

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW VariantSequentialExtension (const ListType< std::shared_ptr< _StateSpaceModel >> &model_list, 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

ListType< std::shared_ptr< _StateSpaceModel > > model_list_
 State-space model list. More...
 
int total_state_dim_ = 0
 Total state dimension. More...
 
int total_input_dim_ = 0
 Total input dimension. More...
 
int total_output_dim_ = 0
 Total output dimension. 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, template< class, class... > class ListType = std::vector>
class CCC::VariantSequentialExtension< StateDim, ListType >

Sequential extension for time-variant system.

Template Parameters
StateDimstate dimension
ListTypetype of state-space model list
Note
State dimension must be the same for all models in the sequence.

Given the following time-variant linear discrete state equation (even systems with time-variant dimensions of control input are acceptable).

\begin{align*} \boldsymbol{x}_{k+1} = \boldsymbol{A}_{k} \boldsymbol{x}_{k} + \boldsymbol{B}_{k} \boldsymbol{u}_{k} + \boldsymbol{e}_k \end{align*}

The following equation is called "sequential extension" here. In this class, the coefficients \(\boldsymbol{\hat{A}}_k\), \(\boldsymbol{\hat{B}}_k\), and \(\boldsymbol{\hat{e}}_k\) are calculated.

\begin{align*} \boldsymbol{\hat{x}}_{k+1} &= \boldsymbol{\hat{A}}_{k} \boldsymbol{x}_{k} + \boldsymbol{\hat{B}}_{k} \boldsymbol{\hat{u}}_{k} + \boldsymbol{\hat{e}}_k \\ \Leftrightarrow \begin{bmatrix} \boldsymbol{x}_{k+1} \\ \boldsymbol{x}_{k+2} \\ \boldsymbol{x}_{k+3} \\ \boldsymbol{x}_{k+4} \\ \vdots \\ \boldsymbol{x}_{k+N} \end{bmatrix} &= \begin{bmatrix} \boldsymbol{A}_{k} \\ \boldsymbol{A}_{k+1} \boldsymbol{A}_{k} \\ \boldsymbol{A}_{k+2} \boldsymbol{A}_{k+1} \boldsymbol{A}_{k} \\ \boldsymbol{A}_{k+3} \boldsymbol{A}_{k+2} \boldsymbol{A}_{k+1} \boldsymbol{A}_{k} \\ \vdots \\ \boldsymbol{A}_{k+N-1} \cdots \boldsymbol{A}_{k+1} \boldsymbol{A}_{k} \end{bmatrix} \boldsymbol{x}_{k} \\ & + \begin{bmatrix} \boldsymbol{B}_{k} & \boldsymbol{O} & \boldsymbol{O} & \boldsymbol{O} & \boldsymbol{O} & \cdots & \boldsymbol{O} \\ \boldsymbol{A}_{k+1} \boldsymbol{B}_{k} & \boldsymbol{B}_{k+1} & \boldsymbol{O} & \boldsymbol{O} & \boldsymbol{O} & \cdots & \boldsymbol{O} \\ \boldsymbol{A}_{k+2} \boldsymbol{A}_{k+1} \boldsymbol{B}_{k} & \boldsymbol{A}_{k+2} \boldsymbol{B}_{k+1} & \boldsymbol{B}_{k+2} & \boldsymbol{O} & \boldsymbol{O} & \cdots & \boldsymbol{O} \\ \boldsymbol{A}_{k+3} \boldsymbol{A}_{k+2} \boldsymbol{A}_{k+1} \boldsymbol{B}_{k} & \boldsymbol{A}_{k+3} \boldsymbol{A}_{k+2} \boldsymbol{B}_{k+1} & \boldsymbol{A}_{k+3} \boldsymbol{B}_{k+2} & \boldsymbol{B}_{k+3} & \boldsymbol{O} & \cdots & \boldsymbol{O} \\ \vdots & \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\ \boldsymbol{A}_{k+N-1} \cdots \boldsymbol{A}_{k+1} \boldsymbol{B}_{k} & \cdots & \cdots & \cdots & \cdots & \boldsymbol{A}_{k+N-1} \boldsymbol{B}_{k+N-2} & \boldsymbol{B}_{k+N-1} \end{bmatrix} \begin{bmatrix} \boldsymbol{u}_{k} \\ \boldsymbol{u}_{k+1} \\ \boldsymbol{u}_{k+2} \\ \boldsymbol{u}_{k+3} \\ \vdots \\ \boldsymbol{u}_{k+N-1} \end{bmatrix} \\ & + \begin{bmatrix} \boldsymbol{e}_{k} \\ \boldsymbol{A}_{k+1} \boldsymbol{e}_{k} + \boldsymbol{e}_{k+1} \\ \boldsymbol{A}_{k+2} \boldsymbol{A}_{k+1} \boldsymbol{e}_{k} + \boldsymbol{A}_{k+2} \boldsymbol{e}_{k+1} + \boldsymbol{e}_{k+2}\\ \vdots \\ \vdots \\ \boldsymbol{A}_{k+N-1} \cdots \boldsymbol{A}_{k+1} \boldsymbol{e}_{k} + \boldsymbol{A}_{k+N-1} \cdots\boldsymbol{A}_{k+2} \boldsymbol{e}_{k+1} + \cdots + \boldsymbol{e}_{k+N-1} \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 70 of file VariantSequentialExtension.h.

Member Typedef Documentation

◆ _StateSpaceModel

template<int StateDim, template< class, class... > class ListType = std::vector>
using CCC::VariantSequentialExtension< StateDim, ListType >::_StateSpaceModel = StateSpaceModel<StateDim, Eigen::Dynamic, Eigen::Dynamic>

Type of state-space model with fixed state dimension.

Definition at line 74 of file VariantSequentialExtension.h.

Constructor & Destructor Documentation

◆ VariantSequentialExtension()

template<int StateDim, template< class, class... > class ListType = std::vector>
EIGEN_MAKE_ALIGNED_OPERATOR_NEW CCC::VariantSequentialExtension< StateDim, ListType >::VariantSequentialExtension ( const ListType< std::shared_ptr< _StateSpaceModel >> &  model_list,
bool  extend_for_output = false 
)
inline

Constructor.

Parameters
model_listlist of state-space model
extend_for_outputwhether to extend for output instead of state

Definition at line 83 of file VariantSequentialExtension.h.

Member Function Documentation

◆ setup()

template<int StateDim, template< class, class... > class ListType = std::vector>
void CCC::VariantSequentialExtension< StateDim, ListType >::setup ( bool  extend_for_output)
inlineprotected

Setup coefficients.

Definition at line 110 of file VariantSequentialExtension.h.

◆ totalInputDim()

template<int StateDim, template< class, class... > class ListType = std::vector>
int CCC::VariantSequentialExtension< StateDim, ListType >::totalInputDim ( ) const
inline

Get total input dimension.

Definition at line 97 of file VariantSequentialExtension.h.

◆ totalOutputDim()

template<int StateDim, template< class, class... > class ListType = std::vector>
int CCC::VariantSequentialExtension< StateDim, ListType >::totalOutputDim ( ) const
inline

Get total output dimension.

Definition at line 103 of file VariantSequentialExtension.h.

◆ totalStateDim()

template<int StateDim, template< class, class... > class ListType = std::vector>
int CCC::VariantSequentialExtension< StateDim, ListType >::totalStateDim ( ) const
inline

Get total state dimension.

Definition at line 91 of file VariantSequentialExtension.h.

Member Data Documentation

◆ A_seq_

template<int StateDim, template< class, class... > class ListType = std::vector>
Eigen::Matrix<double, Eigen::Dynamic, StateDim> CCC::VariantSequentialExtension< StateDim, ListType >::A_seq_

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

Definition at line 224 of file VariantSequentialExtension.h.

◆ B_seq_

template<int StateDim, template< class, class... > class ListType = std::vector>
Eigen::MatrixXd CCC::VariantSequentialExtension< StateDim, ListType >::B_seq_

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

Definition at line 227 of file VariantSequentialExtension.h.

◆ E_seq_

template<int StateDim, template< class, class... > class ListType = std::vector>
Eigen::VectorXd CCC::VariantSequentialExtension< StateDim, ListType >::E_seq_

Sequential extension vector (i.e., offset vector) \(\boldsymbol{\hat{e}}\).

Definition at line 230 of file VariantSequentialExtension.h.

◆ model_list_

template<int StateDim, template< class, class... > class ListType = std::vector>
ListType<std::shared_ptr<_StateSpaceModel> > CCC::VariantSequentialExtension< StateDim, ListType >::model_list_

State-space model list.

Definition at line 212 of file VariantSequentialExtension.h.

◆ total_input_dim_

template<int StateDim, template< class, class... > class ListType = std::vector>
int CCC::VariantSequentialExtension< StateDim, ListType >::total_input_dim_ = 0

Total input dimension.

Definition at line 218 of file VariantSequentialExtension.h.

◆ total_output_dim_

template<int StateDim, template< class, class... > class ListType = std::vector>
int CCC::VariantSequentialExtension< StateDim, ListType >::total_output_dim_ = 0

Total output dimension.

Definition at line 221 of file VariantSequentialExtension.h.

◆ total_state_dim_

template<int StateDim, template< class, class... > class ListType = std::vector>
int CCC::VariantSequentialExtension< StateDim, ListType >::total_state_dim_ = 0

Total state dimension.

Definition at line 215 of file VariantSequentialExtension.h.


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