akreon-control
Optimal and robust control and state estimation in C++26.
Loading...
Searching...
No Matches
control::StateSpace< Type, PlantIn, ControlIn, OutputIn > Struct Template Reference

forward decl of state space More...

#include <state_space.hpp>

Public Types

using Plant = linalg::remove_cvref_t< PlantIn >
 extract type and alias
 
using Control = linalg::remove_cvref_t< ControlIn >
 
using Output = linalg::remove_cvref_t< OutputIn >
 
using T = linalg::matrix_scalar_t< Plant >
 
using Feedthrough = linalg::Matrix< T, OutputRows, ControlCols >
 
using State = linalg::Vector< T, PlantCols >
 state vector
 
using Input = linalg::Vector< T, ControlCols >
 

Public Member Functions

constexpr StateSpace (const Plant &A_in, const Control &B_in, const Output &C_in)
 CTOR.
 
constexpr StateSpace (const Plant &A_in, const Control &B_in, const Output &C_in, const Feedthrough &D_in)
 CTOR.
 
constexpr auto state_update (const State &x, const Input &u) const
 state_update
 
constexpr auto output_map (const State &x, const Input &u) const
 output_map
 

Public Attributes

Plant A
 member var
 
Control B
 Control matrix.
 
Output C
 Output matrix.
 
std::optional< Feedthrough > D
 Feedthrough matrix.
 

Static Public Attributes

static constexpr std::size_t PlantRows = linalg::mat_rows_v<Plant>
 
static constexpr std::size_t PlantCols = linalg::mat_cols_v<Plant>
 
static constexpr std::size_t ControlRows = linalg::mat_rows_v<Control>
 
static constexpr std::size_t ControlCols = linalg::mat_cols_v<Control>
 
static constexpr std::size_t OutputRows = linalg::mat_rows_v<Output>
 
static constexpr std::size_t OutputCols = linalg::mat_cols_v<Output>
 

Detailed Description

template<TimeDomainType Type, linalg::SquareMatrix PlantIn, linalg::MatrixContainer ControlIn, linalg::MatrixContainer OutputIn>
struct control::StateSpace< Type, PlantIn, ControlIn, OutputIn >

forward decl of state space

StateSpace.

\(\dot{x} = A x(t) + B u(t)\) \(y = C x(t) + D u(t)\)

Definition at line 20 of file state_space.hpp.

Member Typedef Documentation

◆ Control

template<TimeDomainType Type, linalg::SquareMatrix PlantIn, linalg::MatrixContainer ControlIn, linalg::MatrixContainer OutputIn>
using control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::Control = linalg::remove_cvref_t<ControlIn>

Definition at line 23 of file state_space.hpp.

◆ Feedthrough

template<TimeDomainType Type, linalg::SquareMatrix PlantIn, linalg::MatrixContainer ControlIn, linalg::MatrixContainer OutputIn>
using control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::Feedthrough = linalg::Matrix<T, OutputRows, ControlCols>

Definition at line 34 of file state_space.hpp.

◆ Input

template<TimeDomainType Type, linalg::SquareMatrix PlantIn, linalg::MatrixContainer ControlIn, linalg::MatrixContainer OutputIn>
using control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::Input = linalg::Vector<T, ControlCols>

Definition at line 41 of file state_space.hpp.

◆ Output

template<TimeDomainType Type, linalg::SquareMatrix PlantIn, linalg::MatrixContainer ControlIn, linalg::MatrixContainer OutputIn>
using control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::Output = linalg::remove_cvref_t<OutputIn>

Definition at line 24 of file state_space.hpp.

◆ Plant

template<TimeDomainType Type, linalg::SquareMatrix PlantIn, linalg::MatrixContainer ControlIn, linalg::MatrixContainer OutputIn>
using control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::Plant = linalg::remove_cvref_t<PlantIn>

extract type and alias

Definition at line 22 of file state_space.hpp.

◆ State

template<TimeDomainType Type, linalg::SquareMatrix PlantIn, linalg::MatrixContainer ControlIn, linalg::MatrixContainer OutputIn>
using control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::State = linalg::Vector<T, PlantCols>

state vector

Definition at line 40 of file state_space.hpp.

◆ T

template<TimeDomainType Type, linalg::SquareMatrix PlantIn, linalg::MatrixContainer ControlIn, linalg::MatrixContainer OutputIn>
using control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::T = linalg::matrix_scalar_t<Plant>

Definition at line 26 of file state_space.hpp.

Constructor & Destructor Documentation

◆ StateSpace() [1/2]

template<TimeDomainType Type, linalg::SquareMatrix PlantIn, linalg::MatrixContainer ControlIn, linalg::MatrixContainer OutputIn>
constexpr control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::StateSpace ( const Plant &  A_in,
const Control &  B_in,
const Output &  C_in 
)
inlineexplicitconstexpr

CTOR.

Parameters
A(Plant)
B(Control)
C(Output)

Definition at line 50 of file state_space.hpp.

