Hi Tony,
The Z value constraints are based on the physical system limits.
For theta, constraining is to limit wasted computation impacting user 
experience.

The optimization that is happening in user time.
The optimizer is able to produce from 4 to 6 metric calculation cycles per 
second.

The system is not equation based, so non-differentiable.
After having run a series of comparisons, I am using BOBYQA.

I have settled on setting a "small enough" initial step size to keep the 
results in bounds.
Thanks,
Richard Mustakos

-----Original Message-----
From: Anthony LaTorre <tlator...@gmail.com> 
Sent: Tuesday, May 7, 2019 12:38 PM
To: Mustakos, Richard <richard.musta...@bsci.com>
Cc: NLopt-discuss@ab-initio.mit.edu
Subject: Re: {External} Re: [NLopt-discuss] Parameters that wrap, e.g. angles

As far as I know there is no way to do this in nlopt. If you are doing local 
minimization, I don't think the issue you raised should be a big deal. Yes the 
minimizer could theoretically be sampling points further than 2 pi apart, but 
it should quickly shrink to a smaller area. You can also of course set the step 
size much smaller than 2 pi to avoid this problem.

I think you *could* introduce the X, Y, and Z coordinates and then add an 
augmented lagrangian to force the constraint on X and Y (see 
https://nlopt.readthedocs.io/en/latest/NLopt_Algorithms/#augmented-lagrangian-algorithm),
but that seems overkill.

Can you explain what minimization algorithm you're using and why leaving the 
parameter unbounded actually causes a problem?

Tony

On Mon, May 6, 2019 at 7:07 PM Mustakos, Richard <richard.musta...@bsci.com> 
wrote:
>
> Hi Tony,
> I can wrap it, but I can't tell the optimizer that the wrapped point is in 
> the wrapped location.
> The problem is that the optimization may need to cross the zero 
> boundary I have a point at 0.1 radians, and a point at -0.1 radians.
> To the optimizer they are almost 2 pi away from each other.
>
> If left unbounded, you may get a points at [1, 2 pi], at [1, 0] and at [1,-2 
> pi].
> The optimizer thinks they are 3 separate points, not the same point repeated.
> Eventually it will pick a minima in one of the 2 pi regions.
> But it will repeat calculations in each of the wrapping regions.
> Thanks,
> Richard
>
> -----Original Message-----
> From: Anthony LaTorre <tlator...@gmail.com>
> Sent: Monday, May 6, 2019 2:46 PM
> To: Mustakos, Richard <richard.musta...@bsci.com>
> Cc: NLopt-discuss@ab-initio.mit.edu
> Subject: {External} Re: [NLopt-discuss] Parameters that wrap, e.g. 
> angles
>
> I think in general if you're fitting using a local optimization, it's best to 
> avoid hard boundaries on the angle because as you mentioned the minimizer 
> cannot see past the boundary.
>
> In my case I've simply left all angle parameters unbounded. Is there a reason 
> you need to bound the theta parameter? Can you just take the result and remap 
> it to [0,2pi]?
>
> Tony
>
> On Mon, May 6, 2019 at 1:05 PM Mustakos, Richard <richard.musta...@bsci.com> 
> wrote:
> >
> > I am trying to do an optimization in cylindrical space, so theta wraps 
> > around 2 pi.
> > I have bounded the parameters at 0 and 2 pi, but that doesn’t use the 
> > information across 0 radians.
> > I set bounds to -pi to 3 pi, and that obviously captures the 0 crossing, 
> > but doesn’t equate it to the 2 pi crossing.
> >
> > If I wrap theta myself the results make me believe it isn’t seeing a 0.05 
> > to -0.05 radian step as -0.1 radian, but as a +(2 pi – 0.1) step.
> >
> >
> >
> > None of my searches around “nlopt parameter wrapping” turn up parameter 
> > wrapping, only language wrappings.
> > None of my searches around nlopt and radians turn up anything useful, 
> > either.
> >
> > Same with “optimizing parameter wrapping”.  Substitute synonyms, change 
> > word order, etc.
> >
> >
> >
> > Do I need to turn it into Euclidian space so that the optimizer is using X, 
> > Y and Z instead of theta and Z?
> >
> > If I do that, how do I keep X and Y bound to each other for a constant 
> > radius?
> >
> > It really is a 2 state variable problem
> >
> > My though is that if I don’t keep it as a constant radius, then there is an 
> > analogous problem where it doesn’t equate thetas that on different radius.
> >
> > Thanks for any help you can provide.
> >
> > Richard
> >
> > _______________________________________________
> > NLopt-discuss mailing list
> > NLopt-discuss@ab-initio.mit.edu
> > http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss
_______________________________________________
NLopt-discuss mailing list
NLopt-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss

Reply via email to