6#include "../control_traits.hpp"
22 using Plant = linalg::remove_cvref_t<PlantIn>;
23 using Control = linalg::remove_cvref_t<ControlIn>;
24 using Output = linalg::remove_cvref_t<OutputIn>;
26 using T = linalg::matrix_scalar_t<Plant>;
27 static constexpr std::size_t
PlantRows = linalg::mat_rows_v<Plant>;
28 static constexpr std::size_t
PlantCols = linalg::mat_cols_v<Plant>;
29 static constexpr std::size_t
ControlRows = linalg::mat_rows_v<Control>;
30 static constexpr std::size_t
ControlCols = linalg::mat_cols_v<Control>;
31 static constexpr std::size_t
OutputRows = linalg::mat_rows_v<Output>;
32 static constexpr std::size_t
OutputCols = linalg::mat_cols_v<Output>;
34 using Feedthrough = linalg::Matrix<T, OutputRows, ControlCols>;
37 "state dim is not aligned between plant and control matrices");
40 using State = linalg::Vector<T, PlantCols>;
41 using Input = linalg::Vector<T, ControlCols>;
96 return D.has_value() ?
C *
x + (*D) *
u :
C *
x;
103 std::optional<Feedthrough>
D;
constexpr bool is_continuous_v
check if continuous or not
TimeDomainType
time domain type
forward decl of state space
static constexpr std::size_t ControlRows
linalg::matrix_scalar_t< Plant > T
static constexpr std::size_t OutputCols
constexpr StateSpace(const Plant &A_in, const Control &B_in, const Output &C_in, const Feedthrough &D_in)
CTOR.
linalg::remove_cvref_t< ControlIn > Control
static constexpr std::size_t OutputRows
std::optional< Feedthrough > D
Feedthrough matrix.
linalg::Matrix< T, OutputRows, ControlCols > Feedthrough
constexpr auto state_update(const State &x, const Input &u) const
state_update
linalg::Vector< T, PlantCols > State
state vector
static constexpr std::size_t PlantRows
linalg::remove_cvref_t< PlantIn > Plant
extract type and alias
linalg::remove_cvref_t< OutputIn > Output
static constexpr std::size_t ControlCols
constexpr StateSpace(const Plant &A_in, const Control &B_in, const Output &C_in)
CTOR.
linalg::Vector< T, ControlCols > Input
constexpr auto output_map(const State &x, const Input &u) const
output_map
static constexpr std::size_t PlantCols