Experimental Base Modelica library testing based on Julia.
For a given Modelica library test
- Base Modelica export (OpenModelica, OMJulia.jl)
- Base Modelica parsing (BaseModelica.jl)
- ODE simulation (ModelingToolkit.jl, DifferentialEquations.jl)
- Validating simulation results
main(
library = "<Modelica library name>",
version = "<Modelica library version>",
filter = "<Modelica class filter>",
omc_exe = "path/to/omc",
ref_root = "path/to/ReferenceResults"
)If reference results are available provide the path via ref_root.
For example, for the Modelica Standard Library v4.1.0 reference results can be obtained by cloning the MAP-LIB_ReferenceResults repository:`
git clone --depth 1 -b v4.1.0 https://github.com/modelica/MAP-LIB_ReferenceResultsRun the library testing for the ChuaCircuit example of the Modelica Standard Library v4.1.0 with:
using BaseModelicaLibraryTesting
main(
library = "Modelica",
version = "4.1.0",
filter = "Modelica.Electrical.Analog.Examples.ChuaCircuit",
omc_exe = "omc",
ref_root = "MAP-LIB_ReferenceResults"
)Preview the generated HTML report at main/Modelica/4.1.0/report.html.
By default the simulation uses Rodas5P(). To switch to a different solver,
call configure_simulate! before main:
using BaseModelicaLibraryTesting
using DifferentialEquations
configure_simulate!(solver = FBDF())
main(
library = "Modelica",
version = "4.1.0",
omc_exe = "omc",
ref_root = "MAP-LIB_ReferenceResults"
)Any SciML-compatible ODE/DAE algorithm (e.g. QNDF(), Rodas4()) can be
passed to solver.
python -m http.server -d results/main/Modelica/4.1.0/The MSL Test & GitHub Pages workflow runs automatically every day at 03:00 UTC. It can also be triggered manually from the GitHub Actions UI:
- Go to Actions → MSL Test & GitHub Pages
- Click Run workflow
- Fill in the options and click Run workflow
The following inputs are available:
| Input | Default | Description |
|---|---|---|
library |
Modelica |
Modelica library name |
lib_version |
4.1.0 |
Library version to test |
bm_version |
main |
BaseModelica.jl branch, tag, or version |
bm_options |
scalarize,moveBindings,inlineFunctions |
Comma-separated --baseModelicaOptions passed to OpenModelica during Base Modelica export |
filter |
^(?!Modelica\.Clocked) |
Julia regex to restrict which models are tested (empty string runs all models) |
solver |
Rodas5P |
Any DifferentialEquations.jl algorithm name (e.g. Rodas5P, Rodas5Pr, FBDF) |
Results are published to GitHub Pages under
results/<bm_version>/<library>/<lib_version>/.
This package is available under the OSMC-PL License and the AGPL-3.0 License. See the OSMC-License.txt file for details.