⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 costfunc.m

📁 This program is about economic load despatch. It has been done by using differential evolution algo
💻 M
字号:
function [cost]= costfunc(p)
p1 = 0;
p2 = 0;
p3 = 0;
p4 = 0;
max1=max(p(:,:,1));
max2=max(p(:,:,2));
max3=max(p(:,:,3));
max4=max(p(:,:,4));
for(h=1:24)
pp1(h)= p(:,h,1);
pp2(h)= p(:,h,2);
pp3(h)= p(:,h,3);
pp4(h)= p(:,h,4);
end

for(h=1:24)
    p1=p1+pp1(h);
    if(pp2(h)>0)
    p2=p2+p(:,h,2);
    end
    p3=p3+pp2(h);
    p4=p4+pp3(h);
end

%--------------------depriciation rate @10%------------------------------%
a1=(.1*(1.1^6))/((1.1^6)-1);% FC
a2=(.1*(1.1^15))/((1.1^15)-1); % ESS
a3=(.1*(1.1^6))/((1.1^6)-1); % EM
a4=(.1*(1.1^20))/((1.1^20)-1); %SD
a5=(.1*(1.1^6))/((1.1^6)-1); %LC
a6=(.1*(1.1^30))/((1.1^30)-1);%DL and ASH
a7=(.1*(1.1^20))/((1.1^20)-1);%CL
%--------------------Annual Total Costs----------------------------------%
c1=365*(3.77)*p1+a1*75400*max1/3600;
c2=365*(.377)*p2+a2*75400*max2/3600;
c3=(12*490.1)*max3+365*(p3*3.77);
c4=365*(2.262)*p4+a6*75400*max4/3600;
z1=c1+c2+c3+c4;
%--------------------Microgrid Construction Cost-------------------------%
c5=a3*(1432600);%EM
c6=a4*(5655000);%SD
c7=a6*(1131000);%DL
c8=a7*(1131000);%CL
z2=c5+c6+c7+c8;
%--------------------Power Interruption Cost-----------------------------%
for h=1:24
lol(h)=(p(:,h,1)+p(:,h,2)+p(:,h,3))-(max1+max2);
if lol(h)>0
ic(h)=120*((60^.5291)/(10^.5543))*lol(h);
else 
ic(h)=0;
end
end
z3=0;
for h=1:24
z3=z3+ic(h)*0.3;
end
%--------------------Total Cost-------------------------------------------%
cost=abs((z1+z2+z3));

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -