Professional Documents
Culture Documents
1 0.00375 2 0 50 200
2 0.0175 1.75 0 20 80
5 0.0625 1 0 15 50
8 0.0083 3.25 0 10 35
11 0.025 3 0 10 30
13 0.025 3 0 12 40 ];
Le programme dans AG
%programme principal
clear all;clc;
A=[];
z=[];
g=[1 1 1 1 1 1];
e=283.4;%sum(Pg)=Pd=283.4
lb=[50 20 15 10 10 12];
ub=[200 80 50 35 30 40];
for run=1:20
optimset=gaoptimset('PlotFcns',@gaplotbestf,'PopulationSize',20,'
generation',100)
[pg(:,run),F(run),flag]=ga(@objec1,6,A,z,g,e,lb,ub,[],optimset)
end
%% Results
[bestrun bestF]=min(F);
bestPg=pg(:,bestF)
1
En function:
function [F]=objec1( pg )
cout = [...
%ng c b a pmin pmax
1 0.00375 2 0 50 200
2 0.0175 1.75 0 20 80
5 0.0625 1 0 15 50
8 0.0083 3.25 0 10 35
11 0.025 3 0 10 30
13 0.025 3 0 12 40 ];
npg=length(cout(:,1));
F=0;
for i=1:npg
F=F+cout(i,4)+cout(i,3)*pg(i)+cout(i,2)*(pg(i)^2);
end
1 172.6312
2 41.2503
5 25.0662
8 15.4011
11 10.1197
13 18.9306
Coût optimal de génération ($/h)-8eme 774.012
itération-
2
3