www.pudn.com > powerflow.zip > aco.m, change:2012-06-07,size:3256b


clear; 
clc; 
branch=xlsread('IEEE33.xls');%初始网络结构数据 
n=1; 
times=zeros(32,11); 
timeslost=zeros(1,2); 
juzhen=load('xieru.txt'); 
for n=1:10000 
      GUANGZHAOP=betarnd(juzhen(1,1),juzhen(1,2))*juzhen(1,3); 
      PVDGZP=GUANGZHAOP*juzhen(1,4)*juzhen(1,5)/1000; 
      sinJIAO=sqrt(1-0.9^2); 
      tanJIAO=sinJIAO/0.9; 
      PVDGZQ=PVDGZP*tanJIAO; 
      PVDGP=PVDGZP/32; 
      PVDGQ=PVDGZQ/32; 
      P1=normrnd(100,15)-PVDGP; 
      P2=normrnd(90,13.5)-PVDGP; 
      P3=normrnd(120,18)-PVDGP; 
      P4=normrnd(60,9)-PVDGP; 
      P5=normrnd(60,9)-PVDGP; 
      P6=normrnd(200,30)-PVDGP; 
      P7=normrnd(200,30)-PVDGP; 
      P8=normrnd(60,9)-PVDGP; 
      P9=normrnd(60,9)-PVDGP; 
      P10=normrnd(45,6.75)-PVDGP; 
      P11=normrnd(60,9)-PVDGP; 
      P12=normrnd(60,9)-PVDGP; 
      P13=normrnd(120,18)-PVDGP; 
      P14=normrnd(60,9)-PVDGP; 
      P15=normrnd(60,9)-PVDGP; 
      P16=normrnd(60,9)-PVDGP; 
      P17=normrnd(90,13.5)-PVDGP; 
      P18=normrnd(90,13.5)-PVDGP; 
      P19=normrnd(90,13.5)-PVDGP; 
      P20=normrnd(90,13.5)-PVDGP; 
      P21=normrnd(90,13.5)-PVDGP; 
      P22=normrnd(90,13.5)-PVDGP; 
      P23=normrnd(420,63)-PVDGP; 
      P24=normrnd(420,63)-PVDGP; 
      P25=normrnd(60,9)-PVDGP; 
      P26=normrnd(60,9)-PVDGP; 
      P27=normrnd(60,9)-PVDGP; 
      P28=normrnd(120,18)-PVDGP; 
      P29=normrnd(200,30)-PVDGP; 
      P30=normrnd(150,22.5)-PVDGP; 
      P31=normrnd(210,31.5)-PVDGP; 
      P32=normrnd(60,9)-PVDGP; 
      Q1=normrnd(60,9)-PVDGQ; 
      Q2=normrnd(40,6)-PVDGQ; 
      Q3=normrnd(80,12)-PVDGQ; 
      Q4=normrnd(30,4.5)-PVDGQ; 
      Q5=normrnd(20,3)-PVDGQ; 
      Q6=normrnd(100,15)-PVDGQ; 
      Q7=normrnd(100,15)-PVDGQ; 
      Q8=normrnd(20,3)-PVDGQ; 
      Q9=normrnd(20,3)-PVDGQ; 
      Q10=normrnd(30,4.5)-PVDGQ; 
      Q11=normrnd(35,5.25)-PVDGQ; 
      Q12=normrnd(35,5.25)-PVDGQ; 
      Q13=normrnd(80,12)-PVDGQ; 
      Q14=normrnd(10,1.5)-PVDGQ; 
      Q15=normrnd(20,3)-PVDGQ; 
      Q16=normrnd(20,3)-PVDGQ; 
      Q17=normrnd(40,6)-PVDGQ; 
      Q18=normrnd(40,6)-PVDGQ; 
      Q19=normrnd(40,6)-PVDGQ; 
      Q20=normrnd(40,6)-PVDGQ; 
      Q21=normrnd(40,6)-PVDGQ; 
      Q22=normrnd(50,7.5)-PVDGQ; 
      Q23=normrnd(200,30)-PVDGQ; 
      Q24=normrnd(200,30)-PVDGQ; 
      Q25=normrnd(25,3.75)-PVDGQ; 
      Q26=normrnd(25,3.75)-PVDGQ; 
      Q27=normrnd(20,3)-PVDGQ; 
      Q28=normrnd(70,10.5)-PVDGQ; 
      Q29=normrnd(600,90)-PVDGQ; 
      Q30=normrnd(70,10.5)-PVDGQ; 
      Q31=normrnd(100,15)-PVDGQ; 
      Q32=normrnd(40,6)-PVDGQ; 
      branch(:,6)=[P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 P11 P12 P13 P14 P15 P16 P17 P18 P19 P20 P21 P22 P23 P24 P25 P26 P27 P28 P29 P30 P31 P32]; 
      branch(:,7)=[Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 Q14 Q15 Q16 Q17 Q18 Q19 Q20 Q21 Q22 Q23 Q24 Q25 Q26 Q27 Q28 Q29 Q30 Q31 Q32]; 
      branch0=branch;   %转移负荷用 
      nbranch=length(branch);%初始网络支路数 
      maxnext=4;             %最多下接支路数 
      powerflow;             %初始网络潮流计算 
end 
prob=zeros(32,11); 
problost=zeros(1,2); 
prob=times/10000 
problost=timeslost/10000 
xlswrite('含有光伏电源的结果.xls',prob,'','B1'); 
xlswrite('含有光伏电源的结果.xls',problost,'','M1') 
S0=S;                  %初始网络潮流 
Plose0=Plose;          %初始网络损耗