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.
1801
1801
@@ -1820,6 +1820,7 @@ The `simplified_sys` has undergone [`structural_simplify`](@ref) and had any occ
1820
1820
- `outputs`: A vector of variables that indicate the outputs of the linearized input-output model.
1821
1821
- `simplify`: Apply simplification in tearing.
1822
1822
- `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.
1823
+
- `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.
1823
1824
- `kwargs`: Are passed on to `find_solvables!`
1824
1825
1825
1826
See also [`linearize`](@ref) which provides a higher-level interface.
@@ -1830,6 +1831,7 @@ function linearization_function(sys::AbstractSystem, inputs,
1830
1831
op =Dict(),
1831
1832
p = DiffEqBase.NullParameters(),
1832
1833
zero_dummy_der =false,
1834
+
initialization_solver_alg =TrustRegion(),
1833
1835
kwargs...)
1834
1836
inputs isa AbstractVector || (inputs = [inputs])
1835
1837
outputs isa AbstractVector || (outputs = [outputs])
@@ -1843,8 +1845,10 @@ function linearization_function(sys::AbstractSystem, inputs,
matrices2, _ = Blocks.get_sensitivity(model, :y; op) # Test that we get the same result when calling the higher-level API
156
+
@test matrices1.f_x ≈ matrices2.A[1:7, 1:7]
157
+
nsys =get_named_sensitivity(model, :y; op) # Test that we get the same result when calling an even higher-level API
158
+
@test matrices2.A ≈ nsys.A
159
+
end
156
160
157
161
# Test the same thing for comp sensitivities
158
162
159
163
Sf, simplified_sys = Blocks.get_comp_sensitivity_function(model, :y) # This should work without providing an operating opint containing a dummy derivative
0 commit comments