Abstract
In this paper we introduce JuliaSim, a high-performance programming environment designed to blend traditional modeling and simulation with machine learning. JuliaSim can build accelerated surrogates from component-based models, such as those conforming to the FMI standard, using continuous-time echo state networks (CTESN). The foundation of this environment, ModelingToolkit.jl, is an acausal modeling language which can compose the trained surrogates as components within its staged compilation process. We demonstrate the effectiveness of the surrogate-accelerated modeling and simulation approach on HVAC dynamics by showing that the CTESN surrogates accurately capture the dynamics of a HVAC cycle at less than 4% error while accelerating its simulation by 340x. We illustrate the use of surrogate acceleration in the design process via global optimization of simulation parameters using the embedded surrogate, yielding a speedup of two orders of magnitude to find the optimum. Together this demonstrates a workflow for automating the integration of machine learning techniques into traditional modeling and simulation processes.
Introduction
In engineering fields such as aerospace, automotive, and HVAC design, "acausal" modeling is the standard for describing complex systems. While powerful, these simulations are often computationally "stiff," meaning they involve processes happening at vastly different timescales. This stiffness makes them incredibly slow to run using traditional numerical solvers. Machine learning (ML) offers a potential solution through "surrogates"—fast ML approximations of slow models. However, traditional ML methods like standard Neural ODEs often become unstable when faced with the stiffness of real-world engineering equations. JuliaSim addresses these challenges by providing a seamless environment for generating and composing high-fidelity surrogates.
Methodology: ML as a Compiler Pass
JuliaSim is built on the foundation of ModelingToolkit.jl (MTK), a symbolic modeling language in Julia. MTK allows the system to treat "surrogatization" as a symbolic transformation. Just as a compiler optimizes code, JuliaSim optimizes a model by replacing a slow set of equations with a fast, trained ML component.
The core innovation is the use of Continuous-Time Echo State Networks (CTESN). Unlike typical neural networks that require complex, iterative training (gradient descent), CTESNs use a "reservoir computing" approach. They project inputs into a high-dimensional space through a fixed, random dynamical system (the reservoir) and then use a stable linear or nonlinear projection to map that to the desired output. This makes training robust and allows the surrogate to handle the stiff mathematics that typically break other AI models.
Experimental Results
The paper evaluates JuliaSim using several benchmarks, most notably a complex Room Air Conditioner (RAC) Model. To provide realistic conditions, the model was tested using Chicago O’Hare TMY3 weather data.
Key results from these evaluations include:
- Massive Speedups: For the HVAC dynamics model, the CTESN surrogate was 340x faster than the original physics-based model while maintaining a relative error of less than 4%.
- Optimization Breakthrough: When performing global optimization to find best design parameters, the surrogate allowed researchers to find the optimum two orders of magnitude faster than using the full model.
- Plug-and-Play Integration: The authors demonstrated "co-simulation," where an ML surrogate was dropped into a loop with other traditional models, proving it can function as a "black box" replacement in existing engineering pipelines.
Conclusion and Future Work
JuliaSim demonstrates a workflow for automating the integration of machine learning techniques into traditional modeling and simulation processes. By treating ML components as composable parts of a larger symbolic system, it overcomes the stiffness and stability issues that have previously hindered AI adoption in engineering.
Future work will focus on automated deployment, allowing users to export these Julia-based surrogates back into industry-standard tools like Dymola or Simulink as Functional Mock-up Units (FMUs). Additionally, the researchers aim to expand the JuliaSim Model Library to include pre-trained surrogates for massive existing libraries in systems biology and other domains.
Summary updated