www.pudn.com > powerflow.zip > aco4.m, change:2012-05-22,size:1432b


clear; 
clc; 
branch=xlsread('10junyun.xls');%初始网络结构数据 
n=1; 
times=zeros(10,11); 
timeslost=zeros(1,2); 
for n=1:10000 
      GUANGZHAOP=betarnd(2.8,3.4)*1500; 
      PVDGZP=GUANGZHAOP*0.13*5.2; 
      sinJIAO=sqrt(1-0.9^2); 
      tanJIAO=sinJIAO/0.9; 
      PVDGZQ=PVDGZP*tanJIAO; 
      PVDGP=PVDGZP/10; 
      PVDGQ=PVDGZQ/10; 
      P1=normrnd(100,15)-PVDGP; 
      P2=normrnd(100,15)-PVDGP; 
      P3=normrnd(100,15)-PVDGP; 
      P4=normrnd(100,15)-PVDGP; 
      P5=normrnd(100,15)-PVDGP; 
      P6=normrnd(100,15)-PVDGP; 
      P7=normrnd(100,15)-PVDGP; 
      P8=normrnd(100,15)-PVDGP; 
      P9=normrnd(100,15)-PVDGP; 
      P10=normrnd(100,15)-PVDGP; 
      Q1=normrnd(60,9)-PVDGQ; 
      Q2=normrnd(60,9)-PVDGQ; 
      Q3=normrnd(60,9)-PVDGQ; 
      Q4=normrnd(60,9)-PVDGQ; 
      Q5=normrnd(60,9)-PVDGQ; 
      Q6=normrnd(60,9)-PVDGQ; 
      Q7=normrnd(60,9)-PVDGQ; 
      Q8=normrnd(60,9)-PVDGQ; 
      Q9=normrnd(60,9)-PVDGQ; 
      Q10=normrnd(60,9)-PVDGQ; 
      branch(:,6)=[P1 P2 P3 P4 P5 P6 P7 P8 P9 P10]; 
      branch(:,7)=[Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10]; 
      branch0=branch;   %转移负荷用 
      nbranch=length(branch);%初始网络支路数 
      maxnext=4;             %最多下接支路数 
      powerflow3;             %初始网络潮流计算 
end 
prob=zeros(10,11); 
problost=zeros(1,2); 
prob=times/10000 
problost=timeslost/10000 
S0=S;                  %初始网络潮流 
Plose0=Plose;          %初始网络损耗