Skip to content

Commit 3b93621

Browse files
committed
add internals details to readme
1 parent 9b4a480 commit 3b93621

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,27 @@ ModelingToolkit tends to give weird names to states etc., to access variables ea
100100
julia> P02_named.x
101101
1-element Vector{Symbol}:
102102
Symbol("x[1](t)")
103-
```
103+
```
104+
105+
106+
### Internals: Transformation of non-proper models to proper statespace form
107+
For some models, ModelingToolkit will fail to produce a proper statespace model (a non-proper model is differentiating the inputs, i.e., it has a numerator degree higher than the denominator degree if represented as a transfer function) when calling `linearize`. For such models, given on the form
108+
$$
109+
\dot x = Ax + Bu + \bar B \dot u
110+
$$
111+
we create the following augmented descriptor model
112+
$$
113+
\begin{aligned}
114+
sX &= Ax + BU + s\bar B U \\
115+
[X_u = U]\\
116+
s(X - \bar B X_u) = AX + BU \leftrightarrow \\
117+
s \begin{bmatrix}I & -\bar B \\ 0 & 0 \end{bmatrix} =
118+
\begin{bmatrix} A & 0 \\ 0 & -I\end{bmatrix}
119+
\begin{bmatrix}X \\ X_u \end{bmatrix} +
120+
\begin{bmatrix} B \\ I_u\end{bmatrix} U
121+
\end{aligned}
122+
$$
123+
where $X_u$ is a new algebraic state variable and $I_u$ is a selector matrix that picks out the differentiated inputs appearing in $\dot u$ (if all inputs appear, $I_u = I$).
124+
125+
This model may be converted to a proper statespace model (if the system is indeed proper) using `DescriptorSystems.dss2ss`.
126+
All of this is handled automatically by `named_ss(sys)`.

0 commit comments

Comments
 (0)