You are on page 1of 13

Contents

Defing CHP Object List and assigning variables


Assiging Data to CHP Units
Assiging Model Name
Assigning Load demand for each CCHP
Upper Boundry
GG Gas to Electric conversion)
Gas to heat conversion efficiency
Other efficiencies for all energy hub unit
Cost Function coefficients for CHP units
Getting Results for ALL CHP using Ga
Getting results using FFA
Formatting Output Data
Formatting GA

Defing CHP Object List and assigning variables

clear
clc
GG(18)=CCHP;

Assiging Data to CHP Units

Le=2; %electric Load demand


Lh=5; %Heat load demand

Assiging Model Name

GG(1).ModelName='GG50';
GG(2).ModelName='GG70';
GG(3).ModelName='GG98';
GG(4).ModelName='GG113';
GG(5).ModelName='GG132';
GG(6).ModelName='GG140';
GG(7).ModelName='GG170';
GG(8).ModelName='GG201';
GG(9).ModelName='GG206';
GG(10).ModelName='GG237';
GG(11).ModelName='GG260';
GG(12).ModelName='GG330';
GG(13).ModelName='GG330_2';
GG(14).ModelName='GG385';
GG(15).ModelName='GG402';
GG(16).ModelName='GG_402_2';
GG(17).ModelName='GG_465';
GG(18).ModelName='GG_530';

Assigning Load demand for each CCHP

for ii=1:length(GG)
GG(ii).Le=Le;
GG(ii).Lh=Lh;
end

Upper Boundry

%max Gas input Pu 100Kw from table;


GG(1).Pg_max=1.46;
GG(2).Pg_max=2.04;
GG(3).Pg_max=2.84;
GG(4).Pg_max=3.27;
GG(5).Pg_max=3.56;
GG(6).Pg_max=3.92;
GG(7).Pg_max=4.41;
GG(8).Pg_max=5.92;
GG(9).Pg_max=5.29;
GG(10).Pg_max=6.69;
GG(11).Pg_max=6.94;
GG(12).Pg_max=8.79;
GG(13).Pg_max=8.83;
GG(14).Pg_max=9.99;
GG(15).Pg_max=10.45;
GG(16).Pg_max=9.55;
GG(17).Pg_max=11.91;
GG(18).Pg_max=13.41;

for ii=1:length(GG)
GG(ii).Pe_max= 5; %Max input electric Power from grid
GG(ii).Ph_max= 5; %Max input heat power Pu in case of boiler avilable
end

GG Gas to Electric conversion)

GG(1).eff_ge=0.342;
GG(2).eff_ge=0.348;
GG(3).eff_ge=0.352;
GG(4).eff_ge=0.349;
GG(5).eff_ge=0.374;
GG(6).eff_ge=0.362;
GG(7).eff_ge=0.390;
GG(8).eff_ge=0.346;
GG(9).eff_ge=0.399;
GG(10).eff_ge=0.357;
GG(11).eff_ge=0.379;
GG(12).eff_ge=0.383;
GG(13).eff_ge=0.382;
GG(14).eff_ge=0.386;
GG(15).eff_ge=0.388;
GG(16).eff_ge=0.383;
GG(17).eff_ge=0.394;
GG(18).eff_ge=0.397;

Gas to heat conversion efficiency

GG(1).eff_gh=0.562
GG(2).eff_gh=0.559;
GG(3).eff_gh=0.570;
GG(4).eff_gh=0.554;
GG(4).eff_gh=0.554;
GG(5).eff_gh=0.551;
GG(6).eff_gh=0.551;
GG(7).eff_gh=0.515;
GG(8).eff_gh=0.559;
GG(9).eff_gh=0.505;
GG(10).eff_gh=0.556;
GG(11).eff_gh=0.549;
GG(12).eff_gh=0.521;
GG(13).eff_gh=0.515;
GG(14).eff_gh=0.511;
GG(15).eff_gh=0.515;
GG(16).eff_gh=0.518;
GG(17).eff_gh=0.514;
GG(18).eff_gh=0.521;

GG =

1x18 CCHP array with properties:

ModelName
Pg_max
Pe_max
Ph_max
eff_ge
eff_gh
eff_eh
eff_ee
eff_hh
Le
Lh
a_coeff
b_coeff
Ga_result
FFA_result
C

Other efficiencies for all energy hub unit

