NonLinearSystemNeuralNetworkFMU.jl
Generate Neural Networks to replace non-linear systems inside OpenModelica 2.0 FMUs.
Table of Contents
- Training Data Generation
- NonLinearSystemNeuralNetworkFMU.jl
- Main Data Generation Routine
- Profiling Modelica Models
- Train Machine Learning Surrogate
Overview
The package generates an FMU from a modelica file in 3 steps (+ 1 user step):
Find non-linear equation systems to replace.
- Simulate and profile Modelica model with OpenModelica using OMJulia.jl.
- Find slowest equations below given threshold.
- Find depending variables specifying input and output for every non-linear equation system.
- Find min-max ranges for input variables by analyzing the simulation results.
Generate training data.
- Generate 2.0 Model Exchange FMU with OpenModelica.
- Add C interface to evaluate single non-linear equation system without evaluating anything else.
- Re-compile FMU.
- Initialize FMU using FMI.jl.
- Generate training data for each equation system by calling new interface.
Create ONNX (performed by user).
- Use your favorite environment to create a trained Open Neural Network Exchange (ONNX) model.
- Use the generated training data to train artificial neural network.
- Use your favorite environment to create a trained Open Neural Network Exchange (ONNX) model.
Integrate ONNX into FMU.
- Replace equations with ONNX evaluation done by ONNX Runtime in generated C code.
- Re-compile FMU.
- Environment variable ORT_DIR has to be set and point to the ONNX runtime directory (with include/ and lib/ inside).
Installation
See AMIT-HSBI/NonLinearSystemNeuralNetworkFMU.jl README.md for installation instructions.