@@ -25,7 +25,7 @@ function ModelingToolkit.ODESystem(
2525 u_names = sys. nu == 1 ? [:u ] : [Symbol (" u$i " ) for i = 1 : sys. nu],
2626 y_names = sys. ny == 1 ? [:y ] : [Symbol (" y$i " ) for i = 1 : sys. ny],
2727)
28- ControlSystems . isdiscrete (sys) && error (
28+ ControlSystemsBase . isdiscrete (sys) && error (
2929 " Discrete systems not yet supported due to https://github.com/SciML/ModelingToolkit.jl/issues?q=is%3Aopen+is%3Aissue+label%3Adiscrete-time" ,
3030 )
3131 A, B, C, D = ssdata (sys)
@@ -107,14 +107,14 @@ function sconnect(
107107end
108108
109109"""
110- G = ControlSystems .feedback(loopgain::T; name)
110+ G = ControlSystemsBase .feedback(loopgain::T; name)
111111
112112Form the feedback-interconnection
113113\$ G = L/(1+L)\$
114114
115115The system `G` will be a new system with `input` and `output` connectors.
116116"""
117- function ControlSystems . feedback (
117+ function ControlSystemsBase . feedback (
118118 loopgain:: T ;
119119 name = Symbol (" feedback $(loopgain. name) " ),
120120) where {T<: ModelingToolkit.AbstractTimeDependentSystem }
154154numeric (x:: Num ) = x. val
155155
156156
157- function ControlSystems . ss (
157+ function ControlSystemsBase . ss (
158158 sys:: ModelingToolkit.AbstractTimeDependentSystem ,
159159 inputs,
160160 outputs,
@@ -205,10 +205,15 @@ function RobustAndOptimalControl.named_ss(
205205 end
206206 matrices, ssys = ModelingToolkit. linearize (sys, inputs, outputs; kwargs... )
207207 symstr (x) = Symbol (string (x))
208+ unames = symstr .(inputs)
209+ if size (matrices. B, 2 ) == 2 length (inputs)
210+ # This indicates that input derivatives are present
211+ unames = [unames; Symbol .(" der_" .* string .(unames))]
212+ end
208213 named_ss (
209214 ss (matrices... );
210215 x = symstr .(states (ssys)),
211- u = symstr .(inputs) ,
216+ u = unames ,
212217 y = symstr .(outputs),
213218 )
214219end
0 commit comments