CSSM – Continuous state space model

Block SymbolLicensing group: ADVANCED
Qt SVG Document Exported by REXYGEN Studio R1 HLD u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14 u15 u16 iE y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16 CSSM

Function Description
The CSSM block (Continuous State Space Model) simulates behavior of a linear system:

dx(t) dt = Acx(t) + Bcu(t),x(0) = x0 y(t) = Ccx(t) + Dcu(t),

where x(t) n is the state vector, x0 n is the initial value of the state vector, u(t) m is the input vector, y(t) p is the output vector. The matrix Ac n×n is the system dynamics matrix, Bc n×m is the input matrix, Cc p×n is the output matrix and Dc p×m is the direct transmission (feedthrough) matrix. If UD=off, the matrix Dc is not used during simulation (it behaves as if it were zero).

All matrices are specified in the same format as in Matlab, i.e. the whole matrix is placed in brackets, elements are entered by rows, elements of a row are separated by spaces (blanks), rows are separated by semicolons. The x0 vector is a column, therefore the elements are separated by semicolons (each element is in a separate row).

The simulated system is first converted to the discrete (discretized) state space model:

x((k + 1)T) = Adx(kT) + Bdu(kT),x(0) = x0 y(kT) = Ccx(kT) + Dcu(kT),

where k {1,2,} is the simulation step, T is the execution period of the block in seconds. The period T is not entered in the block, it is determined automatically as a period of the task (TASK, QTASK nebo IOTASK) containing the block.

If the input u(t) is changed only in the moments of sampling and between two consecutive sampling instants is constant, i.e. u(t) = u(kT) for t [kT,(k + 1)T), then the matrices Ad and Bd are determined by:

Ad = eAcT Bd = 0T eAcτB cdτ

Computation of discrete matrices Ad and Bd is based on a method described in [7], which uses Padé approximations of matrix exponential and its integral and scaling technique.

During the real-time simulation, single simulation step of the above discrete state space model is computed in each execution time instant. Outputs of the simulated system y1..y16 represent the state of the system x(t) and for a given simulation, the first p outputs are used, where p is the number of rows of the matrix Cc.

The output iE is an integer and contains information about the simulation progress:

  • 0: everything is OK, the block simulates correctly
  • -213: incompatibility of the dimensions of the state space model matrices
  • -510: the task is ill-conditioned (one of the working matrices is singular or close to a singular matrix)
  • xxx: error code xxx of the REXYGENsystem, see more in Appendix C

This block propagates the signal quality. More information can be found in the 1.4 section.

Input

R1

Block reset

Bool

HLD

Hold current model state

Bool

u1..u16

Analog input of the block

Double (F64)

Parameter

UD

Matrix Dc usage

Bool

is

Pade approximation order   0  4 2

Long (I32)

eps

Approximation accuracy   0.0  1.0 1e-15

Double (F64)

Ac

Matrix A of the continuous model  [-0.36 -1.24 -0.18; 1 0 0; 0 1 0]

Double (F64)

Bc

Matrix B of the continuous model  [0.5; 0; 0]

Double (F64)

Cc

Matrix C of the continuous model  [0.12 0.48 0.36]

Double (F64)

Dc

Matrix D of the continuous model  [0]

Double (F64)

x0

Initial value of the state x  [0; 0; 0]

Double (F64)

Output

iE

Error code

Error

y1..y16

Analog output of the block

Double (F64)

2024 © REX Controls s.r.o., www.rexygen.com