### DDELSSM – Discrete state space model of a linear system with time delay Function Description
The DDELSSM block (Discrete State Space Model with time DELay) simulates behavior of a linear system with time delay $del$

$\begin{array}{rcll}x\left(k+1\right)& =& {A}_{d}x\left(k\right)+{B}_{d}u\left(k-d\right),\phantom{\rule{1em}{0ex}}x\left(0\right)=x0& \text{}\\ y\left(k\right)& =& {C}_{d}x\left(k\right)+{D}_{d}u\left(k\right),& \text{}\end{array}$

where $k$ is the simulation step, $x\left(k\right)\in {ℝ}^{n}$ is the state vector, $x0\in {ℝ}^{n}$ is the initial value of the state vector, $u\left(k\right)\in {ℝ}^{m}$ is the input vector, $y\left(k\right)\in {ℝ}^{p}$ is the output vector. The matrix ${A}_{d}\in {ℝ}^{n×n}$ is the system dynamics matrix, ${B}_{d}\in {ℝ}^{n×m}$ is the input matrix, ${C}_{d}\in {ℝ}^{p×n}$ is the output matrix and ${D}_{d}\in {ℝ}^{p×m}$ is the direct transmission (feedthrough) matrix. Number of steps of the delay $d$ is the largest integer such that $d.T\le del$, where $T$ is the block execution period.

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).

During the real-time simulation, single simulation step of the above discrete state space model is computed in each execution time instant.

Inputs

 R1 Reset signal. When $\mathtt{\text{R1}}=\mathtt{\text{on}}$, the state vector x is set to its initial value x0. The simulation continues on the falling edge of R1 (on$\to$off). Bool HLD Simulation output holds its value if HLD=on. Bool u1..u16 Simulated system inputs. First $m$ simulation inputs are used where $m$ is the number of columns of the matrix Bd.  $\odot$0.0 Double (F64)

Outputs

 iE Block error code Error 0 .... O.K., the simulation runs correctly -213 . incompatibility of the state space model matrices dimensions xxx .. error code xxx of REXYGEN, see appendix C for details y1..y16 Simulated system outputs. First $p$ simulation outputs are used where $p$ is the number of rows of the matrix Cd. Double (F64)

Parameters

 UD Matrix Dd usage flag. If UD=offthen the Dd matrix is not used for simulation (simulation behaves as if the Dd matrix is zero). Bool del Model time delay [s].  $↓$0.0 $\odot$0.0 Double (F64) Ad Matrix ($n×n$) of the discrete linear system dynamics. Double (F64) Bd Input matrix ($n×m$) of the discrete linear system. Double (F64) Cd Output matrix ($p×n$) of the discrete linear system. Double (F64) Dd Direct transmission (feedthrough) matrix ($p×m$) of the discrete linear system. The matrix is used only if the parameter UD=on. If UD=off, the dimensions of the Dd matrix are not checked. Double (F64) x0 Initial value of the state vector (of dimension $n$) of the discrete linear system. Double (F64)

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