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
It would be nice to have some way of constructing discrete-time systems using a model macro. @mtkmodel currently only creates ODESystems.
It could be either a new macro, or a kwarg to the existing one.
Example (not working)
using ModelingToolkit
t = ModelingToolkit.t_nounits
k =ShiftIndex(t)
@mtkmodel Float2Bool begin@variablesbeginu(t)::Float64y(t)::Boolend@equationsbegin
y ~ u !=0endend@mtkmodel Model begin@variablesbeginx(t) =0end@componentsbegin
conversion =Float2Bool()
end@equationsbeginx(k) ~0.99x(k-1)
conversion.u ~ x
endend@named model =Model()
prob =DiscreteProblem(sys, [], (0,10))
The text was updated successfully, but these errors were encountered:
It would be nice to have some way of constructing discrete-time systems using a model macro.
@mtkmodel
currently only createsODESystem
s.It could be either a new macro, or a kwarg to the existing one.
Example (not working)
The text was updated successfully, but these errors were encountered: