idaes-pse icon indicating copy to clipboard operation
idaes-pse copied to clipboard

Improving initialization troubleshooting

Open dallan-keylogic opened this issue 6 months ago • 0 comments
trafficstars

I've recently been in the weeds debugging some initialization issues for PrOMMiS. Presently, the primary way to troubleshoot initialization issues is by inserting pdb statements in the initialization routines, not just in the unit model being developed, but even deeper into IDAES and Pyomo methods. This issue is aggravated by #1612 , because the degrees of freedom are reverted when initialization fails, requiring the user to insert a trace before the initialization exits. Other issues include

  1. It is extremely hard to get troubleshooting information out of the BlockTriangularizationInitializer and solve_strongly_connected_components. I don't fully understand how the Pyomo logging level is set (I've frequently resorted to turning log statements into print statements), and even if the user is able to successfully set the logging level, the output is polluted by lower-level Pyomo debugging log message---every time a component is added to a block, something is logged to debug. I've opened the issue Pyomo/pyomo#3571 to aggregate Pyomo-side improvements that may be necessary.

  2. I'd like to warn the user if, when they're using BlockTriangularizationInitializer, they end up with blocks over a certain size (10x10? 20x20?). Sometimes it ends up with blocks that contain almost the entire system. Such a warning is probably possible without any changes on the Pyomo side.

  3. When trying to solve a block of a reasonable size, I encountered the IPOPT error EXIT: Problem has inconsistent variable bounds or constraint sides.. After some troubleshooting with the help of @jsiirola , we discovered that the linear presolve resulted in a variable violating its bounds. In the system I was working on, that seemed to have a straightforward interpretation---acid was being consumed to exhaustion. However, discovering that required us to a) delve into Pyomo functions, b) insert a pdb trace and c) decode an .nl file. It would be great if this information could be made accessible to the user somehow. Any linear infeasibility should be able to be exposed by Simplex Phase 1. (I tried using the infeasibility explainer on this problem, but got another weird error).

If anybody has any other pain points, it would be great to aggregate them in this issue.

dallan-keylogic avatar May 14 '25 13:05 dallan-keylogic