# ModelingToolkit: A Composable Graph Transformation System For Equation-Based Modeling

arXiv: https://arxiv.org/abs/2103.05244 · HTML: https://mlsanity.com/paper/2103.05244/

## Key facts

- Cited by 8 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 9 Mar 2021.

## Built on by (most cited first, 8 of 8)

- [Learning Stable Deep Dynamics Models for Partially Observed or Delayed Dynamical Systems](https://mlsanity.com/paper/2110.14296/) (2021)
- [High-performance symbolic-numerics via multiple dispatch](https://mlsanity.com/paper/2105.03949/) (2021)
- [Effective Latent Differential Equation Models via Attention and Multiple Shooting](https://mlsanity.com/paper/2307.05735/) (2023)
- [Optimal Transport Based Refinement of Physics-Informed Neural Networks](https://mlsanity.com/paper/2105.12307/) (2021)
- [NeuralSI: Structural Parameter Identification in Nonlinear Dynamical Systems](https://mlsanity.com/paper/2208.12771/) (2022)
- [Learnable & Interpretable Model Combination in Dynamical Systems Modeling](https://mlsanity.com/paper/2406.08093/) (2024)
- [The Benefit of Noise-Injection for Dynamic Gray-Box Model Creation](https://mlsanity.com/paper/2310.01517/) (2023)
- [Experimental Design for Missing Physics](https://mlsanity.com/paper/2604.01231/) (2026)

## Abstract (arXiv)

Getting good performance out of numerical equation solvers requires that the user has provided stable and efficient functions representing their model. However, users should not be trusted to write good code. In this manuscript we describe ModelingToolkit (MTK), a symbolic equation-based modeling system which allows for composable transformations to generate stable, efficient, and parallelized model implementations. MTK blurs the lines of traditional symbolic computing by acting directly on a user's numerical code. We show the ability to apply graph algorithms for automatically parallelizing and performing index reduction on code written for differential-algebraic equation (DAE) solvers, "fixing" the performance and stability of the model without requiring any changes to on the user's part. We demonstrate how composable model transformations can be combined with automated data-driven surrogate generation techniques, allowing machine learning methods to generate accelerated approximate models within an acausal modeling framework. These reduced models are shown to outperform the Dymola Modelica compiler on an HVAC model by 590x at 3% error. Together, this demonstrates MTK as a system for bringing the latest research in graph transformations directly to modeling applications.
