You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Examples from Modelica.Fluids (e.g. PumpingSystem and others) translation error when calling from python #397
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).
I think #274 is more relevant.
The error indicates that linearization failed. If you don't need to linearize your model, you can just remove the related command line options:
Python 3.12.3 (main, Nov 6 2025, 13:44:16) [GCC 13.3.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.20.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from OMPython import ModelicaSystem
In [2]: mod = ModelicaSystem(modelName="Modelica.Fluid.Examples.PumpingSystem", commandLineOptions=[])
[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.
In [3]: mod.simulate()
In [4]:
Activity
ondras12345 commentedon Dec 10, 2025
I think #274 is more relevant.
The error indicates that linearization failed. If you don't need to linearize your model, you can just remove the related command line options:
(Tested with OMPython 4.0.0.)