Looks like a workaround using PeriodicCallback was found back in 2021 but is this still the best way to implement discrete control in MTK? What would that look like for models that compose multiple ODESystems together, some discrete and some continuous, since the callback is set at the ODEProblem or solve() level?
I have a similar model developed with only DifferentialEquations and a PeriodicCallback, but MTK with DiscreteUpdate seems like a much better long term solution.
We’ve been working on and off for the last couple of months adding support for hybrid continuous/discrete systems. The functionality is still not in a usable state and is as a consequence of that not yet documented. You can get a feeling for the current capabilities by looking at this test file, there are a number of increasingly more complicated hybrid systems
Please consider this functionality experimental at this stage, and subject to breaking changes. Here’s a TODO list for things that needs to fall into place before this stuff is properly usable.
Thank you gentlemen for the response! Glad to hear it’s on the radar and being worked. Looks like Sample(t,dt)(f) is the functionality I’m looking for, though it looks like it still needs some work. Perhaps I’ll just consider DiscreteUpdate OBE and update issue #1180 with any findings I have from experimenting with Sample? Or maybe just have patience and let you guys work your magic.