资源简介
p.s.本代码已重新修改啦~目前还在CSDN审核中,您可通过GitHub下载重构代码~
https://github.com/Cyyjenkins/powergrid-state-estimation
电力系统状态估计(电力网系统辨识)-最小二乘法-matlab
txt文件为IEEE30节点电力网数据
导入其它电力网数据时,可按txt文档内格式保存数据,也可修改m文件代码
辨识后的数据将会存储在oStateEstimation.txt文件内
https://github.com/Cyyjenkins/powergrid-state-estimation
电力系统状态估计(电力网系统辨识)-最小二乘法-matlab
txt文件为IEEE30节点电力网数据
导入其它电力网数据时,可按txt文档内格式保存数据,也可修改m文件代码
辨识后的数据将会存储在oStateEstimation.txt文件内
代码片段和文件信息
%% Power Grid State Estimation (Test 1)
clc; % Clear windows
format
%% Read power flow data from document “iSE30Bus.txt“
fp=fopen(‘iSE30Bus.txt‘‘r‘);
fscanf(fp‘%s‘1); % read one sting
node=fscanf(fp‘%d‘1); % read number of nodes
nzl=fscanf(fp‘%d‘1); % read number of branches
kBus=fscanf(fp‘%d‘1); % read number of known Bus
fscanf(fp‘%s‘1); % read a string
zl=zeros(nzl4); % 确定节点导纳矩阵的规格,并保存i j R X的数据
for i=1:nzl
for j=1:4
zl(ij)=fscanf(fp‘%f‘1);
end % read branch parameters
end
fscanf(fp‘%s‘1); % read one string
N=zeros(node3); % save:确定所有节点的功率值,保存i P Q
for i=1:node
for j=1:3
N(ij)=fscanf(fp‘%f‘1); % read generator parameters
end
end
sortrows(N); %按节点编号行排序
PQ=zeros(2*node1); %将节点功率转换为列向量的形式
for i=1:node
PQ(2*i-1)=N(i2);
PQ(2*i)=N(i3);
end
fscanf(fp‘%s‘1); % read one string
Bus=zeros(kBus4); % save known Bus: i j Pij Qij
for i=1:kBus
for j=1:4
Bus(ij)=fscanf(fp‘%f‘1);
end % read generator parameters
end
fclose(fp);
%% 形成节点导纳矩阵 G+jB
G=zeros(nodenode);
B=zeros(nodenode);
for k=1:nzl
i=zl(k1);
j=zl(k2);
h=zl(k3)*zl(k3)+zl(k4)*zl(k4);
f=zl(k3)/h; % branch conductance
g=-zl(k4)/h; % branch susceptance
G(ii)=G(ii)+f;
G(jj)=G(jj)+f;
B(ii)=B(ii)+g;
B(jj)=B(jj)+g;
G(ij)=G(ij)-f;
G(ji)=G(ji)-f;
B(ij)=B(ij)-g;
B(ji)=B(ji)-g;
end
G; % show
B; % show
i=0;
%% Assign initial values for bus voltage e1 f1 e2 f2...
V=zeros(2*node1); % save: e1 f1 e2 f2 ...
for i=1:node
V(2*i-1)=1;
end
V(59)=0.9344;
V(60)=-0.2133;
%% State Estimation iteration
iter=0; % iteration number
F=zeros(2*node-2+2*kBus1);
while iter<100
% Generate the Power Flow Matrix z=h(x)
k=0;
for i=1:node-1 % Node Power
f=0.0; g=0.0;
for j=1:node
f=f+G(ij)*V(2*j-1)-B(ij)*V(2*j);
g=g+G(ij)*V(2*j)+B(ij)*V(2*j-1);
end
F(k+1)=V(2*i-1)*f+V(2*i)*g;
F(k+2)=V(2*i)*f-V(2*i-1)*g;
k=k+2;
end
for i=1:kBus % Branch Power
j=Bus(i1);m=Bus(i2);
for o=1:nzl
o1=zl(o1);o2=zl(o2);
if j==o1
if m==o2
z1=zl(o3)*zl(o3)+zl(o4)*zl(o4);
d1=V(2*j-1)-V(2*m-1); % e(i)-e(j)
d2=V(2*j)-V(2*m); % f(i)-f(j)
d3=d1*zl(o3)+d2*zl(o4);
d4=d1*zl(o4)-d2*zl(o3);
d5=V(2*j-1)*d3-V(2*j)*d4;
d6=V(2*j)*d3+V(2*j-1)*d4;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4028 2018-04-18 11:05 iSE30Bus.txt
文件 9235 2018-04-18 22:16 StateEstimation.m
----------- --------- ---------- ----- ----
13263 2
- 上一篇:雷达系统设计MATLAB仿真.zip
- 下一篇:mpc预测控制算法
相关资源
- 系统辨识与MATLAB仿真程序与剖析夹
- 系统辨识参数辨识matlab程序
- 非线性系统辨识
- Optimal State Estimation(最优状态估计)
- EKF扩展卡尔曼滤波车身状态估计
- 最小二乘法系统辨识matlab 程序
- 粒子群系统辨识
- 自适应与系统辨识中增广递推最小二
- LSM和RLS算法实现系统辨识和逆辨识
- 电力系统状态估计MATLAB算法
- matlab UKF 状态估计软件包
- 系统辨识部分算法matlab程序
- 系统辨识及神经网络
- 分布式电力系统状态估计完整程序
- 系统辨识相关分析法脉冲响应模型参
- 系统辨识与自适应控制MATLAB仿真 全部
- 剑桥系统辨识工具箱(system identific
评论
共有 条评论