ncp_sigmoid/Sigmoid函数法/readData_RPP.m

70 lines
4.2 KiB
Matlab
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

function [nodeNum,lineNum,capacity,kmax,accuracy,balNum,balNode,mtrLine,mtrGround,mtrTrans,runPara,Pg,Qg,Pd,Qd,pvNum,pvNode,pvV,pvQmin,pvQmax,...
mtrCapacitor,pgNum,pgNode,a,b,c,Pmin,Pmax,Vmin,Vmax,centrPara]=readData_RPP(data)
%程序功能:读取数据
%编写时间2010年10月
%% 获取首列元素为0的行号
zeroIndex=find(data(:,1)==0);
%% 读取系统参数
nodeNum=data(1,1); %系统节点数
capacity=data(1,3); %基准容量
accuracy=data(1,4); %计算精度
balNum=zeroIndex(2)-zeroIndex(1)-1; %平衡节点数
balNode=data(zeroIndex(1)+1:zeroIndex(2)-1,2); %平衡节点编号
kmax=100; %最大迭代次数
centrPara=0.1; %中心参数
%% 读取线路参数
mtrLine=data(zeroIndex(2)+1:zeroIndex(3)-1,:);
lineNum=length(mtrLine);
%% 读取变压器支路参数
mtrTrans=data(zeroIndex(3)+1:zeroIndex(4)-1,:);
%% 读取接地支路参数
mtrGround=data(zeroIndex(5)+1:zeroIndex(6)-1,:);
%% 读可调电容器参数
mtrCapacitor=data(zeroIndex(6)+1:zeroIndex(7)-1,:);
%% 读取运行参数
runPara=data(zeroIndex(8)+1:zeroIndex(9)-1,:);
pqNode=runPara(:,2);
Pg=sparse(nodeNum,1);
Qg=Pg;Pd=Pg;Qd=Pg;
Pg(pqNode)=runPara(:,3); %节点有功出力
Qg(pqNode)=runPara(:,4); %节点无功出力
Pd(pqNode)=runPara(:,5); %节点有功负荷
Qd(pqNode)=runPara(:,6); %节点无功负荷
%% 有功出力限制
mtrPGLimit=data(zeroIndex(9)+1:zeroIndex(10)-1,:);
pgNum=zeroIndex(10)-zeroIndex(9)-1; %发电机台数
pgNode=mtrPGLimit(:,3); %发电机节点号
c=sparse(mtrPGLimit(:,3),ones(pgNum,1),mtrPGLimit(:,8),nodeNum,1);
b=sparse(mtrPGLimit(:,3),ones(pgNum,1),mtrPGLimit(:,9),nodeNum,1);
a=sparse(mtrPGLimit(:,3),ones(pgNum,1),mtrPGLimit(:,10),nodeNum,1);
Pmin=sparse(mtrPGLimit(:,3),ones(pgNum,1),mtrPGLimit(:,4),nodeNum,1); %发电机有功出力下限
Pmax=sparse(mtrPGLimit(:,3),ones(pgNum,1),mtrPGLimit(:,5),nodeNum,1); %发电机有功出力上限
%% 无功出力限制
mtrQGLimit=data(zeroIndex(11)+1:zeroIndex(12)-1,:);
pvNum=zeroIndex(12)-zeroIndex(11)-1;
pvNode=sparse(mtrQGLimit(:,3),ones(pvNum,1),mtrQGLimit(:,3),nodeNum,1);
pvNode=find(pvNode); %PV节点和平衡节点编号
pvV=sparse(mtrQGLimit(:,3),ones(pvNum,1),mtrQGLimit(:,4),nodeNum,1); %PV节点和平衡节点给定电压
pvQmin=sparse(mtrQGLimit(:,3),ones(pvNum,1),mtrQGLimit(:,5),nodeNum,1); %无功出力下限
pvQmax=sparse(mtrQGLimit(:,3),ones(pvNum,1),mtrQGLimit(:,6),nodeNum,1); %无功出力上限
%% 电压限制
mtrVLimit=data(zeroIndex(13)+1:zeroIndex(14)-1,:);
VLimitNum=zeroIndex(14)-zeroIndex(13)-1; %电压限制的节点数
Vmin=sparse(mtrVLimit(:,2),ones(VLimitNum,1),mtrVLimit(:,3),nodeNum,1);
Vmax=sparse(mtrVLimit(:,2),ones(VLimitNum,1),mtrVLimit(:,4),nodeNum,1);
Vmin=0.9*ones(nodeNum,1); %非电压监测点电压限制
Vmax=1.15*ones(nodeNum,1);
node_Z=data(zeroIndex(14)+1:zeroIndex(15)-1,1); %变压器中性点这些点的电压不考核设置为0.8-1.2
Vmin(node_Z)=0.85;
Vmax(node_Z)=1.15;
node_220=data(zeroIndex(15)+1:zeroIndex(16)-1,1); %220kV及以上节点
Vmin(node_220)=0.95;
Vmax(node_220)=1.1;
node_750=data(zeroIndex(16)+1:zeroIndex(17)-1,1); %750kV节点
Vmin(node_750)=1;
Vmax(node_750)=1.1;
node_Monitor=data(zeroIndex(17)+1:zeroIndex(18)-1,1); %发电厂升压变以及800kV变电站220、363kV母线节点电压监测点
Vmin(node_Monitor)=1;
Vmax(node_Monitor)=1.1;