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.
1256
1256
@@ -1274,12 +1274,14 @@ The `simplified_sys` has undergone [`structural_simplify`](@ref) and had any occ
1274
1274
- `inputs`: A vector of variables that indicate the inputs of the linearized input-output model.
1275
1275
- `outputs`: A vector of variables that indicate the outputs of the linearized input-output model.
1276
1276
- `simplify`: Apply simplification in tearing.
1277
+
- `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.
1277
1278
- `kwargs`: Are passed on to `find_solvables!`
1278
1279
1279
1280
See also [`linearize`](@ref) which provides a higher-level interface.
@@ -1401,7 +1408,7 @@ function linearize_symbolic(sys::AbstractSystem, inputs,
1401
1408
if!allow_input_derivatives
1402
1409
der_inds =findall(vec(any(!iszero, Bs, dims =1)))
1403
1410
@showtypeof(der_inds)
1404
-
error("Input derivatives appeared in expressions (-g_z\\g_u != 0), the following inputs appeared differentiated: $(ModelingToolkit.inputs(sys)[der_inds]). Call `linear_statespace` with keyword argument `allow_input_derivatives = true` to allow this and have the returned `B` matrix be of double width ($(2nu)), where the last $nu inputs are the derivatives of the first $nu inputs.")
1411
+
error("Input derivatives appeared in expressions (-g_z\\g_u != 0), the following inputs appeared differentiated: $(ModelingToolkit.inputs(sys)[der_inds]). Call `linearize_symbolic` with keyword argument `allow_input_derivatives = true` to allow this and have the returned `B` matrix be of double width ($(2nu)), where the last $nu inputs are the derivatives of the first $nu inputs.")
1405
1412
end
1406
1413
B = [B [zeros(nx, nu); Bs]]
1407
1414
D = [D zeros(ny, nu)]
@@ -1580,7 +1587,7 @@ function linearize(sys, lin_fun; t = 0.0, op = Dict(), allow_input_derivatives =
1580
1587
if!iszero(Bs)
1581
1588
if!allow_input_derivatives
1582
1589
der_inds =findall(vec(any(!=(0), Bs, dims =1)))
1583
-
error("Input derivatives appeared in expressions (-g_z\\g_u != 0), the following inputs appeared differentiated: $(inputs(sys)[der_inds]). Call `linear_statespace` with keyword argument `allow_input_derivatives = true` to allow this and have the returned `B` matrix be of double width ($(2nu)), where the last $nu inputs are the derivatives of the first $nu inputs.")
1590
+
error("Input derivatives appeared in expressions (-g_z\\g_u != 0), the following inputs appeared differentiated: $(inputs(sys)[der_inds]). Call `linearize` with keyword argument `allow_input_derivatives = true` to allow this and have the returned `B` matrix be of double width ($(2nu)), where the last $nu inputs are the derivatives of the first $nu inputs.")
0 commit comments