DUECA/DUSIME
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
LinearSystem Class Reference

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

#include <LinearSystem.hxx>

Inheritance diagram for LinearSystem:
Inheritance graph
[legend]

Public Member Functions

 LinearSystem ()
 Default constructor.
 
 LinearSystem (const Vector &num, const Vector &den, double dt)
 This constructs a SISO system, on the basis of continuous time transfer function.
 
 LinearSystem (const LinearSystem &)
 Copy constructor.
 
 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.
 
 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.
 
virtual ~LinearSystem ()
 Destructor.
 
LinearSystemoperator= (const LinearSystem &o)
 Assignment of one system to another.
 
virtual void acceptState (const Vector &x_new)
 Accept a new state.
 
virtual const Vector & step (const Vector &u)
 Calculate a single time step, return the output vector.
 
virtual const Vector & step (double u)
 Calculate a single time step, return the output vector.
 
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.
 
void createFromABCD (const Matrix &A, const Matrix &B, const Matrix &C, const Matrix &D, double dt)
 Create from matrices.
 
void createFromPhiPsiCD (const Matrix &phi, const Matrix &psi, const Matrix &C, const Matrix &D)
 Create from matrices, discrete.
 
const Vector & getY () const
 Obtain the output vector.
 
const Vector & getX () const
 Obtain the state vector.
 
Vector & getX ()
 Obtain the state vector for modification.
 
const Matrix & getPhi () const
 Additional output, transition.
 
const Matrix & getPsi () const
 Input matrix discrete system.
 
const Matrix & getC () const
 Output matrix.
 
const Matrix & getD () const
 Feedthrough matrix.
 

Protected Attributes

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

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/3]

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() [2/3]

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() [3/3]

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

Member Function Documentation

◆ acceptState()

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

Accept a new state.

Parameters
x_newVector with the new state.

Reimplemented in Integrator, and LimitedLinearSystem.

◆ 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 Integrator, and LimitedLinearSystem.

◆ 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 Integrator, and LimitedLinearSystem.

◆ reset()

virtual void LinearSystem::reset ( )
virtual

Reset the state to 0;.

Reimplemented in LimitedLinearSystem.


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