2024-07-12 –, While Loop (4.2)
Computer algorithms interacting with the physical world around them give rise to what is referred to as a sampled-data system, a system with both parts that evolve continuously in time and processes that have a discrete time evolution. In this talk, we detail a new tool for modeling and simulation of such systems.
Computers are inherently discrete, both in terms of how they represent numbers and in how they perform computations over time and thus update their state. Computers interacting with the environment often do so in an interval-based or event-based fashion, i.e., they compute and communicate in response to either an event or the tick of a clock. Examples of sampled-data systems include control systems, like the autopilot in an airplane, and digital signal-processing pipelines, like the acoustic noise-cancellation feature in a pair of headphones.
Sampled-data systems occurring in complex engineering systems, like an airplane or a factory, may contain several distinct discrete-time partitions, each operating in response to its own event source, e.g., using different sample rates. Examples include hierarchical control systems such as a heat pump, where a fast “inner” controller operates the compressor at 1000Hz, while a slower “outer” controller provides commands to the compressor once every minute in order to maintain the desired temperature etc.
Accurate analysis of such systems require simulation tools that can handle their mixed continuous-discrete nature. Differential-equation solvers often include mechanisms that allow simulation of sampled-data systems. However, manually modeling large such systems becomes intractable without support of a modeling tool. ModelingToolkit has proven a competent tool for the modeling of continuous-time systems, and here, we detail new capabilities to also model discrete-time processes.
The extension of ModelingToolkit developed to support sampled-data systems introduces the notion of a clock, the source of events that triggers the execution of a discrete time partition. A model may contain one or several clocks operating at different periodic or aperiodic rates. Upon the tick of a clock, all associated discrete-time partitions are executed and the variables governing their interaction with the continuous-time world are updated. The interaction between discrete and continuous partitions is governed by new operators, such as sample
and hold
. The ability of ModelingToolkit to generate separate code for discrete-time partitions is also added to facilitate deployment of control algorithms onto a different computing platform.
I received my MSc and PhD 2019 from the Dept. Automatic Control in Lund, Sweden, working within the fields of control, machine learning and robotics. I have since spent a year with the Acoustic Research Laboratory at NUS and subsequently made the transition to industry, working with dynamic modeling, control and programming-language design in a robotics context. I am now working with JuliaHub on software tools for acausal modeling, simulation, optimization and control in the Julia programming language.