# How good is the support for hybrid system modelling in MTK?

**URL:** https://discourse.julialang.org/t/how-good-is-the-support-for-hybrid-system-modelling-in-mtk/138499
**Category:** Modelling & Simulations
**Tags:** question, modelling-toolkit
**Created:** [July 27, 2026, 8:40pm UTC](https://discourse.julialang.org/t/how-good-is-the-support-for-hybrid-system-modelling-in-mtk/138499 "2026-07-27T20:40:11Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)
#### Post date: [July 27, 2026, 8:40pm UTC](https://discourse.julialang.org/t/how-good-is-the-support-for-hybrid-system-modelling-in-mtk/138499/1 "2026-07-27T20:40:12Z")

</div>

How good is the support of modeling hybrid systems with MTK in the summer of 2026?

It used to be incomplete/ buggy for a long time. Did this change?

I am looking at the control of electrical machines. The controller can be outside of MTK, but it would be nice if not only the model, but also the observer could be modeled in MTK. See, for example: [IM\_AWES\_bench.jl/src/estimators/rotor\_flux\_observer\_discrete.jl at main · c-nicomar/IM\_AWES\_bench.jl · GitHub](https://github.com/c-nicomar/IM_AWES_bench.jl/blob/main/src/estimators/rotor_flux_observer_discrete.jl)

---

<div class="post-metadata">

### Author: ![zdenek\_hurak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zdenek_hurak/32/53118_2.png) [@zdenek\_hurak](https://discourse.julialang.org/u/zdenek_hurak)
#### Post date: [July 27, 2026, 9:59pm UTC](https://discourse.julialang.org/t/how-good-is-the-support-for-hybrid-system-modelling-in-mtk/138499/2 "2026-07-27T21:59:42Z")

</div>

What do you mean by hybrid system modelling? Just having both continuous-time dynamics (modelled by ODEs) and periodic sampling in one model (aka sampled-data systems)? I noticed that this is what some people regard as a hybrid system. Or do you need aperiodic, perhaps event-driven sampling? Or do you mean hybrid automata defined by modes, flows, guards, invariants and resets (in the spirit of Stateflow charts)? Or yet something else?

---

<div class="post-metadata">

### Author: ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)
#### Post date: [July 27, 2026, 10:08pm UTC](https://discourse.julialang.org/t/how-good-is-the-support-for-hybrid-system-modelling-in-mtk/138499/3 "2026-07-27T22:08:09Z")

</div>

Just discrete and continuous time, like in Simulink. A discrete-time observer and Kalman filter, and a continuous-time machine model.

---

<div class="post-metadata">

### Author: ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)
#### Post date: [July 28, 2026, 4:47am UTC](https://discourse.julialang.org/t/how-good-is-the-support-for-hybrid-system-modelling-in-mtk/138499/4 "2026-07-28T04:47:42Z")

</div>

It will be presented during this talk at juliacon

> **[From graphical block diagram to juliac executable JuliaCon 2026](https://pretalx.com/juliacon-2026/talk/XXLRUE/)**
>
> We present an update on the synchronous programming capabilities in the Dyad modeling language. A synchronous program (discrete-time dynamical system), can now be implemented in a graphical block-diagram editor together with an acausal model of a...

---

<div class="post-metadata">

### Author: ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)
#### Post date: [July 28, 2026, 12:42pm UTC](https://discourse.julialang.org/t/how-good-is-the-support-for-hybrid-system-modelling-in-mtk/138499/5 "2026-07-28T12:42:46Z")

</div>

Here’s a little teaser of the rotor flux observer from the first post, implemented as a synchronous dyad system. The model is completely auto generated, so the diagrams might not look the way they would have done if manually touched up.

When looking at the diagrams, the html files are easiest to navigate, but they exist as png files as well. One can of course open the models themselves in dyad as well if you have that installed.

`generated/top.c` shows the generated C code.

> **[rotor-flux-observer-dyad.zip](https://drive.google.com/file/d/1X-CYguvbguk-SNi25kKUPDuHJ_9H8uXn/view?usp=sharing)**
>
> Google Drive file.

All of this is not released yet, so you can not reproduce it yourself quite yet.
