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

1 次查看(过去 30 天)
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
  1 个评论
Richárd Tóth
Richárd Tóth 2019-7-26
or is it easier if I simply call fseminf lots of times with different values? Is my code going to be as efficient and fast as by using GA,GlobalSearch or some other solver?

请先登录,再进行评论。

采纳的回答

Matt J
Matt J 2019-7-26
编辑:Matt J 2019-7-26
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Linear Least Squares 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by