original.not modified.

This commit is contained in:
facat
2012-05-22 11:33:21 +08:00
commit cb34aec845
83 changed files with 13475 additions and 0 deletions

76
openfile.m Normal file
View File

@@ -0,0 +1,76 @@
function [Busnum,Balance,PQstandard,Precision,Linei,Linej,Liner,Linex,Lineb,kmax,Transfori ,...
Transforj,Transforr,Transforx,Transfork0,Branchi,Branchb,Pointpoweri,PG,QG,PD,QD,PVi,PVu,Gen,GenU,GenL,GenC,CenterA,PGi,PVQU,PVQL] = openfile(FileName)
%**************************************************************************
% :
%
% 2010.12
%**************************************************************************
data = dlmread(FileName); %
Busnum= data(1,1); %
PQstandard = data(1,3); %
kmax = data(1,4); %
Precision = data(2,1); %
Balance = data(3,2); % 1
CenterA=data(1,5); %
LineNum=data(1,2); %
Base=data(1,3);
%%
zeroRow = find(data(:,1)==0); %
line = data(zeroRow(1)+1:zeroRow(2)-1,:); % 线
ground = data(zeroRow(2)+1:zeroRow(3)-1,:); %
tran = data(zeroRow(3)+1:zeroRow(4)-1,:); %
buspq = data(zeroRow(4)+1:zeroRow(5)-1,:); %
PV = data(zeroRow(5)+1:zeroRow(6)-1,:); % pv
Gen=data(zeroRow(6)+1:zeroRow(7)-1,:);
%% 线
Linei = line(:,2); % i
Linej= line(:,3); % j
Liner = line(:,4); % 线
Linex = line(:,5); % 线
Lineb = line(:,6); % b/2
%%
Branchi = ground(:,1); %
Branchb = ground(:,2); %
%%
Transfori = tran(:,2); % i
Transforj= tran(:,3); % j
Transforr = tran(:,4); %
Transforx= tran(:,5); %
Transfork0 = tran(:,6); %
%%
Pointpoweri = buspq(:,1);
PG=buspq(:,2); %
QG=buspq(:,3); %
PD=buspq(:,4); %
QD=buspq(:,5); %
%%
PG=PG/Base;
QG=QG/Base;
PD=PD/Base;
QD=QD/Base;
%% pv
PVi = PV(:,1); % PV
PVu = PV(:,2); % PV
PVQL=PV(:,3);%PV
PVQL=PVQL/Base;
PVQU=PV(:,4); %PV
PVQU=PVQU/Base;
%%
%GenU=Gen(:,[1 5 6]);
%GenL=Gen(:,[1 7 8]);
GenC=Gen(:,[1 2:4]);
t=GenC(:,2);
GenC(:,2)=GenC(:,4);
GenC(:,4)=t;
%%%%%%%%%%%%%%%%%%%%
%GenC(:,2:4)=100*GenC(:,2:4);
t=Gen(:,[1 5]);
%GenL=[t,PVQL(PVi)];
GenL=t;%
GenL(:,2)=GenL(:,2)/Base;
t=Gen(:,[1 6]);
%GenU=[t,PVQU(PVi)];
GenU=t;%
GenU(:,2)=GenU(:,2)/Base;
PGi=Gen(:,1);%
end