-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OMPython using different Non Linear Solver than OMEdit, simulation failure #194
Comments
So, I found a quickfix: As I said, the model simulates without problem in OMEdit, so in the simulation setup in the "GeneraI" tab, I checked the options "save translation flags in model" and "save simulation flags in model" and ran it. This added the following annotation to the model file:
When subsequently running from OMPython, the model now simulates successfully. Evidently, there must be some differences between the OMEdit and OMPython defaults for compiling and solving behaviour, which didn't show up to me until now. |
@ibeyers I can see that you have used so many
and this should work in OMPython as well. |
@arun3688 the problem is that when one runs a simulation in OMEdit those flags are somehow taken as default choices - probably OMEdit sets them silently when before calling the translateModel() function. It would be nice to have consistent default throughout the whole suite of tools (OMEdit, OMPython, OMMatlab, OMNotebook, etc.). @adeas31 can you comment on the status with OMEdit? Are those flags silently applied by OMEdit but not part of the OMC defaults? |
It seems something weird is going on with command line parameters. We also see a behaviour difference between OMEdit and OMPython, in that a Model in OMEdit simulates successfully, but using |
Hi,
I have an issue that has me absolutely stumped, any help is appreciated. I have a model, which simulates perfectly in OMEdit, using the default simulation setup (no overrides!), but refuses to simulate when accessing it through OMPython. I think I have managed to locate the issue, but can't solve it.
When simulating in OMEdit, at time=0, the non-linear system is successfully solved by using the mixed solver, as per the log:
Attempting to simulate the same model via OMPython fails, because kinsol is used, which is unable to solve the initialisation problem. Note, I use absolutely no simulation overrides, so really attempting to replicate the exact same simulation. Log output:
I have attempted to force OMPython to use the mixed non-linear solver:
and to lower the density threshold, to force the usage of a different non linear solver:
Both did not change anything, kinsol still ends up being used and the simulation fails. Does anyone know why this is the case? Or why is the solving behaviour so different? I would expect an API to have the same defaults as the program it is trying to access?
Any ideas for a workaround are much appreciated!
Cheers
OpenModelica v1.22.1
OMPython 3.4.0
Python 3.11.7
Spyder IDE 5.4.3
Win 10
The text was updated successfully, but these errors were encountered: