functiontoDiscreteStateSpace
Convert a DiscreteTransferFunction into a DiscreteStateSpace representation
Information
Syntax
dss = DiscreteTransferFunction.Conversion.toStateSpacetoDiscreteStateSpace(dtf)
Description
Transforms a discrete transfer function into discrete state space representation. There are an infinite number of possible realizations. Here, the transfer function is transformed into controller canonical form, i.e. the transfer function
b4*z^4 + b3*z^3 + b2*z^2 + b1*z + b0
y = -------------------------------------- *u
a4*z^4 + a3*z^3 + a2*z^2 + a1*z + a0
is transformed into:
der(x) = A*x + B*u;
y = C*x + D*u;
with
A = [ 0 , 1 , 0 , 0;
0 , 0 , 1 , 0:
0 , 0 , 0 , 1;
-a0/a4, -a1/a4, -a2/a4, -a3/a4];
B = [ 0;
0;
0;
1/a4];
C = [b0-b4*a0/a4, b1-b4*a1/a4, b2-b4*a2/a4, b3-b4*a3/a4];
D = [b4/a4];
If the numerator polynomial is 1, then the state vector x is built up of the y(k) (the previous y) and of all the nx-1 predecessor (nx is the dimension of the state vector):
x(k+1) = {y(k-n+1), y(k-n+2), ..., y(k)};
Note, the state vector x of Modelica.Blocks.Continuous.TransferFunction is defined slightly differently.
Example
TransferFunction z = Modelica_LinearSystems2.DiscreteTransferFunction.z(); Modelica_LinearSystems2.DiscreteTransferFunction dtf=(z+1)/(z^3 + z^2 + z +1); algorithm dss := Modelica_LinearSystems2.DiscreteTransferFunction.Conversion.toDiscreteStateSpace(dtf); // dss.A = [0, 1, 0; 0, 0, 1; -1, -1, -1], // dss.B = [0; 0; 1], // dss.C = [1, 1, 0], // dss.D = [0],
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| DiscreteTransferFunction | dtf | discrete transfer function of a system |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| DiscreteStateSpace | dss | Discrete state space record |