On Oct 5, 2012, at 5:51 AM, Ricardo Puente wrote:
> I am solving some shape optimization problems using the gradient based nlopt
> algorithms.
> 
> One possible scenario, specially at the first step, when the step size is a
> default one is that the design vector is an unfeasible one, which will lead to
> crashes in the geometry generation codes (which are called via system()).

I see, so you want to decrease the initial trust-region size?  You can't set 
this directly in NLopt, but you could probably just rescale the coordinates to 
have the same effect.

> I also have a simple steepest descent algorithm which I use for trials and
> debugging, in which in case something crashes, I retrieve an error signal and
> try again reducing the step size. 
> 
> This is something I cannot do with the nlopt interface beacause, AFAIK, the
> objective fuction must be constructed declaring const the design vector. Thus,
> if I apply the step reducing mechanism within the function, the new design
> vector is not communicated outside.

Yes, you cannot change the design parameters in the objective function.  What 
you need to do in that case is call nlopt_force_stop to exit the optimization 
with the current best value, and then restart the optimization with a smaller 
trust region (or otherwise adjust the optimization parameters).

> Is there a way to go around this issue?  Or perhaps it wouldn't be too 
> difficult
> to have for a future version something like this, a function that modified the
> step if the evaluation failed.

No, it is not possible in most optimization algorithms to let the objective 
function modify the design parameters.

The best thing would be to add in some kind of explicit constraint in order to 
prevent infeasible designs.

Steven


_______________________________________________
NLopt-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss

Reply via email to