MATLAB: How could you modify this semi-infinite optimization to global optimization using GlobalSearch

global minimumglobalsearchoptimizationsemi-infinite

Hello
I managed to create a script and find local minimum for my problem based on this example:
But how could you modify that example into a form that uses GlobalSearch to find global minimum? Let's say you have the myfun.m and mycon.m files. Normally you just set x0 and call fseminf and you have a local minimum. I suppose you need to do something like what is written in the answer here:
So let's say you do this : w1=1:100 and w2=1:100. What next? If you could show me how to modify this MathWorks example, then I could modify my scripts.
Thanks

Best Answer

If you could show me how to modify this MathWorks example, then I could modify my scripts.
It would look like below,
myfun=@(x) norm(x-0.5).^2;
[w1,w2]=deal(1:100);
x0=ga(myfun,3,A,b,Aeq,beq,lb,ub,@(x) nonlcon(x,w1,w2));
function [c,ceq]=nonlcon(X,w1,w2)
K1 = sin(w1*X(1)).*cos(w1*X(2)) - 1/1000*(w1-50).^2 -...
sin(w1*X(3))-X(3)-1;
K2 = sin(w2*X(2)).*cos(w2*X(1)) - 1/1000*(w2-50).^2 -...
sin(w2*X(3))-X(3)-1;
c=[K1;K2];
ceq=[];
end
Then, you feed the x0, returned from ga(), as the initial guess to fseminf, exactly as implemented at
Related Question