fau-advanced-separations / CADET-Process

A Framework for Modelling and Optimizing Advanced Chromatographic Processes
GNU General Public License v3.0
29 stars 12 forks source link

Transform linear constraints for variables with nonlinear normalization to nonlinear constraints #107

Open schmoelder opened 8 months ago

schmoelder commented 8 months ago

When adding optimization variables with non-linear normalization transforms, linear constraints become nonlinear since the optimizer only "sees" the transformed variables.

E.g.

optimization_problem.add_variable('var_0', lb=0, ub=1, transform='linear')
optimization_problem.add_variable('var_1', lb=0, ub=1000, transform='log')

optimization_problem.add_linear_constraint(['var_0', 'var_1'], [1, -1], 0)

Currently, this raises an error for most optimizers (i.e. those that explicitly use the form A * x <= b). Some optimizers such as pymoo can still handle this since the just explicitly call evaluate_linear_constraints(x_transformed, untransform=True).

To solve this more generally, we could consider transforming the linear constraint to a nonlinear constraint.

schmoelder commented 8 months ago

We have a similar situation for variables with variable dependencies that might be part of linear constraints. This also currently raises an error. (Maybe a separate issue?)