필터 지우기
필터 지우기

Fmincon and multistart results

조회 수: 1 (최근 30일)
Meddour Aissam riad
Meddour Aissam riad 2020년 2월 26일
편집: Meddour Aissam riad 2020년 2월 26일
I'm using the following code to calculacte the three coefficient 'x' ti minimise my function f which is need to run a for loop before we can get the final results of the objective function
% function f=FunMINCON(c)
% clear all
% clc
load('C:\Users\aissam.meddour\Desktop\Optimization algo\DATA\temp_HE.mat')
% load('C:\Users\aissam.meddour\Desktop\Optimization algo\DATA\temp_HP.mat')
load('C:\Users\aissam.meddour\Desktop\Optimization algo\DATA\temps_temperature.mat')
load('C:\Users\aissam.meddour\Desktop\Optimization algo\DATA\V_HE_opt.mat')
% load('C:\Users\aissam.meddour\Desktop\Optimization algo\DATA\V_HP_opt.mat')
load('C:\Users\aissam.meddour\Desktop\Optimization algo\DATA\C_HED.mat')
% load('C:\Users\aissam.meddour\Desktop\Optimization algo\DATA\C_HP.mat')
load('C:\Users\aissam.meddour\Desktop\Optimization algo\DATA\Ncycle.mat')
% c=[-1.3475221222842815E-7 11.308641442925296 0.9054638310592784]
c=[0.000001 4 1]
% c=[-1.3475221222842815E-7 12.655809411675296 1.1459423466842784];
T0=25;
V0=3.7;
DELTAT=10;
DELTAV=0.1;
Capa=100;
lb=[-10 -10 -10];
ub=[20 13 20];
C=[];
TT=[];
j=1:1:7301;
for Cycle=1:1:Ncycle(end)
TT=Capa*(1+c(1).*sqrt((temps_temperature(j))).*c(2).^((temp_HE(j)-T0)./DELTAT).*c(3).^(V_HE_opt(j)-V0)./DELTAV);
Capa=TT(Cycle);
C(Cycle)=TT(Cycle);
end
Ncycle(1)=[];
Capacite=[];
Capac=[];
Capac=C(Ncycle);
Capac2=[100,Capac];
Capacite=Capac2';
I1=sum((Capacite-C_HED).^2);
I2=sum(abs(Capacite-C_HED));
f=@(c)(I1+I2);
opts = optimoptions(@fmincon,'Algorithm','sqp');
problem = createOptimProblem('fmincon','objective',...
f,'x0',c,'lb',lb,'ub',ub,'options',opts);
ms = MultiStart('PlotFcns',@gsplotbestf);
[x,fval,exitflag,outpt,solutions] = run(ms,problem,1000);
% end
i'm getting a constant value of the objective function for all the ittiration, i know it's a code error but since it's my first time using this function i'm hoping to get some help here
  댓글 수: 1
Meddour Aissam riad
Meddour Aissam riad 2020년 2월 26일
편집: Meddour Aissam riad 2020년 2월 26일
If you need the data i can providee them of course

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

답변 (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