blockStateSpace
Discrete-time State Space block
Extends from Clocked.RealSignals.Interfaces.PartialClockedMIMO (Block with multiple clocked input and multiple clocked output Real signals).
Information
This block defines the state space representation of a discrete-time block with input vector u, output vector y and state vector x:
x = A * previous(x) + B * u y = C * previous(x) + D * u
where previous(x) is the value of the clocked state x at the previous clock tick. The input is a vector of length nu, the output is a vector of length ny and nx is the number of states. Accordingly
A has the dimension: A(nx,nx), B has the dimension: B(nx,nu), C has the dimension: C(ny,nx), D has the dimension: D(ny,nu)
Example:
parameter: A = [0.12, 2;3, 1.5]
parameter: B = [2, 7;3, 1]
parameter: C = [0.1, 2]
parameter: D = zeros(ny,nu)
results in the following equations:
[x[1]] [0.12 2.00] [previous(x[1])] [2.0 7.0] [u[1]]
[ ] = [ ]*[ ] + [ ]*[ ]
[x[2]] [3.00 1.50] [previous(x[2])] [0.1 2.0] [u[2]]
[previous(x[1])] [u[1]]
y[1] = [0.1 2.0] * [ ] + [0 0] * [ ]
[previous(x[2])] [u[2]]
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Real[:,size(A, 1)] | A | Matrix A of state space model | |
| Real[size(A, 1),:] | B | Matrix B of state space model | |
| Real[:,size(A, 1)] | C | Matrix C of state space model | |
| Real[size(C, 1),size(B, 2)] | D | zeros(size(C, 1), size(B, 2)) | Matrix D of state space model |
| Integer | nin (from PartialClockedMIMO) | 1 | Number of inputs |
| Integer | nout (from PartialClockedMIMO) | 1 | Number of outputs |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Blocks.Interfaces.RealInput[nin] | u (from PartialClockedMIMO) | Connector of clocked, Real input signals | |
| Modelica.Blocks.Interfaces.RealOutput[nout] | y (from PartialClockedMIMO) | Connector of clocked, Real output signals |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Real[size(A, 1)] | x | State vector |
Revisions
Release Notes:
- August 13, 2012
by Bernhard Thiele:
Used the code from Blocks.Discrete.StateSpace and converted it into the Modelica 3.3 clocked equation style.