Spacecraft Control Framework 1.0
Spacecraft Control Library
sc_state_space.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------------------
2// A state space dynamical model
3//-----------------------------------------------------------------------------------------
4// Copyright (c) 2010 Princeton Satellite Systems. All rights reserved.
5//-----------------------------------------------------------------------------------------
6
9
10#ifndef __STATE_SPACE__
11#define __STATE_SPACE__
12
13#ifdef AS_OS_WINDOWS
14 #include "matrixlib.h"
15#else
16 #include <MatrixLib/MatrixLib.h>
17#endif
18
19
31{
32
33 private:
35 ml_matrix a;
37 ml_matrix b;
39 ml_matrix c;
41 ml_matrix d;
43 bool initialized;
44
45
46 public:
48 state_space( void );
50 void Initialize( const char * filename );
52 void Initialize( const ml_matrix& a, const ml_matrix& b, const ml_matrix& c, const ml_matrix& d );
54 ml_matrix RHS( const ml_matrix& x, const ml_matrix& u );
56 ml_matrix GetOutput( const ml_matrix& x, const ml_matrix&u ){ return c*x + d*u; };
58 bool CheckDimensions( void );
59
60
61};
62
63
64#endif
State space model.
Definition: sc_state_space.h:31
ml_matrix RHS(const ml_matrix &x, const ml_matrix &u)
Update the right-hand-side.
Definition: sc_state_space.cc:155
bool CheckDimensions(void)
Check the matrix dimensions.
Definition: sc_state_space.cc:123
void Initialize(const char *filename)
Initialize with a filename.
Definition: sc_state_space.cc:31
state_space(void)
Constructor.
Definition: sc_state_space.cc:16
ml_matrix GetOutput(const ml_matrix &x, const ml_matrix &u)
Get the output.
Definition: sc_state_space.h:56