Constrained minimization

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Constrained minimization

Windhorn, Allen E [ACIM/LSA/MKT]
I have a minimization problem involving optimizing the geometry of a curved
surface (pole head shape on a salient-pole generator, if anyone is interested).
There are a number of options available for this including sqp, fminsearch,
fminunc, fmincon, and nonlin_min.  I'm not sure which to use.  Since I have
constraints I have started with sqp, which seems to be the preferred one.

I have some questions about the functionality of sqp, in particular, about the
form of the constraint functions (designated as g and h for equality and
inequality functions).  According to the documentation, these accept the
input vector X and produce an output vector.

1. Does this output vector have to be the same length as the input vector?
If so, what if there are more constraints than components?  Or fewer?
2. Is there supposed to be any correlation between the components of the
output vector and the input vector?  In other words, does output G(1) have
to depend on X(1) in some manner?  Or does the routine make its own
determination of how the output depends on the input?

Also, more generally:

3. What happens if the objective function gets driven into an infeasible
region, such that it produces N/A, NAN, or Inf as an output?  Will the routine
crash?  If so, can I deal with this in a wrapper function?  If so, what output
should be provided -- just a very high number?
4. Is there any documentation of the algorithm sqp uses?
5. Are any of the other options preferable to sqp?

Thanks again for your assistance.

Regards,
Allen
--
Allen Windhorn P.E. (Mn), CEng| Senior Principal Engineer
Leroy-Somer Americas | Kato Engineering, Inc.
2075 Howard Dr. West | North Mankato, MN 56003 | USA
T +1 507-345-2782 | F +1 507-345-2798
[hidden email] | [hidden email]



Reply | Threaded
Open this post in threaded view
|

Re: Constrained minimization

Juan Pablo Carbajal-2
> 1. Does this output vector have to be the same length as the input vector?
> If so, what if there are more constraints than components?  Or fewer?
> 2. Is there supposed to be any correlation between the components of the
> output vector and the input vector?  In other words, does output G(1) have
> to depend on X(1) in some manner?  Or does the routine make its own
> determination of how the output depends on the input?
>
> 3. What happens if the objective function gets driven into an infeasible
> region, such that it produces N/A, NAN, or Inf as an output?  Will the routine
> crash?  If so, can I deal with this in a wrapper function?  If so, what output
> should be provided -- just a very high number?
most of your questions can be answered form the manual entry
https://octave.org/doc/interpreter/Nonlinear-Programming.html
Check the example.
If you objective returns nan, the result will be nan, but if the
singularity is isolated sqp might survive.
I have encounter more problems with sqp when the constraints have
singular jacobians even if the singularity is isolated.

> 4. Is there any documentation of the algorithm sqp uses?
https://en.wikipedia.org/wiki/Sequential_quadratic_programming
It is just iterated QP, see lines 415-421
http://hg.savannah.gnu.org/hgweb/octave/file/531c188e6746/scripts/optimization/sqp.m

> 5. Are any of the other options preferable to sqp?
when I am serious about optimization I use nlopt
https://nlopt.readthedocs.io/en/latest/ (the octave interface is
outdated, but last time I tried (5.0.0) was still working) and
sometimes
bayesopt (uses nlopt) https://github.com/rmcantin/bayesopt.
If you update nlopt interface with Octave do let the authors know,
they are (at least were!) very open to collaborations.

Regards,


Reply | Threaded
Open this post in threaded view
|

RE: Constrained minimization

Windhorn, Allen E [ACIM/LSA/MKT]
Juan,

> -----Original Message-----
> From: Juan Pablo Carbajal <[hidden email]>

> > 5. Are any of the other options preferable to sqp?

> when I am serious about optimization I use nlopt
> https://nlopt.readthedocs.io/en/latest/ (the octave interface is
> outdated, but last time I tried (5.0.0) was still working) and
> sometimes bayesopt (uses nlopt) https://github.com/rmcantin/bayesopt.
> If you update nlopt interface with Octave do let the authors know,
> they are (at least were!) very open to collaborations.

I looked at this and it was difficult to understand, but I may try it later
if I don't get good results with sqp.  Meanwhile, I have rewritten the
objective function with different variables (the original ones turned out
to be really messy and had singularities), and sqp seems to be sort of
working now (I get result 104, but the optimized X and objective are
pretty consistent, with different starting points).

Thanks again for your help.

Regards,
Allen