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