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
Convert an `ODESystem` to a `NamedStateSpace` using linearization. `inputs, outputs` are vectors of variables determining the inputs and outputs respectively. See docstring of `ModelingToolkit.linearize` for more info on `kwargs`.
61
+
Convert an `System` to a `NamedStateSpace` using linearization. `inputs, outputs` are vectors of variables determining the inputs and outputs respectively. See docstring of `ModelingToolkit.linearize` for more info on `kwargs`.
160
62
161
63
If `descriptor = true` (default), this method automatically converts systems that MTK has failed to produce a proper form for into a proper linear statespace system using the method described here:
@@ -166,7 +68,7 @@ If `descriptor = false`, the system is instead converted to a statespace realiza
166
68
See also [`ModelingToolkit.linearize`](@ref) which is the lower-level function called internally. The functions [`get_named_sensitivity`](@ref), [`get_named_comp_sensitivity`](@ref), [`get_named_looptransfer`](@ref) similarily provide convenient ways to compute sensitivity functions while retaining signal names in the same way as `named_ss`. The corresponding lower-level functions `get_sensitivity`, `get_comp_sensitivity` and `get_looptransfer` are available in ModelingToolkitStandardLibrary.Blocks and are documented in [MTKstdlib: Linear analysis](https://docs.sciml.ai/ModelingToolkitStandardLibrary/stable/API/linear_analysis/).
167
69
"""
168
70
function RobustAndOptimalControl.named_ss(
169
-
sys::ModelingToolkit.AbstractTimeDependentSystem,
71
+
sys::ModelingToolkit.AbstractSystem,
170
72
inputs,
171
73
outputs;
172
74
descriptor =true,
@@ -177,12 +79,12 @@ function RobustAndOptimalControl.named_ss(
177
79
outputs =vcat(outputs)
178
80
179
81
inputs =map(inputs) do inp
180
-
if inp isaODESystem
82
+
if inp isaSystem
181
83
@variablesu(t)
182
84
if u ∈Set(unknowns(inp))
183
85
inp.u
184
86
else
185
-
error("Input $(inp.name) is an ODESystem and not a variable")
87
+
error("Input $(inp.name) is an System and not a variable")
186
88
end
187
89
else
188
90
inp
@@ -191,12 +93,12 @@ function RobustAndOptimalControl.named_ss(
191
93
nu =length(inputs)
192
94
193
95
outputs =map(outputs) do out
194
-
if out isaODESystem
96
+
if out isaSystem
195
97
@variablesu(t)
196
98
if u ∈Set(unknowns(out))
197
99
out.u
198
100
else
199
-
error("Outut $(out.name) is an ODESystem and not a variable")
101
+
error("Outut $(out.name) is an System and not a variable")
200
102
end
201
103
else
202
104
out
@@ -286,19 +188,19 @@ get_named_looptransfer
286
188
287
189
functionnamed_sensitivity_function(
288
190
fun,
289
-
sys::ModelingToolkit.AbstractTimeDependentSystem,
191
+
sys::ModelingToolkit.AbstractSystem,
290
192
inputs, args...;
291
193
kwargs...,
292
194
)
293
195
294
196
inputs =vcat(inputs)
295
197
inputs =map(inputs) do inp
296
-
if inp isaODESystem
198
+
if inp isaSystem
297
199
@variablesu(t)
298
200
if u ∈Set(unknowns(inp))
299
201
inp.u
300
202
else
301
-
error("Input $(inp.name) is an ODESystem and not a variable")
203
+
error("Input $(inp.name) is an System and not a variable")
302
204
end
303
205
else
304
206
inp
@@ -347,7 +249,7 @@ if isdefined(ModelingToolkit, :get_disturbance_system)
For a system that has been linearized, assemble a quadratic cost matrix (for LQR or Kalman filtering) that penalizes states or outputs of simplified system `ssys` according to the vector of pairs `costs`.
353
255
@@ -362,7 +264,7 @@ The second problem above, the ordering of the states, can be worked around using
Assemble a quadratic cost matrix (for LQR or Kalman filtering) that penalizes states or outputs of system `sys` according to the vector of pairs `costs`.
388
290
@@ -397,7 +299,7 @@ The second problem above, the ordering of the states, can be worked around using
397
299
- `inputs`: A vector of variables that are to be considered controlled inputs for the LQR controller.
0 commit comments