Skip to content

Commit 68d6c2a

Browse files
authored
Update Linearization.md
Improve docs for linearization
1 parent 4faa346 commit 68d6c2a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/src/basics/Linearization.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ y &= Cx + Du
1515
\end{aligned}
1616
```
1717

18-
The `linearize` function expects the user to specify the inputs ``u`` and the outputs ``u`` using the syntax shown in the example below:
18+
The `linearize` function expects the user to specify the inputs ``u`` and the outputs ``u`` using the syntax shown in the example below. The system model is *not* supposed to be simplified before calling `linearize`:
1919

2020
## Example
2121

@@ -43,12 +43,15 @@ using ModelingToolkit: inputs, outputs
4343

4444
## Operating point
4545

46-
The operating point to linearize around can be specified with the keyword argument `op` like this: `op = Dict(x => 1, r => 2)`.
46+
The operating point to linearize around can be specified with the keyword argument `op` like this: `op = Dict(x => 1, r => 2)`. The operating point may include specification of state variables, input variables and parameters. For variables that are not specified in `op`, the default value specified in the model will be used if available, if no value is specified, an error is thrown.
4747

4848
## Batch linearization and algebraic variables
4949

5050
If linearization is to be performed around multiple operating points, the simplification of the system has to be carried out a single time only. To facilitate this, the lower-level function [`ModelingToolkit.linearization_function`](@ref) is available. This function further allows you to obtain separate Jacobians for the differential and algebraic parts of the model. For ODE models without algebraic equations, the statespace representation above is available from the output of `linearization_function` as `A, B, C, D = f_x, f_u, h_x, h_u`.
5151

52+
## Symbolic linearization
53+
The function [`ModelingToolkit.linearize_symbolic`](@ref) works simiar to [`ModelingToolkit.linearize`](@ref) but returns symbolic rather than numeric Jacobians. Symbolic linearization have several limitations and no all systems that can be linearized numerically can be linearized symbolically.
54+
5255
## Input derivatives
5356

5457
Physical systems are always *proper*, i.e., they do not differentiate causal inputs. However, ModelingToolkit allows you to model non-proper systems, such as inverse models, and may sometimes fail to find a realization of a proper system on proper form. In these situations, `linearize` may throw an error mentioning
@@ -65,11 +68,14 @@ If the modeled system is actually proper (but MTK failed to find a proper realiz
6568

6669
[ModelingToolkitStandardLibrary](https://docs.sciml.ai/ModelingToolkitStandardLibrary/stable/) contains a set of [tools for more advanced linear analysis](https://docs.sciml.ai/ModelingToolkitStandardLibrary/stable/API/linear_analysis/). These can be used to make it easier to work with and analyze causal models, such as control and signal-processing systems.
6770

71+
## Docstrings
72+
6873
```@index
6974
Pages = ["Linearization.md"]
7075
```
7176

7277
```@docs
7378
linearize
79+
ModelingToolkit.linearize_symbolic
7480
ModelingToolkit.linearization_function
7581
```

0 commit comments

Comments
 (0)