functionextract
Extract input/output related subsystems from state space system record
Information
Syntax
subsystem = StateSpace.Transformation.extract(ss, outputIndex, inputIndex)
Description
This function computes the subsystem of a state space system corresponding to the indices in outputIndex and inputIndex, i.e.
subsystem.A = ss.A; subsystem.B = ss.B[:, inputIndex]; subsystem.C = ss.C[outputIndex, :]; subsystem.D = ss.D[outputIndex, inputIndex];
Example
Modelica_LinearSystems2.StateSpace ss=Modelica_LinearSystems2.StateSpace(
A=[-1, 1, 2; 0, -2, 3;-3, 2, 1],
B=[1, 0; 0, 1; 1, 0],
C=[1, 1, 0; 0, 1, 1],
D=[0, 0; 0,0]);
Integer outputIndex={1, 2};
Integer inputIndex={2}
algorithm
tss:=Modelica_LinearSystems2.StateSpace.Transformation.extract(ss, outputIndex, inputIndex);
// tss=StateSpace(
A=[-1, 1, 2; 0, -2, 3;-3, 2, 1],
B=[0; 1; 0],
C=[1, 1, 0; 0, 1, 1],
D=[0; 0])
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| StateSpace | ss | State space system | |
| Integer[:] | outputIndex | {1} | Vector of subsystem outputs indices |
| Integer[:] | inputIndex | {1} | Vector of subsystem inputs indices |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| StateSpace | subSc | Subsystem state space record |