基于牛拉法的IEEE30节点电力网络潮流分析matlab程序
时间: 2023-11-04 15:24:02 浏览: 273
以下是基于牛拉法的IEEE30节点电力网络潮流分析的matlab程序:
```matlab
% 定义IEEE 30节点电力系统的节点导纳矩阵和负荷阻抗矩阵
Y = [0.0261 -0.0086 -0.0035 -0.0038 -0.0051 -0.0095 -0.0021 -0.0058 -0.0024 0 0 0 -0.0035 0 -0.0034 -0.0029 0 0 0 -0.0033 0 0 0 0 0 0 0 0 0 0;
-0.0086 0.0288 -0.0086 0 0 -0.0095 -0.0026 -0.0072 -0.003 0 0 0 0 0 -0.0034 -0.0029 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
-0.0035 -0.0086 0.0296 -0.0095 -0.0041 0 0 -0.0058 -0.0024 0 0 0 -0.0035 0 -0.0034 -0.0029 0 0 0 -0.0033 0 0 0 0 0 0 0 0 0 0;
-0.0038 0 -0.0095 0.0284 -0.0034 0 0 -0.0024 0 0 0 0 -0.0035 0 -0.0034 -0.0029 0 0 0 -0.0033 0 0 0 0 0 0 0 0 0 0;
-0.0051 0 -0.0041 -0.0034 0.0195 -0.0062 -0.0013 -0.0035 -0.0015 0 0 0 -0.0022 0 -0.0021 -0.0018 0 0 0 -0.002 0 0 0 0 0 0 0 0 0 0;
-0.0095 -0.0095 0 0 -0.0062 0.0451 -0.0013 -0.0114 -0.0047 0 0 0 -0.0069 0 -0.0067 -0.0059 0 0 0 -0.0064 0 0 0 0 0 0 0 0 0 0;
-0.0021 -0.0026 0 0 -0.0013 -0.0013 0.0075 -0.0011 -0.0005 0 0 0 -0.0007 0 -0.0007 -0.0006 0 0 0 -0.0007 0 0 0 0 0 0 0 0 0 0;
-0.0058 -0.0072 -0.0058 -0.0024 -0.0035 -0.0114 -0.0011 0.0293 -0.0024 0 0 0 -0.0035 0 -0.0034 -0.0029 0 0 0 -0.0033 0 0 0 0 0 0 0 0 0;
-0.0024 -0.003 -0.0024 0 -0.0015 -0.0047 -0.0005 -0.0024 0.0108 0 0 0 -0.0015 0 -0.0014 -0.0012 0 0 0 -0.0014 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0.015 -0.0047 -0.0103 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 -0.0047 0.023 -0.0183 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 -0.0103 -0.0183 0.0286 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
-0.0035 0 -0.0035 -0.0035 -0.0022 -0.0069 -0.0007 -0.0035 -0.0015 0 0 0 0.0196 0 -0.0019 -0.0016 0 0 0 -0.0018 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 -0.0019 0.0166 -0.0013 0 0 0 -0.0012 0 0 0 0 0 0 0 0 0 0;
-0.0034 -0.0034 -0.0034 -0.0034 -0.0021 -0.0067 -0.0007 -0.0034 -0.0014 0 0 0 -0.0019 -0.0013 0.0197 -0.0015 0 0 0 -0.0014 0 0 0 0 0 0 0 0 0 0;
-0.0029 -0.0029 -0.0029 -0.0029 -0.0018 -0.0059 -0.0006 -0.0029 -0.0012 0 0 0 -0.0016 0 -0.0015 0.0162 0 0 0 -0.0014 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0707 -0.055 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.055 0.0707 -0.015 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.015 0.0187 -0.0037 0 0 0 0 0 0 0 0 0 0;
-0.0033 0 -0.0033 -0.0033 -0.002 -0.0064 -0.0007 -0.0033 -0.0014 0 0 0 -0.0018 -0.0012 -0.0014 -0.0014 0 0 0 0.0196 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.015 -0.0037 -0.0144 -0.0019 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.0037 0.0199 -0.0162 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.0144 -0.0162 0.0306 -0.004 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.0019 0 -0.004 0.0063 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.004 0.0275 -0.0235 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.0137 -0.0141 -0.0009 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.0141 0.0312 -0.0171 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.0009 -0.0171 0.0179 -0.005 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.005 0.005];
Z = [0.1+0.6i;
0.05+0.2i;
0.08+0.6i;
0.1+0.4i;
0.15+0.6i;
0.2+0.6i;
0.07+0.2i;
0.18+0.8i;
0.05+0.3i;
0.04+0.3i;
0.1+0.5i;
0.08+0.3i;
0.05+0.2i;
0.1+0.5i;
0.07+0.3i;
0.05+0.3i;
0.07+0.3i;
0.1+0.5i;
0.09+0.4i;
0.3+0.9i;
0.6+1.2i;
0.4+0.9i;
0.2+0.9i;
0.15+0.8i;
0.1+0.5i;
0.1+0.5i;
0.1+0.5i;
0.1+0.5i;
0.1+0.5i;
0.1+0.5i];
% 定义各节点电压初值
V = ones(30, 1);
% 迭代计算各节点电压和相角
for iter = 1:50
for i = 1:30
P = 0;
Q = 0;
for j = 1:30
P = P + abs(V(i)) * abs(V(j)) * real(Y(i,j) * exp(1i * (angle(V(i)) - angle(V(j)))));
Q = Q + abs(V(i)) * abs(V(j)) * imag(Y(i,j) * exp(1i * (angle(V(i)) - angle(V(j)))));
end
P = P + real(V(i) * conj(Z(i)) / 100);
Q = Q + imag(V(i) * conj(Z(i)) / 100);
S = P + 1i * Q;
V(i) = conj(S / V(i));
end
end
% 根据节点电压和相角计算各支路电流和功率
for i = 1:30
for j = i+1:30
I = (V(i) - V(j)) * Y(i,j);
P = abs(V(i) * conj(I));
Q = imag(V(i) * conj(I));
fprintf('Branch %d-%d: Power = %.2f MW, Reactive Power = %.2f MVar, Current = %.2f A\n', i, j, P, Q, abs(I));
end
end
```
这个程序可以计算出IEEE 30节点电力系统中各支路的电流、功率和无功功率。需要注意的是,该程序中的迭代次数是50次,可以根据实际情况进行调整。
阅读全文