Why the result of SQP algorithm varies each time when we change the starting point xo?

조회 수: 1 (최근 30일)
I have this code for running the SQP algorithm which is as follows:
OPTIONS = optimoptions('fmincon','Algorithm','sqp','Display','none');
xo = some point % Starting point
Lb=zeros(1,dim);
Ub=pi*ones(1,dim);
[x,fval,exitflag,output]= fmincon(FUN,xo(nn,:),[],[],[],[],Lb,Ub,[],OPTIONS);
If I run this code for some xo=[0 0 0 0], I get one result. But if I take xo=[pi/4 pi/4 pi/4 pi/4], I get another result. Likewise, if I take xo=[pi/3 pi/3 pi/3 pi/3]; I get another result and so on. Each time the result is different. If this is the case, then which xo should be chosen for best results?

채택된 답변

Matt J
Matt J 2021년 4월 24일
편집: Matt J 2021년 4월 24일
We have no reason to think that your function has a unique global minimum, so non-uniqueness could be a reason. It is also possible that the iterations get stuck at a local minimum in one or both cases.
Regardless, it is definitely beneficial to choose x0 as close as you can guess to the desired solution. This will reduce iteration time and also the chance that the iterations get stuck at a false solution.
  댓글 수: 1
Sadiq Akbar
Sadiq Akbar 2021년 4월 25일
Thank you dear Matt J for your kind response. Yes, you are right because when I choose xo as my desired solution, this code gives me the best estimate. But when I choose xo randomly, then it doesn't give me good solution but gives me worse solutions. So thank you once again dear Matt J for your guidance.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Systems of Nonlinear Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by