JuliaCon 2025

Synchronous Systems in ModelingToolkit
2025-07-24 , Main Room 4

Discrete models and control systems go hand in hand with continuous-time controls: many physical systems show state-dependent or discrete behavior such as clutches or friction, while realizable digital control systems are intrinsically discrete time. We describe the integration of synchronous systems - systems that execute in discrete steps on clocks or events - with ModelingToolkit to provide easy and compositional handling of discrete systems in high-level models.


ModelingToolkit makes the development of continuous-time models easy. However, many practical applications require adding discrete behavior to the continuous-time model such as friction (stuck vs. un-stuck) or clutches (open, closing, or closed). Similarly, digital control systems are intrinsically periodic and discrete. Capturing this discrete behavior in ModelingToolkit is primarily done with imperative affects and manually-written functions, which offers little compositionality and makes reuse of components across projects hard.

We describe the integration of synchronous systems into ModelingToolkit, building of off of systems such as Lustre and Lucid Synchrone, allowing discrete behaviour to be described as algebraic clocked discrete-time components. Synchronous components can be composed using connectors or invocations - much like the existing continuous-time components - and are compiled to efficient imperative code. Synchronous programming allows the easy development of compositional discrete-time systems as both standalone systems or into continuous-time models in ModelingToolkit.

Benjamin Chung is a modeling & simulation consultant with JuliaHub. Previously, he was a postdoc at the University of Washington with Behcet Acikmese working on aerospace trajectory optimization after finishing his PhD with Jan Vitek on type systems for Julia.

This speaker also appears in: