Hybrid Simulation Models for Embedded Applications: A Modelica and eFMI approach
DOI:
https://doi.org/10.3384/ecp218555Keywords:
hybrid modelling, neural network, machine learning, embedded system, Modelica, eFMI, Physics-enhanced Neural ODE, recalibrationAbstract
Hybrid simulation models combine physics equations withtrainable components to improve simulation results andperformance. Physics-enhanced neural ordinary differentialequations (PeN-ODE) are a promising type of hybrid modelsthat combine artificial neural networks (NN) with thedifferential equations of a dynamic system. Dynamicalsimulation models are often part of embedded controlalgorithms of cyber-physical systems (CPS); compliance withthe safety and real-time requirements of such embeddedenvironments is, however, challenging.In this work, we propose a workflow to incorporate trainedNNs in Modelica models to form hybrid simulation modelsthat are PeN-ODEs. We thereby focus on the transformationsteps from equation-based trained PeN-ODEs in Modelicatowards causal solutions suited for the embedded domain --up to and including MISRA C:2023 compliance checks andfinal software-in-the-loop (SiL) tests of generatedproduction code in the modeling environment -- for which weleverage eFMI standard compliant tools (Dymola and SoftwareProduction Engineering). It is of particular interest, howthe trained NNs of the hybrid model are implemented. Wepresent two approaches: (1) generation of C code usingexisting Open Neural Network Exchange (ONNX) tooling and(2) pure Modelica code with the tensor-flow represented asmulti-dimensional equations. Both approaches are discussed,highlighting why (2) is, in the long run, a better optiongiven the eFMI technology space.Downloads
Published
2025-10-24
Issue
Section
Papers
License
Copyright (c) 2025 Tobias Kamp, Christoff Bürger, Johannes Rein, Jonathan Brembeck

This work is licensed under a Creative Commons Attribution 4.0 International License.