From: "Toan Cao" <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Non-linear optimization
Date: Thu, 7 Mar 2013 15:15:08 +0000 (UTC)
Organization: university of Ulsan
Lines: 49
Message-ID: <khaats$7h6$>
References: <kh2m44$4eh$> <kh32ds$hrn$> <kh46mg$s0t$> <kh89he$4al$> <kh8bsc$bov$> <kh8dvs$imu$>
Reply-To: "Toan Cao" <>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1362669308 7718 (7 Mar 2013 15:15:08 GMT)
NNTP-Posting-Date: Thu, 7 Mar 2013 15:15:08 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2244433
Xref: comp.soft-sys.matlab:790542

"Matt J" wrote in message <kh8dvs$imu$>...
> "Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <kh8bsc$bov$>...
> > "Matt J" wrote in message <kh89he$4al$>...
> > 
> > >  f(x)=(sqrt(F(x)-f_low))^2
> > 
> > What you write is
> > 
> > f(x) = abs(F(x)-f_low) = F(x)-f_low
> > 
> > Minimizing f(x) is the same as minimizing F(x). How far do we get?
> ===============
> That should really have been
>  f(x)=sqrt(F(x)-f_low)
>  min (f(x))^2
> But yes, the above is equivalent to minimizing F(x). That's what we want. Now, however, you can feed f(x) to LSQNONLIN and run its Levenberg-Marquardt routine.

Hi Matt J,

I will summarize my function here again and wish to receive feedback!

>Given two 3D point clouds (source point cloud (SPC) and target point cloud (TPC)). I would like to move each point of SPC to be coincide with each corresponding point of TPC.
Each movement of each point of SPC is described by a Rotation matrix Ri and a translation vector Ti.
Rotation matrix Ri is constrained: 
Rot(Ri)= (C1.C2)^2 + (C1.C3)^2 + (C2.C3)^2 +(C1.C1 -1)^2 +(C2.C2 -1)^2 + (C3.C3 -1)^2, where C1, C2, C3 are 3x1 column vectors of Ri.
Given m points in SPC, the first term of cost function is: Sum(Rot(Ri)) where i =1:m
If we call a point in SPC is Vi, its corresponding point in TPC is Ui, its transformed point is V'i. So, the second term of cost function is: Sum((V'i - Ui)^2), i=1:m
I assume that (for simplicity) the third term for my cost function is Sum(norm(Ri-Rj)^2), i,j=1:m, i ~=j
Now, my cost functiion : F = Sum(Rot(Ri)) +Sum((V'i - Ui)^2) +Sum(norm(Ri-Rj)^2), i=1:m

I read document of optimization toolbox of matlab, It suggests that  i can use LSQNONLIN for this function with Levenberg-Marquardt algorihm. With this routine, it requires we provide a vector-value function f(x)=[f{1}(x),f{2}(x),...,f{n}(x)]' for LSQNONLIN.
Now, to use this routine, i will do:
1)  f{1}(x)= (C1{i}.C2{i}), f{2}(x)= (C1{i}.C3{i}),..., (a set of functions for first term).
     f{k}(x) =(V'{i} - U{j}), f{k+1}(x) =(V'{i+1} - U{j+1}),...., (a set of functions for second term).
     f{h}(x)= norm(R{i}-R{j}) {i=h},... ,f{m}(x)=norm(R{i}-R{j}) {i=m}. (a set of functions for third term).
=> So, f(x) = [f{1}(x),  f{2}(x),...,  f{k}(x), f{k+1}(x),..., f{h}(x),..., f{m}(x)]'

OR, i just give:
2)  f{1}(x) = sqrt(Sum(Rot(Ri))),  f{2}(x) = sqrt(Sum((V'i - Ui)^2)), f{3}(x) =sqrt(Sum(norm(Ri-Rj)^2)).
=> So, f(x) = [f{1}(x),  f{2}(x), f{3}(x)]'
With your experience, Which option (1 or 2) should i follow ?

Thanks so much