Skip to content
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

Fetch information from IPOPT solver #192

Open
LukasKoenemann opened this issue Dec 2, 2023 · 0 comments
Open

Fetch information from IPOPT solver #192

LukasKoenemann opened this issue Dec 2, 2023 · 0 comments

Comments

@LukasKoenemann
Copy link

I'm currently using ModelicaSystem via OMPython to optimize my modelica model using "Built-in Dynamic Optimization using Annotations". After calling the simulate function I get the simulation results correctly (via mat.file). In addition to that, is it possible to fetch the information of the IPOPT solver (e.g. "No optimal solution found")? Afterwards I want to use the information in the postprocessing of the simulation. If I set the verbosity of the IPOPT-LOG on (-lv=LOG_IPOPT), I can see the output of the IPOPT solver in the prompt. But I want to fetch the information via OMPython.

Steps to Reproduce:

from OMPython import ModelicaSystem
model = ModelicaSystem(...)
model.setSimulationOptions('solver=optimization')
results = {}
for i in range(10):
    resultfile=f"{i}.mat"
    model.setParameters(f'p={i}')
    model.simulate(resultfile=resultfile, simflags='-optimizerNP=1')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant