ModelingToolkit.jl icon indicating copy to clipboard operation
ModelingToolkit.jl copied to clipboard

Support for simulation of hybrid systems

Open ufechner7 opened this issue 1 year ago • 2 comments

** What is the status of the support for the simulation of hybrid systems? **

I have a continues time plant, and use discrete time callbacks to implement a discrete time controller. While this works, it is not straightforward. For example I cannot add discrete time variables to the state and plot them.

Questions:

  • is the current best way to implement hybrid systems documented?
  • are any improvements to be expected in the near future?

ufechner7 avatar Jan 10 '24 18:01 ufechner7

Related: https://github.com/SciML/ModelingToolkit.jl/issues/894

and https://discourse.julialang.org/t/diffeqs-hybrid-continuous-discrete-system-periodic-callback/23791/38

ufechner7 avatar Jan 11 '24 03:01 ufechner7

Work in progress, see https://github.com/SciML/ModelingToolkit.jl/pull/2410

baggepinnen avatar Jan 11 '24 05:01 baggepinnen

See the discussion in https://github.com/SciML/ModelingToolkit.jl/issues/2482 for how this is evolving with the MTK v9, and the PR https://github.com/SciML/ModelingToolkit.jl/pull/2410 which then adds the documentation for the new clocking system. With that, we should have a pretty complete set of functionality for discrete-continuous.

Closing as I think that covers the full question.

ChrisRackauckas avatar Feb 22 '24 12:02 ChrisRackauckas