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

add utility tool to deactivate/activate scaling suffixes in the models

Open MAZamarripa opened this issue 3 years ago • 4 comments

Issue is caused due to suffixes in variables (when running with Baron and/or conopt solvers) o Baron cannot recognize variable suffixes. o Source: IDAES scaling tools. o Solution: John E. will write a utility method to deactivate/activate scaling suffixes. Equations are still scaled.

MAZamarripa avatar Jun 28 '22 16:06 MAZamarripa

@MAZamarripa @eslickj It strikes me that this is more of a Pyomo issue than an IDAES one - I suspect (without seeing the actual traceback) it is because the Pyomo solver writers don't know what to do with the suffix. As such, maybe we should include them in the discussion of how to fix it.

andrewlee94 avatar Jul 11 '22 12:07 andrewlee94

@andrewlee94 I talked to Miguel about this, and I think Pyomo does catch this on purpose and throws and exception figuring you are making an error trying to give Barron suffixes it doesn't understand.

eslickj avatar Jul 20 '22 18:07 eslickj

@eslickj We probably should confirm that to be sure, and discuss with them the best approach (i.e. whether we should strip the suffixes on our end, or if they should have a way to override their error checking at their end).

andrewlee94 avatar Jul 20 '22 18:07 andrewlee94

@MAZamarripa, is this still an issue for idaes-pse? Moving to Nov release board...

ksbeattie avatar Aug 25 '22 18:08 ksbeattie

We are seeing this and other similar issues come up more and more frequently; I think what we really need in the long term is to revisit the scaling tools over all and come up with a more general solution. Note that the current scaling tools were built very specifically to leverage IPOPTs usage of suffixes (and specifically overcome the fact that setting user scaling for IPOPT turns off the Jacobian autoscaling), and thus really shouldn't be applied to models where we want to use another solver.

Now that we have separate tools for replicating IPOPTs Jacobian scaling, I think the longer term solution should be to create a more general set of scaling tools, and for IPOPT use user-scaling with the IDAES Jacobian scaling tools (note that this is what WaterTap does for virtually everything). However, this would be a fairly significant undertaking, so this might need to wait until next project year to find funding.

andrewlee94 avatar Oct 31 '22 17:10 andrewlee94

Related to #1023. This proposed a new approach to scaling which would use Pyomo's scaling transformation, thus solvers would not see the Suffixes any more.

andrewlee94 avatar Dec 21 '22 14:12 andrewlee94

A rebuild of the IDAES Scaling tools is on the cards for this year. In the short term, the correct solution is to properly leverage Pyomo's scaling transformation instead of using the IDAES tools when using solvers other that IPOPT. This will give the users far better control and more options than trying to work around the short comings of the IDAES tools.

Also note that the new Pyomo NL writer is much more vocal about misuse of scaling factors which will emit a lot of warnings until we rework these tools.

andrewlee94 avatar Feb 14 '23 20:02 andrewlee94