Skip to content

Simulation engines ​

Modex edits models without any engine. To simulate a Modelica model it needs OpenModelica, or — as a beta, in the VS Code extension and in Modex Desktop — your own licensed Dymola. Neither ships with Modex.

OpenModelica ​

Install it with the official installer from openmodelica.org. Modex is tested with OpenModelica 1.27.0. Check that the compiler answers:

bash
omc --version

VS Code ​

Modex looks for omc in this order:

  1. the path you set under Modex: Settings… → OpenModelica Toolchain → Binary (the modex.simulation.omcPath setting);
  2. $OPENMODELICAHOME/bin;
  3. your PATH.

If omc --version works in the environment that launched VS Code, Modex normally finds it with no setting at all. Reload the window after you change the path or its environment. Under WSL, SSH or a container, omc has to be installed in that environment.

If your organization only lets programs run from certain folders, set modex.simulation.workingDirectory in your user settings to one of them and reload the window. Simulations are then compiled and run there, in a subfolder per workspace. Choose a folder outside the ones you edit.

Modex Desktop ​

When no OpenModelica is found, Desktop shows OpenModelica isn’t installed with these choices:

  • Install OpenModelica — downloads the official installer (about 1.6 GB), verifies it, and runs it after one Windows permission prompt. Plan for about 9 GB of disk once installed.
  • Open download page — install it yourself, then choose I've installed it.
  • Set path manually — point Desktop at an existing omc.exe. The same field is under Settings → OpenModelica Toolchain → Binary.

Desktop finds a standard install under Program Files, OPENMODELICAHOME or PATH without help. If it still says not detected right after an install, restart Modex.

Modelica Standard Library ​

Desktop includes one. In VS Code, Modex offers to install it (about 16 MB) the first time a model needs it and none is found. Either way, Settings → Libraries lists the libraries on this machine and installs more from the package index.

Dymola (beta) ​

Modex can run your existing, separately licensed Dymola. Modex does not distribute or license Dymola, and it never reads your licence file: the only check is whether Dymola starts and answers.

Set up

  1. Open Engines in Settings (Modex: Settings… → Engines in VS Code, Settings → Engines in Desktop). If Dymola is not under Configured engines, choose Add an engine and add it from Available engines. Desktop lists it from the start; on a machine without Dymola the row says it was not found, and you can remove it.
  2. On the Dymola page, Installation holds the Dymola executable and, on Windows, the Visual Studio build directory. Modex finds both on its own in most installs: Dymola from the registry or Program Files, the C compiler through the Visual Studio C++ build tools.
  3. Run Test Dymola to confirm it starts and finds a licence.

Choose the engine for a run. Simulation Setup (Modex: Simulation Setup in VS Code, the Simulation Setup button in the model's toolbar in Desktop) has an Engine choice, saved with the model's run settings. A run that names no engine — including one the assistant starts — uses OpenModelica, so Dymola runs only when you choose it. Settings → Engines → New runs → Pre-selected engine decides what a model that has not chosen one starts with.

Dymola is verified on Windows only. Its runs also do not support animation, the debuggers, interactive simulation, FMU export or linearization, and only one Dymola run happens at a time. With a Dymola-encrypted library, Dymola is the engine that can simulate it.

Messages you may see ​

MessageWhat to do
OpenModelica Compiler (omc) not found (VS Code)install OpenModelica, or set OpenModelica Toolchain → Binary, then reload the window
OpenModelica isn’t installed (Desktop)use Install OpenModelica, or Set path manually
No simulation engine is configured. Add one in Settings → Engines.you removed every engine; add one back under Available engines
Dymola needs a C compiler…install the Visual Studio C++ build tools, or set the build directory on the Dymola page
Dymola could not find a licence and exited…make a Dymola licence available on this machine, then Test Dymola again
This protected library class can only be simulated with Dymola… (Desktop)choose Dymola under Engine in Simulation Setup