Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Differences between executable files generated by Dymola and OpenModelica

I am considering to use the executable file generated by either Dymola (dymosim.exe) or OpenModelica (model_name.exe) to make parametric simulations on the same model. I was wondering, is there any difference in the two .exe files and related input files? (which are dsin.txt for Dymola, and model_name_init.xml for OpenModelica).

Regarding file sizes, I can see that the Dymola files are smaller. But I was also wondering about speed of execution and flexibility of the input files for scripting. Lastly, since Dymola is a commercial software, is the dymosim.exe file publicly shareable?

like image 848
Alex Mekx Avatar asked Feb 07 '26 00:02

Alex Mekx


2 Answers

I will write this for OpenModelica, the Dymola people can add their own.

I would suggest to use FMUs instead of executables and some (co)simulation framework like OMSimulator (via Python scripting) or some other ones (PyFMI, etc). See an example here: https://www.openmodelica.org/doc/OMSimulator/master/html/OMSimulatorPython.html#example-pi

Note that if you have resources such as tables, etc, these will be put inside the FMU if you use Modelica URIs: modelica://LibraryName/Resource/blah. However, for the generated executables you would need to ship them with the exe and they would need to be in a specific directory on the other machine. Also, you would need to ship dependent DLLs for the executables for the the FMUs that is (mostly - not true if you have external dlls that you call in your model) not needed as they are statically compiled.

Simulation speed depends on the model sometimes one or the other is faster.

For what libraries are supported by OpenModelica you can check the library coverage: https://libraries.openmodelica.org/branches/overview-combined.html

If you still want to use executables, here is a list of command line parameters for them: https://www.openmodelica.org/doc/OpenModelicaUsersGuide/latest/simulationflags.html

How to do parameter sweeps via executables: https://openmodelica.org/doc/OpenModelicaUsersGuide/latest/scripting_api.html#simulation-parameter-sweep

like image 107
Adrian Pop Avatar answered Feb 15 '26 14:02

Adrian Pop


For Dymola:

If you have the appropriate binary export license you can generate a dymosim.exe that can be distributed.

Parameter-sweep can be run inside Dymola (the scripts are automatically generated), or from Python etc.

However, running a parameter sweep in that way does not only use dsin.txt, but also some additional files. There are two reasons:

  • Reduced overhead of starting/stopping dymosim.exe, especially for small models.
  • Automatic parallelization.

That part of dymosim is currently not well documented in the manual, but you can run:

  • dymosim -M Which as default sweeps based on two csv-files (multIn.csv, multOutHeader.csv) generating a third (multOut.csv)
  • dymosim -M -1 mIn.csv -2 mOutH.csv -3 mOut.csv if you want different file-names
  • dymosim -M -n 45 To generate normal trajectory files, dsres45.mat, dsres46.mat, ...
  • dymosim -h For help
  • dymosim -s Normal simulation
  • And if you are really bold you can pipe to/from dymosim.exe for parameter sweeps

Another possibility is to FMUs instead.

like image 31
Hans Olsson Avatar answered Feb 15 '26 12:02

Hans Olsson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!