how to plot objective function with variables

3 visualizaciones (últimos 30 días)
RAHUL KUMAR
RAHUL KUMAR el 20 de Ag. de 2019
Respondida: Alan Weiss el 22 de Ag. de 2019
xo=[0.0011,0.0049,0.3]; % assumptions
%[Q]=heatload1_new(xo)
%nvars=3;
A=[];
b=[];
Aeq=[];
beq=[];
lb=[0.001,0.002,0.01]; %lower bound
ub=[0.01,0.08,0.5]; %upper bound
nonlincon = @(x)constraint_new(x); % calling constraint function
Fitnessfun = @(x)weight_testvariable(x); %calling objective function
options = optimoptions(@fmincon,'Display','iter-detailed','Algorithm','sqp','MaxIterations',1500)
options = optimset('Display','iter','TolFun',1e-5)
[X,fval]=fmincon(Fitnessfun,xo,[],[],[],[],lb,ub,nonlincon,options)

Respuestas (1)

Alan Weiss
Alan Weiss el 22 de Ag. de 2019
You have two definitions of options, meaning the first definition does nothing:
options = optimoptions(@fmincon,'Display','iter-detailed','Algorithm','sqp','MaxIterations',1500) % gets overwritten
options = optimset('Display','iter','TolFun',1e-5)
If you want to plot the objective function value as the optimization runs, set the PlotFcn argument to 'optimplotfval'. If you also want to plot the current point at the same time, set the PlotFcn argument to a cell array, {@optimplotfval,@optimplotx}.
Alan Weiss
MATLAB mathematical toolbox documentation

Categorías

Más información sobre Surrogate Optimization en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by