Pyomo / pyomo

An object-oriented algebraic modeling language in Python for structured optimization problems.
https://www.pyomo.org
Other
1.97k stars 505 forks source link

log10 transformations for BARON solver #2690

Closed judejeh closed 1 year ago

judejeh commented 1 year ago

Summary

When using Pyomo's intrinsic log10 function within a constraint, this works well. However, if the resulting model were to be solved with BARON solver, the log10 function is automatically converted to a natural log function in the .bar file. This changes the orginal constraint and leads to an entirely different model solution than expected of the original model.

BARON solver does state in its manual to use transformations for log10(x) as log10(e)*log(x). Can this be included within Pyomo automatically?

I am not certain how this applies to other non-linear optimisation solvers as I have only experienced this with BARON.

Rationale

A great deal of erroneous results can be avoided when users use Pyomo's log10 with BARON solver.

jsiirola commented 1 year ago

I am not sure what you are asking for: the automatic transformation of the log10 operator has been in the BAR writer for a long time (https://github.com/Pyomo/pyomo/blob/771665e47cd16873b301045d0a0a4e80c0805e44/pyomo/repn/plugins/baron_writer.py#L62...L75).

If this is a bug report, please use the bug report template. This includes pyomo version, python version, platform, installation method, relevant solvers (and versions), and most importantly, a minimal example reproducing the problem.

judejeh commented 1 year ago

Thanks for the pointer @jsiirola. I may need to make some updates to the version (5.7.3) I have been working with over time.