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`.
160
160
@@ -171,6 +171,8 @@ function RobustAndOptimalControl.named_ss(
171
171
outputs;
172
172
descriptor =true,
173
173
simple_infeigs =true,
174
+
balance = descriptor &&!simple_infeigs, # balance only if descriptor is true and simple_infeigs is false
175
+
big =false,
174
176
kwargs...,
175
177
)
176
178
@@ -210,25 +212,46 @@ function RobustAndOptimalControl.named_ss(
210
212
# This indicates that input derivatives are present
211
213
duinds =findall(any(!iszero, eachcol(matrices.B[:, nu+1:end]))) .+ nu
212
214
u2du = (1:nu) .=> duinds # This maps inputs to their derivatives
If `descriptor = true`, the function `DescriptorSystems.dss2ss` is used. In this case,
249
+
- `balance`: indicates whether to balance the system using `DescriptorSystems.gprescale` before conversion to `StateSpace`. Balancing changes the state realization (through scaling).
250
+
- `simple_infeigs`: if set to false, further simplification may be performed in some cases.
251
+
252
+
If `descriptor = false`, the argument `big = true` performs computations in `BigFloat` precision, useful for poorly scaled systems.
bq >10000&&@warn("The numerical balancing of the system is poor (gbalqual = $bq), consider using `balance=true` to balance the system before conversion to StateSpace to improve accuracy of the result.")
0 commit comments