Brick
Loading...
Searching...
No Matches
LinearSystem< STATES, INPUTS, OUTPUTS > Class Template Reference

#include <linear_system.h>

Description

template<int STATES, int INPUTS, int OUTPUTS>
class LinearSystem< STATES, INPUTS, OUTPUTS >

This class represents a state-space model of a linear system.

It contains the following continuous matrices: A, System matrix B, Input matrix C, Output matrix D, Feedthrough matrix

Public Types

using MatrixA = EMat<STATES, STATES>
using MatrixB = EMat<STATES, INPUTS>
using MatrixC = EMat<OUTPUTS, STATES>
using MatrixD = EMat<OUTPUTS, INPUTS>
using VectorX = EVec<STATES>
using VectorU = EVec<INPUTS>
using VectorY = EVec<OUTPUTS>

Public Member Functions

 LinearSystem (const MatrixA &A, const MatrixB &B, const MatrixC &C, const MatrixD &D)
MatrixA A ()
 Returns the continuous system matrix A.
MatrixB B ()
 Returns the continuous input matrix B.
const std::tuple< std::tuple< MatrixA, MatrixB > > & discAB (const double &dt)
 Returns a tuple of A and B after being discretized.
MatrixC C ()
 Returns the output matrix C.
MatrixD D ()
 Returns the feedthrough matrix D.
VectorX compute_X (const VectorX &x, const VectorU &u, double dt)
VectorY compute_Y (const VectorX &x, const VectorU &u)

Constructor & Destructor Documentation

◆ LinearSystem()

template<int STATES, int INPUTS, int OUTPUTS>
LinearSystem< STATES, INPUTS, OUTPUTS >::LinearSystem ( const MatrixA & A,
const MatrixB & B,
const MatrixC & C,
const MatrixD & D )
inline

Constructs a discrete linear system with the given continuous matrices.

Parameters
AThe continuous system matrix
BThe continuous input matrix
CThe output matrix
DThe feedthrough matrix

Member Function Documentation

◆ compute_X()

template<int STATES, int INPUTS, int OUTPUTS>
VectorX LinearSystem< STATES, INPUTS, OUTPUTS >::compute_X ( const VectorX & x,
const VectorU & u,
double dt )
inline

Computes the new state vector given the previous state vector, an input vector, and the timestep in seconds.

Parameters
xThe current state vector.
uThe input vector.
dtThe timestep in seconds.
Returns
The new state vector.

◆ compute_Y()

template<int STATES, int INPUTS, int OUTPUTS>
VectorY LinearSystem< STATES, INPUTS, OUTPUTS >::compute_Y ( const VectorX & x,
const VectorU & u )
inline

Computes the output vector given a state and an input.

Parameters
xThe state vector.
uThe input vector.
Returns
The output vector.

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