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
using ModelingToolkit
using ModelingToolkitStandardLibrary.Blocks
k =ShiftIndex()
@mtkmodel Del begin@extend u, y = siso =SISO()
@structural_parametersbegin
n =1end@equationsbegin
y ~u(k-n)
endend@mtkmodel DiscreteInt begin@extend u, y = siso =SISO()
@variablesbeginx(t) =0.0, [description ="State of Integrator"]
end@equationsbeginx(k) ~x(k-1) +u(k-1)
y ~ x
endend@mtkmodel DelayModel begin@componentsbegin
delay =Del(n =3)
plant =DiscreteInt(x=0)
input =Constant(k =1)
end@equationsbeginconnect(input.output, delay.input)
connect(delay.output, plant.input)
endend@mtkbuild m =DelayModel()
prob =ODEProblem(m, [m.delay.u(k-3)=>0, m.delay.u(k-2)=>0, m.delay.u(k-1)=>0], (0.0, 10.0))
If the example is simplified to
@mtkmodel Del begin@extend u, y = siso =SISO()
@structural_parametersbegin
n =1end@equationsbegin
y ~u(k-n)
endend@mtkmodel DelayModel begin@componentsbegin
delay =Del(n =3)
input =Constant(k =1)
end@equationsbeginconnect(input.output, delay.input)
endend@mtkbuild m =DelayModel()
prob =ODEProblem(m, [m.delay.u(k-3)=>0, m.delay.u(k-2)=>0, m.delay.u(k-1)=>0], (0.0, 10.0))
The initialization does work correctly, even though the simplification removed the system plant = DiscreteInt() rather than the system delay
The text was updated successfully, but these errors were encountered:
The following example fails with
despite
m.delay.u(k-3)=>0
being defined.If the example is simplified to
The initialization does work correctly, even though the simplification removed the system
plant = DiscreteInt()
rather than the systemdelay
The text was updated successfully, but these errors were encountered: