Hi dear researcher,

i want to do the same optimization as the follows fminsearchbnd optimization with one of metaheuristic algorithm as GA:

clear all

clc

% % %%%read data

filename = 'D_test2.xlsx';

sheet = 1;

xlRange = 'A2:E60';

Mm = xlsread(filename, sheet, xlRange);

% % %Get the data

% % %X=(Mm(:,1:13)); %%% money ens data

HB=(Mm(:,2)); %%% hauteur brute

P=(Mm(:,3)); %%% puissance

QTU=(Mm(:,1));%%débit turbiné

Rg=(Mm(:,4));

k=0.00981;

m=(Mm(:,5));

x1=QTU(:);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% options = optimset('PlotFcns',@optimplotfval);

%options = optimset('PlotFcns',@optimplotfval);

opts = optimset('fminsearch');

%opts = optimset('fminsearch',@optimplotfval);

opts.Display = 'iter';

%opts.TolX = 1.e-12;

opts.TolFun = 1.e-12;

opts.MaxFunEvals = 100;

sse =@(x)sum((x1 - x(3)./(k.*x(2).*x(4))).^ 2);

x0=[HB(:),P(:),Rg(:)]

n=length(x0);

LB=[36.5*ones(n,1) 50*ones(n,1) 0.73*ones(n,1)];

UB=[41.5*ones(n,1) 396*ones(n,1) 0.94*ones(n,1)];

%sse = fminsearch(sse,x0,options)

%xsol = fminsearchbnd(sse,x0,LB,UB,opts)

[xsol,fval,exitflag,output] = fminsearchbnd(sse,x0,LB,UB)

Here i expect to find a predictor vector which minimizes my objective function. I attached here a "D_test2" need in this programm.

More Daniel Eutyche Mbadjoun Wapet's questions See All
Similar questions and discussions