Matlab optimization module problem

조회 수: 6 (최근 30일)
MathWorks Support Team
MathWorks Support Team 2016년 11월 30일
편집: MathWorks Support Team 2023년 5월 17일
I am using matlab R2016a. I am using optimization module for my application 
trying to find the minimum in my function (below is the main optimization 
lines). There are two variables that I'm interested to optimize them to 
make the function minimum. The objective function has lots of local 
minimums. Unfortunately each run gave me different variables. Sometimes 
there's 30% or more difference between runs results. And sometimes the 
optimization module get stuck in one of the local minimums. I tried to tune 
every tolerance and step size but no success so far and I don't get a 
consistent final results for my two variables. Could you please help me how 
can I tune the Options to have a quicker and consistent result. ; options = 
optimoptions('fmincon','Display','iter','Algorithm',' 
sqp','MaxFunctionEvaluations',1500,'MaxIterations',1500,' 
ConstraintTolerance',1.0e-10,'OptimalityTolerance',1.0e-10,'StepTolerance',1.0e-10);; 
estparam=fmincon(@objfun,estparam0,A,b,Aeq,beq,lb,ub,[],options) 

채택된 답변

MathWorks Support Team
MathWorks Support Team 2023년 5월 17일
편집: MathWorks Support Team 2023년 5월 17일
If you have access to the Global Optimization Toolbox, you may use “GlobalSearch” or “MultiStart” features of the toolbox to obtain the global minimum to your problem.
 
In addition, another potential workaround is to use the function “patternsearch”
Example:
>> options = optimoptions('patternsearch','Display','iter','MaxFunctionEvaluations',1500,'MaxIterations',1500,'ConstraintTolerance',1.0e-10,'StepTolerance',1.0e-10);
>> estparam=patternsearch(@objfun,estparam0,A,b,Aeq,beq,lb,ub,[],options)
 
Finally, you may also try calling “fmincon” multiple times in a “for” or “parfor” loop, giving different initial guesses each time and keeping track of the best solution.  This will not necessarily guarantee a global minimum, but it will likely yield a better and more consistent answer.
 

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surrogate Optimization에 대해 자세히 알아보기

제품


릴리스

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by