You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Return a function that linearizes the system `sys`. The function [`linearize`](@ref) provides a higher-level and easier to use interface.
5
5
@@ -22,15 +22,16 @@ The `simplified_sys` has undergone [`structural_simplify`](@ref) and had any occ
22
22
- `sys`: An [`ODESystem`](@ref). This function will automatically apply simplification passes on `sys` and return the resulting `simplified_sys`.
23
23
- `inputs`: A vector of variables that indicate the inputs of the linearized input-output model.
24
24
- `outputs`: A vector of variables that indicate the outputs of the linearized input-output model.
25
+
- `simplify`: Apply simplification in tearing.
25
26
- `initialize`: If true, a check is performed to ensure that the operating point is consistent (satisfies algebraic equations). If the op is not consistent, initialization is performed.
26
27
- `initialization_solver_alg`: A NonlinearSolve algorithm to use for solving for a feasible set of state and algebraic variables that satisfies the specified operating point.
27
28
- `autodiff`: An `ADType` supported by DifferentiationInterface.jl to use for calculating the necessary jacobians. Defaults to using `AutoForwardDiff()`
28
29
- `kwargs`: Are passed on to `find_solvables!`
29
30
30
31
See also [`linearize`](@ref) which provides a higher-level interface.
@@ -45,9 +46,6 @@ function linearization_function(sys::AbstractSystem, inputs = inputs(sys),
45
46
guesses =Dict(),
46
47
warn_empty_op =true,
47
48
kwargs...)
48
-
if!iscomplete(sys)
49
-
error("A simplified `ODESystem` is required. Call `structural_simplify` on the system with the inputs and outputs before creating the linearization function.")
50
-
end
51
49
op =Dict(op)
52
50
ifisempty(op) && warn_empty_op
53
51
@warn"An empty operating point was passed to `linearization_function`. An operating point containing the variables that will be changed in `linearize` should be provided. Disable this warning by passing `warn_empty_op = false`."
@@ -60,7 +58,15 @@ function linearization_function(sys::AbstractSystem, inputs = inputs(sys),
60
58
outputs =mapreduce(vcat, outputs; init = []) do var
Similar to [`linearize`](@ref), but returns symbolic matrices `A,B,C,D` rather than numeric. While `linearize` uses ForwardDiff to perform the linearization, this function uses `Symbolics.jacobian`.
473
479
@@ -484,10 +490,11 @@ y &= h(x, z, u)
484
490
```
485
491
where `x` are differential unknown variables, `z` algebraic variables, `u` inputs and `y` outputs.
0 commit comments