Skip to content

Repository files navigation

BaseModelicaLibraryTesting.jl

Build StatusMSL Test Reports

Experimental Base Modelica library testing based on Julia.

Library Testing

For a given Modelica library test

  1. Base Modelica export (OpenModelica, OMJulia.jl)
  2. Base Modelica parsing (BaseModelica.jl)
  3. ODE simulation (ModelingToolkit.jl, DifferentialEquations.jl)
  4. Validating simulation results

Usage

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.

Example - Testing the Modelica Standard Library v4.1.0

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_ReferenceResults

Run 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.

Changing the ODE Solver

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/

GitHub Actions — Manual MSL Test

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:

  1. Go to Actions → MSL Test & GitHub Pages
  2. Click Run workflow
  3. Fill in the options and click Run workflow

The following inputs are available:

InputDefaultDescription
libraryModelicaModelica library name
lib_version4.1.0Library version to test
bm_versionmainBaseModelica.jl branch, tag, or version
bm_optionsscalarize,moveBindings,inlineFunctionsComma-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)
solverRodas5PAny DifferentialEquations.jl algorithm name (e.g. Rodas5P, Rodas5Pr, FBDF)

Results are published to GitHub Pages under results/<bm_version>/<library>/<lib_version>/.

License

This package is available under the OSMC-PL License and the AGPL-3.0 License. See the OSMC-License.txt file for details.

About

Experimental julia based library test for OpenModelica Base Modelica export and BaseModelica.jl + MTK.jl import.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages