필터 지우기
필터 지우기

fmincon works but GA won't work

조회 수: 2 (최근 30일)
RAHUL KUMAR
RAHUL KUMAR 2019년 9월 4일
댓글: Walter Roberson 2019년 9월 4일
when i use fmincon it gives some optimized result but when i use GA it shows some like ''constraint not satisfied''.In both case i use same constraint and bounds.
why GA won't work on my same program
%xo=[0.2,0.015,100]
nvars=3;
A=[];
b=[];
Aeq=[];
beq=[];
lb=[0.1,0.012,10]; %lower bound
ub=[0.6,0.080,150]; %upper bound
nonlincon = @(x)constriant_press(x); % calling constraint function
Fitnessfun =@(x)objective_function(x); %calling objective function
options = optimoptions(@fmincon,'Display','iter-detailed','Algorithm','sqp','MaxFunctionEvaluations',5000,'TolFun',1e-5)
%options = optimset('Display','iter','TolFun',1e-6)
%options = optimset('PlotFcns',{@optimplotfval,@optimplotx});
%options = optimset('PlotFcns',{@optimplot
%[X,fval]=fmincon(Fitnessfun,xo,[],[],[],[],lb,ub,nonlincon,options)
[X,fval] = ga(Fitnessfun,nvars,[],[],[],[],lb,ub,nonlincon,options)
  댓글 수: 1
Walter Roberson
Walter Roberson 2019년 9월 4일
I cannot seem to see where you have posted the code for your objective or constraint function?

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

채택된 답변

Alan Weiss
Alan Weiss 2019년 9월 4일
In general, ga is not as reliable a solver as fmincon. So if you have smooth objective and constraints, you should use fmincon. See Table for Choosing a Solver.
Alan Weiss
MATLAB mathematical toolbox documentation

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by