DUECA/DUSIME
Public Member Functions | Protected Attributes | List of all members
LinearSystem Class Reference

This class creates a linear time-invariant (control) system. More...

Inheritance diagram for LinearSystem:
Inheritance graph
[legend]

Public Member Functions

 LinearSystem ()
 Default constructor. More...
 
 LinearSystem (const Vector &num, const Vector &den, double dt)
 This constructs a SISO system, on the basis of continuous time transfer function. More...
 
 LinearSystem (const LinearSystem &)
 Copy constructor. More...
 
 LinearSystem (const Matrix &A, const Matrix &B, const Matrix &C, const Matrix &D, double dt)
 This constructs a system, on the basis of a continuous time state space system. More...
 
 LinearSystem (const Matrix &phi, const Matrix &psi, const Matrix &C, const Matrix &D)
 This constructs a system, on the basis of a discrete time state space system. More...
 
virtual ~LinearSystem ()
 Destructor. More...
 
LinearSystemoperator= (const LinearSystem &o)
 Assignment of one system to another. More...
 
virtual void acceptState (const Vector &x_new)
 Accept a new state. More...
 
virtual const Vectorstep (const Vector &u)
 Calculate a single time step, return the output vector. More...
 
virtual const Vectorstep (double u)
 Calculate a single time step, return the output vector. More...
 
virtual void reset ()
 Reset the state to 0;.
 
void createFromNumDen (const Vector &num, const Vector &den, double dt)
 Create a system from numerator, denominator input. More...
 
void createFromABCD (const Matrix &A, const Matrix &B, const Matrix &C, const Matrix &D, double dt)
 Create from matrices. More...
 
void createFromPhiPsiCD (const Matrix &phi, const Matrix &psi, const Matrix &C, const Matrix &D)
 Create from matrices, discrete.
 
const VectorgetY () const
 Obtain the output vector. More...
 
const VectorgetX () const
 Obtain the state vector. More...
 
VectorgetX ()
 Obtain the state vector for modification. More...
 
const MatrixgetPhi () const
 Additional output, transition. More...
 
const MatrixgetPsi () const
 Input matrix discrete system. More...
 
const MatrixgetC () const
 Output matrix. More...
 
const MatrixgetD () const
 Feedthrough matrix. More...
 

Protected Attributes

unsigned n
 Order of the system.
 
unsigned m
 Number of outputs.
 
Matrix Phi
 Transition matrix. More...
 
Matrix Psi
 Input matrix. More...
 
Matrix C
 Output matrix. More...
 
Matrix D
 Feedthrough matrix. More...
 
Vector x
 The state vector. More...
 
Vector y
 The output vector. More...
 

Detailed Description

This class creates a linear time-invariant (control) system.

The system is transformed to state-space form if necessary, and discretized with the parameter dt.

Constructor & Destructor Documentation

◆ LinearSystem() [1/5]

LinearSystem::LinearSystem ( )

Default constructor.

◆ LinearSystem() [2/5]

LinearSystem::LinearSystem ( const Vector num,
const Vector den,
double  dt 
)

This constructs a SISO system, on the basis of continuous time transfer function.

Parameters
numNumerator of the transfer function. Elements are arranged as num[0]*s^0 + num[1]*s^1 etc.
denDenominator.
dtSize, in seconds, of the discrete time step.

◆ LinearSystem() [3/5]

LinearSystem::LinearSystem ( const LinearSystem )

Copy constructor.

◆ LinearSystem() [4/5]

LinearSystem::LinearSystem ( const Matrix A,
const Matrix B,
const Matrix C,
const Matrix D,
double  dt 
)

This constructs a system, on the basis of a continuous time state space system.

Parameters
AA matrix
BB matrix
CC matrix
DD matrix
dtSize, in seconds, of the discrete time step.

◆ LinearSystem() [5/5]

LinearSystem::LinearSystem ( const Matrix phi,
const Matrix psi,
const Matrix C,
const Matrix D 
)

This constructs a system, on the basis of a discrete time state space system.

Parameters
phiphi matrix
psipsi matrix
CC matrix
DD matrix

◆ ~LinearSystem()

virtual LinearSystem::~LinearSystem ( )
virtual

Destructor.

Member Function Documentation

◆ operator=()

LinearSystem& LinearSystem::operator= ( const LinearSystem o)

Assignment of one system to another.

◆ acceptState()

virtual void LinearSystem::acceptState ( const Vector x_new)
virtual

Accept a new state.

Parameters
x_newVector with the new state.

Reimplemented in LimitedLinearSystem, and Integrator.

◆ step() [1/2]

virtual const Vector& LinearSystem::step ( const Vector u)
virtual

Calculate a single time step, return the output vector.

Parameters
uInput vector.

Reimplemented in LimitedLinearSystem, and Integrator.

◆ step() [2/2]

virtual const Vector& LinearSystem::step ( double  u)
virtual

Calculate a single time step, return the output vector.

Parameters
uInput variable. Only valid for SI systems.

Reimplemented in LimitedLinearSystem, and Integrator.

◆ createFromNumDen()

void LinearSystem::createFromNumDen ( const Vector num,
const Vector den,
double  dt 
)

Create a system from numerator, denominator input.

◆ createFromABCD()

void LinearSystem::createFromABCD ( const Matrix A,
const Matrix B,
const Matrix C,
const Matrix D,
double  dt 
)

Create from matrices.

◆ getY()

const Vector& LinearSystem::getY ( ) const
inline

Obtain the output vector.

◆ getX() [1/2]

const Vector& LinearSystem::getX ( ) const
inline

Obtain the state vector.

◆ getX() [2/2]

Vector& LinearSystem::getX ( )
inline

Obtain the state vector for modification.

◆ getPhi()

const Matrix& LinearSystem::getPhi ( ) const
inline

Additional output, transition.

◆ getPsi()

const Matrix& LinearSystem::getPsi ( ) const
inline

Input matrix discrete system.

◆ getC()

const Matrix& LinearSystem::getC ( ) const
inline

Output matrix.

◆ getD()

const Matrix& LinearSystem::getD ( ) const
inline

Feedthrough matrix.

Member Data Documentation

◆ Phi

Matrix LinearSystem::Phi
protected

Transition matrix.

◆ Psi

Matrix LinearSystem::Psi
protected

Input matrix.

◆ C

Matrix LinearSystem::C
protected

Output matrix.

◆ D

Matrix LinearSystem::D
protected

Feedthrough matrix.

◆ x

Vector LinearSystem::x
protected

The state vector.

◆ y

Vector LinearSystem::y
protected

The output vector.


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