Search code examples
openmdao

What is the most strict way to enforce the bounds for design varibles?


I can see that my design variable exceeds its limits. (using COBYLA in this case)

I have a sample setup with single design variable where the optimum lies around 0.

I set the 'lower=0'.

I want this to be a very strict limit, because negative values yield NaN for my solver.

The optimizer goes i.e. 1, 2, 0, -0.125000000e-01, -1.56250000e-02, -1.95312500e-03, -2.44140625e-04 -3.05175781e-05, -3.81469727e-06, -5.00000000e-07

I am guessing this is optimizer type dependent? But is there a way enforce more strictly.


Solution

  • Unfortunately, COBYLA does not strictly respect variable bounds (see scipy docs) The best you can do is to add them as linear constraints, and it will attempt to enforce them at the optimum point.

    You can try SLSQP, though. It does strictly respect the bounds.