Extracting Number of iterations for IPOPT

32 views
Skip to first unread message

Ashlesha Tiple

unread,
Mar 17, 2022, 11:41:35 AM3/17/22
to Pyomo Forum
Hello everyone,
I am trying to compare few models based on the number of iterations it required to get the optimal solution. How do I extract the number of iterations from the IPOPT solver?
Thank you

a-jp

unread,
Mar 25, 2022, 8:04:49 AM3/25/22
to Pyomo Forum
I'd really like to know this too

Michael Bynum

unread,
Mar 25, 2022, 9:02:29 AM3/25/22
to Pyomo Forum
There are a couple ways to do this. Unfortunately, neither is trivial. One way to do this would be to parse the log file. You can access the log file by specifying the name of the log file in the call to solve: results = solver.solve(model, logfile='ipopt_output.log'). You can then open this log file and parse it to get the number of iterations. Alternatively, you could use the interface to CyIpopt with a callback to track the number of iterations.

Michael

Esteban Daniel Gonzalez Iakl

unread,
Jun 16, 2023, 12:41:42 PMJun 16
to Pyomo Forum
Hi, have you found a solution for this issue, easier than parsing the log file? Im looking into this too.
Reply all
Reply to author
Forward
0 new messages