Skip to content

Fetch information from IPOPT solver #192

Open

Description

@LukasKoenemann

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')

Activity

  1. adeas31 commented on Dec 2, 2025

    @adeas31
    Member

    There are no plans to implement such a functionality.

    Usually postprocessing is up to the user. You can perhaps attach a logger and read the logged output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions