Skip to content

Commit a5597f3

Browse files
committed
improve docstring of linearize fun
1 parent e5f0245 commit a5597f3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/systems/abstractsystem.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -970,15 +970,15 @@ end
970970
"""
971971
lin_fun, simplified_sys = linearization_function(sys::AbstractSystem, inputs, outputs; simplify = false, kwargs...)
972972
973-
Return a function that linearizes system `sys`.
973+
Return a function that linearizes system `sys`. The function [`linearize`](@ref) provides a higher-level and easier to use interface.
974974
975-
`lin_fun` is a function `(u,p,t) -> (; f_x, f_z, g_x, g_z, f_u, g_u, h_x, h_z, h_u)`, i.e., it returns a NamedTuple with the Jacobians of `f,g,h` for the nonlinear `sys` on the form
975+
`lin_fun` is a function `(variables, p, t) -> (; f_x, f_z, g_x, g_z, f_u, g_u, h_x, h_z, h_u)`, i.e., it returns a NamedTuple with the Jacobians of `f,g,h` for the nonlinear `sys` (technically for `simplified_sys`) on the form
976976
```math
977977
ẋ = f(x, z, u)
978978
0 = g(x, z, u)
979979
y = h(x, z, u)
980980
```
981-
where `x` are differential states, `z` algebraic states, `u` inputs and `y` outputs. To obtain a linear statespace representation, see [`linearize`](@ref).
981+
where `x` are differential states, `z` algebraic states, `u` inputs and `y` outputs. To obtain a linear statespace representation, see [`linearize`](@ref). The input argument `variables` is a vector defining the operating point, corresponding to `states(simplified_sys)` and `p` is a vector corresponding to the parameters of `simplified_sys`. Note: all variables in `inputs` have been converted to parameters in `simplified_sys`.
982982
983983
The `simplified_sys` has undergone [`structural_simplify`](@ref) and had any occurring input or output variables replaced with the variables provided in arguments `inputs` and `outputs`. The states of this system also indicates the order of the states that holds for the linearized matrices.
984984
@@ -1081,10 +1081,10 @@ function markio!(state, inputs, outputs)
10811081
end
10821082
end
10831083
all(values(inputset)) ||
1084-
error("Some specified inputs were not found in system. The following Dict indicates the found variables",
1084+
error("Some specified inputs were not found in system. The following Dict indicates the found variables ",
10851085
inputset)
10861086
all(values(outputset)) ||
1087-
error("Some specified outputs were not found in system. The following Dict indicates the found variables",
1087+
error("Some specified outputs were not found in system. The following Dict indicates the found variables ",
10881088
outputset)
10891089
state
10901090
end
@@ -1129,7 +1129,7 @@ This example builds the following feedback interconnection and linearizes it fro
11291129
│ │
11301130
└─────────────────────┘
11311131
```
1132-
```
1132+
```julia
11331133
using ModelingToolkit
11341134
@variables t
11351135
function plant(; name)

0 commit comments

Comments
 (0)