ModelingToolkit.jl is a high-performance modeling framework in Julia that integrates symbolic and numeric computations, to meet the needs of scientific computing and scientific machine learning. It combines elements from symbolic computational algebra systems with both causal and acausal equation-based modeling paradigms, offering an extensible and parallelizable environment for complex system modeling.
One of the key benefits of this framework is that it lets users give a high-level description of a model for symbolic preprocessing to analyze and enhance the model. Unlike proprietary software, it is open source, allowing users to extend and modify the software interactively in the REPL and contribute to its open-source repositories.
Why ModelingToolkit.jl?
Built in Julia, Modellingtoolkit.jl combines symbolic computing with equation-based modeling, to offer a powerful and flexible approach to scientific computing. By combining the strengths of symbolic algebra systems like SymPy and Mathematica with the structured modeling paradigms of tools like Simulink (causal) and Modelica (acausal), it enables a unified and composable workflow.
The framework bridges the gap between different mathematical representations, allowing users to transform differential-algebraic equations (DAEs) into optimization problems, perform symbolic simplifications, and parallelize computations before generating highly efficient code. With built-in support for model validation, automatic differentiation, and structural transformations, ModelingToolkit.jl enhances both performance and usability, making it a key tool for accelerating complex simulations, control system design, and scientific machine learning.
Key Features of ModelingToolkit.jl
- Symbolic-Numeric Integration: Allows users to define models at a high level, enabling symbolic preprocessing to analyze and optimize the model before numerical simulation.
- Automatic Function Generation: Generates efficient functions for model components, such as Jacobians and Hessians, and applies automatic sparsification and parallelization to enhance computational performance.
- Model Transformations: Performs automatic transformations, like index reduction of differential-algebraic equations, facilitating the solution of equations that are challenging for purely numeric methods.
- Composability: Supports the composition of symbolic models, allowing for the construction of large-scale models from reusable components. This lazy composition approach is instantiated during conversion to numerical models, optimizing both computation time and memory usage.
- Event Handling: Provides mechanisms to represent system events, enabling state or parameter changes when specific conditions are met, and aids in detecting discontinuities within the system.
ModelingToolkit.jl: A Next-Generation Framework for Scientific Computing
Unlike traditional modeling languages, which often require users to work within rigid, proprietary ecosystems, ModelingToolkit.jl offers an open, flexible, and modular approach.
Traditional equation-based modeling tools often obscure the transformations performed on models, leading to a lack of transparency and flexibility. In contrast, ModelingToolkit.jl gives users complete control over model transformations, optimizations, and parallelization, allowing for faster and more scalable simulations. It enables seamless conversion of differential-algebraic equations (DAEs) into optimization problems, structural simplifications, and efficient numerical execution—all while leveraging Julia’s high-performance computing capabilities.
Industrial Use Cases
ModelingToolkit.jl is widely used across industries for applications requiring high-fidelity simulations and real-time decision-making. For example:
- Instron (Materials Testing): Optimizing control algorithms and system simulations for precision testing equipment.
Instron leveraged ModelingToolkit.jl and JuliaSim to revolutionize crash simulation modeling, achieving a 500x speedup in design workflows. Previously constrained by slow, difficult-to-maintain models and third-party software limitations, Instron transitioned to Julia’s ecosystem, enabling faster, more accurate simulations. This breakthrough made controller optimization feasible, reducing months of runtime to hours and leading to the development of a simpler, lower-cost "Catapult Light" system. By eliminating complexity while maintaining high performance, Instron unlocked new testing capabilities, demonstrating the power of acausal modeling and Julia’s symbolic computing advantages.
- Aerospace & Automotive: High-performance modeling of fluid dynamics, control systems, and multi-body simulations.
ModelingToolkit.jl enhances EV system design by enabling millisecond-scale simulation of complex thermal management systems like the Vapor Compression Cycle (VCC) with moist air. In a recent industry use case, JuliaSim’s pre-built components and data-fitting techniques were used to accelerate system-level validation and design, significantly reducing development time for next-generation electric vehicles. By exporting the system model as an FMU, engineers achieved a 40x speedup over baseline models, enabling rapid iteration and optimization—a game-changer for EV performance and efficiency
- Pharmaceuticals & Biotech: Accelerating drug discovery by modeling complex biological and chemical reaction networks.
- Energy & Power Systems: Real-time optimization of grid dynamics and renewable energy forecasting.
A leading renewable energy company leveraged JuliaSim to modernize its 2D simulation code, transitioning from C to a more efficient and readable ModelingToolkit.jl framework. This transformation reduced the code base by 10x, while preserving equation structure and improving human readability, leading to the identification of errors in the original source code. The shift also resulted in significant simulation speedups and successfully demonstrated the use of precompiled MethodOfLines models, paving the way for high-performance PDE simulations written in natural ModelingToolkit.jl syntax.
Key Advantages Over Market Alternatives
- Composability & Modularity: Unlike traditional equation-based tools, which have limited extensibility, ModelingToolkit.jl allows users to create custom transformations, making it adaptable for a wide range of applications.
- Performance Optimization: Users can simplify, sparsify, and parallelize symbolic representations before executing numerical simulations, leading to significant speedups—NASA’s Launch Services Program reported a 15,000x acceleration in switching to ModelingToolkit.jl.
- Open & Interoperable: While traditional models often require proprietary compilers, ModelingToolkit.jl is built on an open ecosystem, enabling easy integration with other Julia-based tools like Symbolics.jl, DifferentialEquations.jl, and JuliaSim.
- Scalability & Future-Proofing: Designed for both research and industrial use, it provides a transparent and extensible infrastructure, empowering users to innovate beyond what traditional tools allow.
By democratizing model transformation and optimization, ModelingToolkit.jl is setting a new standard in scientific computing, bridging the gap between symbolic modeling, numerical simulation, and industrial-scale deployment.
Getting Started with ModelingToolkit.jl
To begin using ModelingToolkit.jl, install it via the Julia package manager in your Julia environment, then explore the fundamentals like defining variables, equations, and creating an ODE system through the provided functions, and solve and analyze the model using the relevant solvers.
For a comprehensive introduction, refer to the Getting Started with ModelingToolkit.jl tutorial.
To sum it up, ModelingToolkit.jl solves the long-standing challenges of scalability, transparency, and efficiency in model-based simulations. By seamlessly combining symbolic computing with numerical methods, it empowers engineers and researchers to build, optimize, and simulate complex systems with unprecedented speed and accuracy. Whether in automotive crash testing, aerospace engineering, pharmaceutical research, or energy optimization, ModelingToolkit.jl is accelerating innovation across industries. Interested to learn how to leverage ModelingToolkit.jl for your specific use case? Reach out to our solutions experts.