functionsubtract
Subtraction of two state space systems connected in parallel (= inputs are the same, outputs of the two systems are subtracted)
Information
Syntax
dss = DiscreteStateSpace.'-'.subtract(dss1, dss2)
Description
This operator function computes the subtraction of two discrete state space systems connected in parallel, i.e. the inputs are the same and the outputs of the two systems are subtracted. Therefore, The systems must have the same number of inputs and outputs but not the same number of states. The resulting system has an order of system_order1 + system_order2.
The operator is used by writing just the following command:
dss3 := dss1 - dss2;
Example
DiscreteStateSpace dss1 = DiscreteStateSpace(A=[-1, 0; 0, -2], B=[1;2], C=[0, 1], D=[0]); DiscreteStateSpace dss2 = DiscreteStateSpace(A=[-3, 0; 0, -4], B=[3;4], C=[0, 2], D=[0]); DiscreteStateSpace dss3; algorithm dss3 := dss1 - dss2; // dss.A = [-1, 0, 0, 0; 0, -2, 0, 0; 0, 0, -3, 0; 0, 0, 0, -4], // dss.B = [1; 2; 3; 4], // dss.C = [0, 1, 0, -2], // dss.D = [0], // dss.B2 = [0; 0; 0; 0],
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| DiscreteStateSpace | dss1 | State space system 1 | |
| DiscreteStateSpace | dss2 | State Space system 2 is subtracted from system 1 |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| DiscreteStateSpace | result | = dss1 - dss2 |