短路计算IEEE39节点matlab代码
时间: 2023-08-12 17:06:30 浏览: 176
以下是一个简单的IEEE 39节点系统的短路计算的Matlab代码示例:
```matlab
%定义系统参数
Zbase = (115^2)/100000; %基准阻抗
Zline = [0.025+0.15i,0.025+0.15i,0.025+0.15i,0.025+0.15i,0.025+0.15i,0.025+0.15i,0.025+0.15i,0.025+0.15i,0.025+0.15i,0.025+0.15i,0.025+0.15i,0.025+0.15i,0.03+0.18i,0.03+0.18i,0.03+0.18i,0.03+0.18i,0.03+0.18i,0.03+0.18i,0.03+0.18i,0.03+0.18i,0.03+0.18i,0.03+0.18i,0.03+0.18i,0.03+0.18i,0.03+0.18i,0.03+0.18i,0.03+0.18i];
Zbus = [0.02+0.2i,0.01+0.1i,0.01+0.1i,0.00+0.1i,0.00+0.1i,0.00+0.1i,0.03+0.3i,0.03+0.3i,0.00+0.3i,0.00+0.3i,0.00+0.3i,0.00+0.3i,0.00+0.2i,0.00+0.2i,0.00+0.2i,0.00+0.2i,0.00+0.2i,0.00+0.2i,0.00+0.2i,0.00+0.2i,0.00+0.2i,0.00+0.2i,0.00+0.2i,0.00+0.2i,0.00+0.2i,0.00+0.2i];
Vbase = 115; %基准电压
%计算阻抗矩阵
Zline = Zline.*Zbase;
Zbus = Zbus.*Zbase;
Ybus = zeros(39,39);
for i=1:39
for j=1:39
if i==j
for k=1:39
Ybus(i,j) = Ybus(i,j) + 1/Zbus(i,k);
end
else
Ybus(i,j) = -1/Zbus(i,j);
end
end
end
%设置故障类型和位置
bus_fault = 10; %故障节点
fault_type = '3P'; %故障类型,3P表示三相短路
%计算短路电流
if strcmp(fault_type,'3P')
%三相短路
Zf = 0;
for k=1:24
Zf = Zf + Zline(k);
end
Zf = Zf/24;
If = 3*Vbase/(sqrt(3)*Zf);
else
%单相接地短路
Zf = Zline(bus_fault);
If = Vbase/Zf;
end
%计算短路电流向量
Ibus = zeros(39,1);
for i=1:39
if i==bus_fault
if strcmp(fault_type,'3P')
Ibus(i) = -3*If;
else
Ibus(i) = -If;
end
else
Ibus(i) = Ybus(i,bus_fault)*Ibus(bus_fault);
end
end
%输出结果
disp('短路电流向量:');
disp(Ibus);
```
请注意,这只是一个简单的示例代码,实际应用中可能需要考虑更多的因素,例如电源的不对称性和非线性等。
阅读全文