OMPython icon indicating copy to clipboard operation
OMPython copied to clipboard

Examples from Modelica.Fluids (e.g. PumpingSystem and others) translation error when calling from python

Open Ulfsen opened this issue 2 months ago • 1 comments

Description

When I start Modelica.Fluid.Examples.PumpingSystem and other ((Fluid.Examples.Tanks.ThreeTanks, Fluid.Examples.Tanks.TanksWithOverflow, Fluid.Examples.Tanks.EmptyTanks) from OmEdit it simulates, but when I call the same model from python, I get an error:

`[OMC log for 'sendExpression(buildModel(Modelica.Fluid.Examples.PumpingSystem, variableFilter="."), True)']: [symbolic:warning:7017] The model contains alias variables with redundant start and/or conflicting nominal values. It is recommended to resolve the conflicts, because otherwise the system could be hard to solve. To print the conflicting alias sets and the chosen candidates please use -d=aliasConflicts. ... OMPython.OMCSession.OMCSessionException: [OMC log for 'sendExpression(buildModel(Modelica.Fluid.Examples.PumpingSystem, variableFilter="."), True)']: [translation:error:7024] Jacobian A contains non-linear components. This indicates a singular system or internal generation errors.

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "mnt/c/test.py", line 12, in mod = ModelicaSystem(modelName="Modelica.Fluid.Examples.PumpingSystem") File "/mnt/c/venv_wsl/lib/python3.14/site-packages/OMPython/ModelicaSystem.py", line 468, in init self.buildModel(variableFilter) ~~~~~~~^^^^^^^^^^^^^^^^ File "/mnt/c/venv_wsl/lib/python3.14/site-packages/OMPython/ModelicaSystem.py", line 546, in buildModel buildModelResult = self._requestApi(apiName="buildModel", entity=self._model_name, properties=var_filter) File "/mnt/c/venv_wsl/lib/python3.14/site-packages/OMPython/ModelicaSystem.py", line 579, in _requestApi return self.sendExpression(exp) ~~~~~~~~~~~~~^^^^^ File "/mnt/c/venv_wsl/lib/python3.14/site-packages/OMPython/ModelicaSystem.py", line 556, in sendExpression raise ModelicaSystemError(f"Error executing {repr(expr)}") from ex OMPython.ModelicaSystem.ModelicaSystemError: Error executing 'buildModel(Modelica.Fluid.Examples.PumpingSystem, variableFilter=".*")'`

Steps to Reproduce

Install a python environment with OMPython an run the following python code: import sys from OMPython import OMCSessionZMQ from OMPython import ModelicaSystem omc = OMCSessionZMQ() mod = ModelicaSystem(modelName="Modelica.Fluid.Examples.PumpingSystem") mod.simulate()

Expected Behavior

The model should simulate when called from python.

Version and OS

Tested with nightly 1.26 (in wsl) and 1.25.3 native on windows with different python-versions (3.12 and 3.14).

Additional Informations

Possibly duplicate or related to #283

Ulfsen avatar Dec 09 '25 19:12 Ulfsen