for ii=1:length(GG)
GG(ii).eff_ee=0.98;
GG(ii).eff_eh=0;
GG(ii).eff_hh=0.9;
end

Cost Function coefficients for CHP units

for ii=1:length(GG)
GG(ii).a_coeff=[12 5 4];
GG(ii).b_coeff=[0.12 0.05 .04];
end

Getting Results for ALL CHP using Ga

for ii=1:length(GG)

close all
Ga_Solution(ii)=GG(ii).Ga_result;

Optimization terminated: average change in the fitness value less than options.FunctionTolerance
and constraint violation is less than options.ConstraintTolerance.

Optimization terminated: average change in the fitness value less than options.FunctionTolerance
and constraint violation is less than options.ConstraintTolerance.
Optimization terminated: average change in the fitness value less than options.FunctionTolerance
and constraint violation is less than options.ConstraintTolerance.

Optimization terminated: average change in the fitness value less than options.FunctionTolerance
and constraint violation is less than options.ConstraintTolerance.

Optimization terminated: average change in the fitness value less than options.FunctionTolerance
and constraint violation is less than options.ConstraintTolerance.

Optimization terminated: average change in the fitness value less than options.FunctionTolerance
and constraint violation is less than options.ConstraintTolerance.
Optimization terminated: average change in the fitness value less than options.FunctionTolerance
and constraint violation is less than options.ConstraintTolerance.

Optimization terminated: average change in the fitness value less than options.FunctionTolerance
and constraint violation is less than options.ConstraintTolerance.

Optimization terminated: average change in the fitness value less than options.FunctionTolerance
and constraint violation is less than options.ConstraintTolerance.

Optimization terminated: average change in the fitness value less than options.FunctionTolerance
and constraint violation is less than options.ConstraintTolerance.
Optimization terminated: average change in the fitness value less than options.FunctionTolerance
and constraint violation is less than options.ConstraintTolerance.

Optimization terminated: average change in the fitness value less than options.FunctionTolerance
and constraint violation is less than options.ConstraintTolerance.

Optimization terminated: average change in the fitness value less than options.FunctionTolerance
and constraint violation is less than options.ConstraintTolerance.

Optimization terminated: average change in the fitness value less than options.FunctionTolerance
and constraint violation is less than options.ConstraintTolerance.
Optimization terminated: average change in the fitness value less than options.FunctionTolerance
and constraint violation is less than options.ConstraintTolerance.

Optimization terminated: average change in the fitness value less than options.FunctionTolerance
and constraint violation is less than options.ConstraintTolerance.

Optimization terminated: average change in the fitness value less than options.FunctionTolerance
and constraint violation is less than options.ConstraintTolerance.

Optimization terminated: average change in the fitness value less than options.FunctionTolerance
and constraint violation is less than options.ConstraintTolerance.
Getting results using FFA

close all
FFa_Solution(ii)=GG(ii).FFA_result;
end

Formatting Output Data

for ii=1:length(GG)
COST_FFA(ii)=FFa_Solution(ii).F_ff;
COST_GA(ii)=Ga_Solution(ii).Fga;
end
[COST1,Index_ga]=sort(COST_GA);
[COST2,Index_ffa]=sort(COST_FFA);

for ii=1:length(GG)
GG_ffa(ii)=GG(Index_ffa(ii));
GG_ga(ii)=GG(Index_ga(ii));
SOL_Ga(ii)=Ga_Solution(Index_ga(ii));
SOL_FFA(ii)=FFa_Solution(Index_ffa(ii));
end

Formatting GA

disp('Design From Ga sorted according to cost')


for ii=1:length(GG)
eff_ge(ii,1)=GG_ga(ii).eff_ge;
eff_gh(ii,1)=GG_ga(ii).eff_gh;
eff_hh(ii,1)=GG_ga(ii).eff_hh;
sol=SOL_Ga(ii).Xga;
Pe(ii,1)=sol(1,1);
Pg(ii,1)=sol(1,2);
Ph(ii,1)=sol(1,3);
Cost_F(ii)=SOL_Ga(ii).Fga;
end

Tga=table(Pe,Pg,Ph,eff_ge,eff_gh,eff_hh,Cost_F', 'VariableNames',{'Pe' 'Pg' 'Ph' 'eff_ge' 'eff_gh' 'eff_hh' 'Cost'},...


'RowNames',{GG_ga(1:length(GG)).ModelName})

Design From Ga sorted according to cost

Tga =

