IDAES / idaes-pse

The IDAES Process Systems Engineering Framework
https://idaes-pse.readthedocs.io/
Other
216 stars 234 forks source link

Surrogate models with logarithmic terms (ln) do not evaluate properly #1058

Closed tarnold17 closed 1 year ago

tarnold17 commented 1 year ago

I trained a surrogate and obtained the following expression for the model:

image

The "ln" term in the surrogate is problematic. When attempting to evaluate the surrogate model against input data, the following traceback is obtained:

image

This surrogate model was trained using alamopy; I am not sure if the same can occur for surrogates trained using PySMO.

andrewlee94 commented 1 year ago

@tarnold17 Thanks for finding this - the issue is that ALAMO uses ln to represent natural logs but Pyomo uses log, thus it is unable to parse the expression it receives from ALAMO. We need to add a check in the parsing code to replace the ln with a log - this is only related to ALAMO and does not affect anything else.