This paper presents an approach on how to train a Neural Network model based on a detailed physical Modelica model. The necessary steps to generate training data from simulation will be explained as well as the generation process of a surrogate model. It will be shown, how the surrogate will be re-integrated into the Modelica system model. A benchmark based on accuracy and simulation performance will be performed. The tools used are Modelon Impact, an online modeling and simulation platform, the TensorFlow/Keras toolbox in a Jupyter Notebook which provides a Python-based interface for generating Neural Networks, and the Modelica Neural Network Library that provides functions for constructing Neural Networks within Modelica. The approach is demonstrated on an automotive fuel cell model which is part of an overall vehicle system model. One possible application is to train the neural network via repeated simulations and then to reuse it as an embedded software component for efficiently estimating fuel use and range for various driving cycles and ambient conditions.

Publication: Proceedings of Asian Modelica Conference 2022

Conference: Asian Modelica Conference 2022