Pe Pg Ph eff_ge eff_gh eff_hh Cost


_________ ______ ______ ______ ______ ______ ______

GG_465 0.056655 4.9353 2.7375 0.394 0.514 0.9 37.824


GG260 0.11547 4.9788 2.5189 0.379 0.549 0.9 37.85
GG_402_2 0.0027185 5.2151 2.5545 0.383 0.518 0.9 37.947
GG330 0.037847 5.1253 2.5891 0.383 0.521 0.9 38.019
GG385 0.045656 5.0654 2.68 0.386 0.511 0.9 38.165
GG330_2 0.031562 5.1549 2.6063 0.382 0.515 0.9 38.179
GG_530 0.21119 4.5166 2.9413 0.397 0.521 0.9 38.254
GG237 0.041984 5.4872 2.1661 0.357 0.556 0.9 38.297
GG402 0.20908 4.6266 2.9086 0.388 0.515 0.9 38.69
GG201 0.06255 5.6028 2.0762 0.346 0.559 0.9 38.812
GG206 0.28495 4.3127 3.1361 0.399 0.505 0.9 38.861
GG132 0.97 2.8056 3.8383 0.374 0.551 0.9 42.117
GG140 0.93164 3.0029 3.7176 0.362 0.551 0.9 42.172
GG170 1.0089 2.5932 4.0721 0.39 0.515 0.9 42.483
GG98 1.0485 2.7629 3.8063 0.352 0.57 0.9 42.714
GG113 1.3723 1.8772 4.4005 0.349 0.554 0.9 44.632
GG50 1.5743 1.337 4.7212 0.342 0.562 0.9 45.74
GG70 1.5991 1.244 4.7833 0.348 0.559 0.9 45.842

disp('Design From FFA sorted according to cost')


for ii=1:length(GG)
eff_ge(ii,1)=GG_ffa(ii).eff_ge;
eff_gh(ii,1)=GG_ffa(ii).eff_gh;
eff_hh(ii,1)=GG_ffa(ii).eff_hh;
sol=SOL_FFA(ii).X_ff;
Pe(ii,1)=sol(1,1);
Pg(ii,1)=sol(1,2);
Ph(ii,1)=sol(1,3);
Cost_F(ii)=SOL_FFA(ii).F_ff;
end

Tffa=table(Pe,Pg,Ph,eff_ge,eff_gh,eff_hh,Cost_F', 'VariableNames',{'Pe' 'Pg' 'Ph' 'eff_ge' 'eff_gh' 'eff_hh' 'Cost'},...


'RowNames',{GG_ffa(1:length(GG)).ModelName})

Design From FFA sorted according to cost

Tffa =
Pe Pg Ph eff_ge eff_gh eff_hh Cost
________ ______ ______ ______ ______ ______ __________

GG_465 0.012403 5.0492 2.674 0.394 0.514 0.9 37.651


GG_402_2 0.38931 4.2023 3.1301 0.383 0.518 0.9 39.496
GG206 0.41939 4.0019 3.308 0.399 0.505 0.9 39.534
GG201 0.39771 4.6306 2.6711 0.346 0.559 0.9 39.987
GG385 0.53679 3.8269 3.3719 0.386 0.511 0.9 40.285
GG330_2 0.94267 2.842 3.9186 0.382 0.515 0.9 42.321
GG260 1.057 2.5347 3.9998 0.379 0.549 0.9 42.452
GG_530 1.0656 2.4066 4.1565 0.397 0.521 0.9 42.564
GG402 1.0595 2.4532 4.1464 0.388 0.515 0.9 42.689
GG170 1.1682 2.1829 4.2955 0.39 0.515 0.9 43.255
GG98 1.1911 2.3377 4.0639 0.352 0.57 0.9 43.341
GG330 1.1595 2.2754 4.2362 0.383 0.521 0.9 43.373
GG237 1.3506 1.8669 4.4013 0.357 0.556 0.9 44.315
GG113 1.4049 1.7641 4.4587 0.349 0.554 0.9 44.702
GG70 1.4349 1.6919 4.4937 0.348 0.559 0.9 44.851
GG140 1.4564 1.5782 4.5878 0.362 0.551 0.9 44.94
GG50 1.5985 1.2675 4.7469 0.342 0.562 0.9 1.5508e+08
GG132 0.84214 3.1991 3.597 0.374 0.551 0.9 2.1768e+08

Published with MATLAB® R2016a

You might also like