Spacecraft Control Framework 1.0
Spacecraft Control Library
Public Member Functions | List of all members
state_space Class Reference

State space model. More...

#include <sc_state_space.h>

Public Member Functions

 state_space (void)
 Constructor.
 
void Initialize (const char *filename)
 Initialize with a filename. More...
 
void Initialize (const ml_matrix &a, const ml_matrix &b, const ml_matrix &c, const ml_matrix &d)
 Initialize with matrices. More...
 
ml_matrix RHS (const ml_matrix &x, const ml_matrix &u)
 Update the right-hand-side. More...
 
ml_matrix GetOutput (const ml_matrix &x, const ml_matrix &u)
 Get the output.
 
bool CheckDimensions (void)
 Check the matrix dimensions. More...
 

Detailed Description

State space model.

\[ y = cx + du \dot{x} = ax + bu \]

Continuous state space system.

Member Function Documentation

◆ Initialize() [1/2]

void state_space::Initialize ( const char *  filename)

Initialize with a filename.

Initialize the model from an ASCII text engine data file.

The matrices are a b c d Each begins with [ and ends with ]

Parameters
filenameThe file name

References CheckDimensions(), and sc_warn().

◆ Initialize() [2/2]

void state_space::Initialize ( const ml_matrix &  a,
const ml_matrix &  b,
const ml_matrix &  c,
const ml_matrix &  d 
)

Initialize with matrices.

Initialize the state space system x(k+1) = ax(k) + bu(k) y(k) = cx(k) + du(k).

Parameters
aState transition matrix
bInput matrix
cOutput matrix
dFeedthrough matrix

References CheckDimensions().

◆ RHS()

ml_matrix state_space::RHS ( const ml_matrix &  x,
const ml_matrix &  u 
)

Update the right-hand-side.

Update the state space system.

Parameters
xState
uInput
Returns
Updated state

◆ CheckDimensions()

bool state_space::CheckDimensions ( void  )

Check the matrix dimensions.

Checks state space system dimensions.

Returns
True if dimensions are correct.

Referenced by Initialize().