This repository contains some test cases with simple models/equations to test the FMU export of open modelica. See the issue for some more explanations.
The test models are either quadrature problems or initial value problems. The former are in folders with prefix source
, the latter have the prefix initial_T
. All equations are equipped with an analytical solution.
folder | equationset | solution |
---|---|---|
source_withoutQ |
||
source_withQ |
|
|
initial_T_withQ |
|
solution is of the form |
The inputs are specified in the simulation model SimModel
:
nr | |
---|---|
- | 20t |
1 | 0 |
2 | 10t |
3 | 20+10t |
4 | 20 |
Each folder contains
- a model
TestModel.mo
, which contains the basic equation - simulation models "SimModelX.mo", where X represents the test number for the input. These simulation models are simulated with open modelica
- modelica script
buildFMU.mos
, which builds the FMUs from theTestModel.mo
- modelica script
simulateX.mos
, where X represents the test number for the input. - a python module
reference.py
, which contains the reference solutions and right hand sides for each input
Each test consists of three steps:
- build the FMU
- run the simulation using omc
- compare the modelica solution to the reference solution
- compare the FMU solution (using fmpy) to the reference solution
All tests are run by the main workflow, where the names reflect the folder and index of the input.