◆ StateSpace() [2/2]

template<TimeDomainType Type, linalg::SquareMatrix PlantIn, linalg::MatrixContainer ControlIn, linalg::MatrixContainer OutputIn>
constexpr control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::StateSpace ( const Plant &  A_in,
const Control &  B_in,
const Output &  C_in,
const Feedthrough &  D_in 
)
inlineexplicitconstexpr

CTOR.

Parameters
A(Plant)
B(Control)
C(Output)
D(Feedthrough)

Definition at line 62 of file state_space.hpp.

Member Function Documentation

◆ output_map()

template<TimeDomainType Type, linalg::SquareMatrix PlantIn, linalg::MatrixContainer ControlIn, linalg::MatrixContainer OutputIn>
constexpr auto control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::output_map ( const State &  x,
const Input &  u 
) const
inlineconstexpr

output_map

similar as plant_dynamics y = C x + D u

Parameters
x(State)
u(Input)
Returns
y

Definition at line 95 of file state_space.hpp.

References control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::C, control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::D, and control::is_continuous_v.

◆ state_update()

template<TimeDomainType Type, linalg::SquareMatrix PlantIn, linalg::MatrixContainer ControlIn, linalg::MatrixContainer OutputIn>
constexpr auto control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::state_update ( const State &  x,
const Input &  u 
) const
inlineconstexpr

state_update

Discrete x_next = A x_k + B u_k

Continuous xdot = A x + B u

Parameters
x(State)
u(Input)
Returns
xdot or x_next

Definition at line 80 of file state_space.hpp.

References control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::A, control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::B, and control::is_continuous_v.

Member Data Documentation

◆ A

template<TimeDomainType Type, linalg::SquareMatrix PlantIn, linalg::MatrixContainer ControlIn, linalg::MatrixContainer OutputIn>
Plant control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::A

member var

Plant matrix

Definition at line 100 of file state_space.hpp.

Referenced by control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::state_update().

◆ B

template<TimeDomainType Type, linalg::SquareMatrix PlantIn, linalg::MatrixContainer ControlIn, linalg::MatrixContainer OutputIn>
Control control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::B

Control matrix.

Definition at line 101 of file state_space.hpp.

Referenced by control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::state_update().

◆ C

template<TimeDomainType Type, linalg::SquareMatrix PlantIn, linalg::MatrixContainer ControlIn, linalg::MatrixContainer OutputIn>
Output control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::C

Output matrix.

Definition at line 102 of file state_space.hpp.

Referenced by control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::output_map().

◆ ControlCols

template<TimeDomainType Type, linalg::SquareMatrix PlantIn, linalg::MatrixContainer ControlIn, linalg::MatrixContainer OutputIn>
constexpr std::size_t control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::ControlCols = linalg::mat_cols_v<Control>
staticconstexpr

Definition at line 30 of file state_space.hpp.

◆ ControlRows

template<TimeDomainType Type, linalg::SquareMatrix PlantIn, linalg::MatrixContainer ControlIn, linalg::MatrixContainer OutputIn>
constexpr std::size_t control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::ControlRows = linalg::mat_rows_v<Control>
staticconstexpr

Definition at line 29 of file state_space.hpp.

◆ D

template<TimeDomainType Type, linalg::SquareMatrix PlantIn, linalg::MatrixContainer ControlIn, linalg::MatrixContainer OutputIn>
std::optional<Feedthrough> control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::D

Feedthrough matrix.

Definition at line 103 of file state_space.hpp.

Referenced by control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::output_map().

◆ OutputCols

template<TimeDomainType Type, linalg::SquareMatrix PlantIn, linalg::MatrixContainer ControlIn, linalg::MatrixContainer OutputIn>
constexpr std::size_t control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::OutputCols = linalg::mat_cols_v<Output>
staticconstexpr

Definition at line 32 of file state_space.hpp.

◆ OutputRows

template<TimeDomainType Type, linalg::SquareMatrix PlantIn, linalg::MatrixContainer ControlIn, linalg::MatrixContainer OutputIn>
constexpr std::size_t control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::OutputRows = linalg::mat_rows_v<Output>
staticconstexpr

Definition at line 31 of file state_space.hpp.

◆ PlantCols

template<TimeDomainType Type, linalg::SquareMatrix PlantIn, linalg::MatrixContainer ControlIn, linalg::MatrixContainer OutputIn>
constexpr std::size_t control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::PlantCols = linalg::mat_cols_v<Plant>
staticconstexpr

Definition at line 28 of file state_space.hpp.

◆ PlantRows

template<TimeDomainType Type, linalg::SquareMatrix PlantIn, linalg::MatrixContainer ControlIn, linalg::MatrixContainer OutputIn>
constexpr std::size_t control::StateSpace< Type, PlantIn, ControlIn, OutputIn >::PlantRows = linalg::mat_rows_v<Plant>
staticconstexpr

Definition at line 27 of file state_space.hpp.


The documentation for this struct was generated from the following files: