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
Copy file name to clipboardExpand all lines: src/ode_system.jl
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -26,13 +26,15 @@ function ModelingToolkit.System(
26
26
x = ControlSystemsBase.state_names(sys),
27
27
u = ControlSystemsBase.input_names(sys),
28
28
y = ControlSystemsBase.output_names(sys),
29
+
u0 =zeros(sys.nu),
30
+
y0 =zeros(sys.ny),
29
31
)
30
32
ControlSystemsBase.isdiscrete(sys) &&error(
31
33
"Discrete systems not yet supported due to https://github.com/SciML/ModelingToolkit.jl/issues?q=is%3Aopen+is%3Aissue+label%3Adiscrete-time",
32
34
)
33
35
uc = [Blocks.RealInput(; name =Symbol(u)) for u in u]
34
36
yc = [Blocks.RealOutput(; name =Symbol(y)) for y in y]
35
-
@named ssblock = Blocks.StateSpace(ssdata(sys)...; x = x0)
37
+
@named ssblock = Blocks.StateSpace(ssdata(sys)...; x = x0, u0, y0)
36
38
@unpack input, output = ssblock
37
39
systems = [uc; yc; input; output]
38
40
eqs = [
@@ -191,6 +193,7 @@ function causal_simplification(sys, u2duinds::Vector{Pair{Int, Int}}; balance=fa
191
193
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.")
192
194
end
193
195
196
+
# NOTE: the conversion implemented in ss(dss) uses gss2ss due to it's initial call to gir to produce a reduced order model and then an SVD-based alg to improve numerics. Should we use this by default?
0 commit comments