Valentin Kaisermayer

Results 138 comments of Valentin Kaisermayer

So you want to use the `Sample` and `Hold` operators as boundaries for inference of one or more clocked partitions and the continuous part of the model - as Modelica...

Looks great! 👍 My ideas for this: So if we assume an `ODESystem`, the clocked equations (first two) are excluded (have to be changed) and the variables `yd(t)` and `ud(t)`...

If `x(k)` is the value of `x` at the current time step, I think any `x(k+n)` with `n>0` is not implementable. Modelica only defines the `previous(.)` operator `x = A*previous(x)...

> Did you try using the Difference operator? (Didn't read through all of this) I did not

I will have a look at it. I found https://github.com/SciML/ModelingToolkit.jl/blob/5a47dd69a6c401f3ba53a8d980b4ad860ebdba7f/test/odesystem.jl#L403 and https://github.com/SciML/ModelingToolkit.jl/blob/5a47dd69a6c401f3ba53a8d980b4ad860ebdba7f/test/discretesystem.jl#L14

I have to say the doc string: > Represents a difference operator. at https://github.com/JuliaSymbolics/Symbolics.jl/blob/c2a4e89cc919cd3a6c9e0b19300b9b8d8d03770a/src/difference.jl#L4 Is not very helpful. 😉

What exactly does `Difference(t;dt=0.01)(x) ~ y` mean? Is it `x[t+0.01] = y[t]`?

So i would have to write `Difference(t;dt=0.01)(x) ~ f(t) - x` if I want to set `x` to the value of `f(t)` at some discrete time steps? In other words,...

How should I implement the `Step` block such that the discrete time event is handled correctly? My approach would be to put the RHS (i.e. `offset + IfElse.ifelse(t < start_time,...

> but if you're willing to keep building test cases that would be helpful. Sure! 😄