Putting a capacitor in the thread of the load distribution (backward and forward method)
3 次查看(过去 30 天)
显示 更早的评论
I have a MATLAB code of load distribution using backward and forward method. I want to have a table consisting of capacitor values (for example, 100 kilovar, 125 kilovar, etc.) and calculate the reactive power of the feeder. I put the capacitor in each of the busses to check the loss where it is less. In the output, a table should be given that each bus can have the least losses with the amount of capacitor capacity. Can anyone help me in this regard?
I want to do this with For loops.
Code:
LD = load('linedata.m'); %line data
BD = load('busdata.m'); %bus data
%for transform data to pu, first define basic power and basic voltage
Sbase = 100; %MVA [Power]
Vbase = 11; %KV [Voltage]
Zbase = (Vbase^2)/Sbase; %[Impedance]
%convert to pu data
LD(:,4:5) = LD(:,4:5)/Zbase;
BD(:,2:3) = BD(:,2:3)/(1000*Sbase);
rowLD = 32;
rowBD = 33;
Sload = complex(BD(:,2),BD(:,3)); %power of each load
V = ones(rowBD,1); %initial voltage value.
Z = complex(LD(:,4),LD(:,5));
Iline = zeros(rowLD,1);
Iter = 2000;
%% The algorithm
%Backward
for i=1:Iter
Iload = conj(Sload/V);
for j = size(LD,1):-1:1 %start from the end of the feeder
r = [];
c = [];
[r c] = find(LD(:,2:3)==LD(j,3));
if size(r,1)==1
Iline(LD(j,1)) = Iload(LD(j,3));
else
Iline(LD(j,1)) = Iload(LD(j,3))+sum(Iline(LD(r,1)))-Iline(LD(j,1));
end
end
%Forward
for h = 1:rowLD
V(LD(h,3)) = V(LD(h,2))-Iline(LD(h,1))*Z(h);
end
end
Voltage = abs(V);
Vangle = angle(V);
%% Losses
P = real(Z.*(Iline.^2));
Q = imag(Z.*(Iline.^2));
%% Plot
plot(Voltage)
Bus data:
%line no. P (KVA) Q (KVA)
1 0 0
2 100 60
3 90 40
4 120 80
5 60 30
6 60 20
7 200 100
8 200 100
9 60 20
10 60 20
11 45 30
12 60 35
13 60 35
14 120 80
15 60 10
16 60 20
17 60 20
18 90 40
19 90 40
20 90 40
21 90 40
22 90 40
23 90 50
24 420 200
25 420 200
26 60 25
27 60 25
28 60 20
29 120 70
30 200 600
31 150 70
32 210 100
33 60 40
Line data:
%Line no. From To R X
1 1 2 0.0922 0.0470
2 2 3 0.4930 0.2511
3 3 4 0.3660 0.1864
4 4 5 0.3811 0.1941
4 5 6 0.8190 0.7070
6 6 7 0.1872 0.6188
7 7 8 0.7114 0.2351
8 8 9 1.0300 0.7400
9 9 10 1.0440 0.7400
10 10 11 0.1966 0.0650
11 11 12 0.3744 0.1238
12 12 13 1.4680 1.1550
13 13 14 0.5416 0.7129
14 14 15 0.5910 0.5260
15 15 16 0.7463 0.5450
16 16 17 1.2890 1.7210
17 17 18 0.7320 0.5740
18 2 19 0.1640 0.1565
19 19 20 1.5042 1.3554
20 20 21 0.4095 0.4784
21 21 22 0.7089 0.9373
22 3 23 0.4512 0.3083
23 23 24 0.8980 0.7097
24 24 25 0.8960 0.7011
25 6 26 0.2030 0.1034
26 26 27 0.2842 0.1447
27 27 28 1.0590 0.9337
28 28 29 0.8042 0.7006
29 29 30 0.5075 0.2585
30 30 31 0.9744 0.9630
31 31 32 0.3105 0.3619
32 32 33 0.3410 0.5302
0 个评论
采纳的回答
VBBV
2022-12-7
You can obtain it by multiplying the Iline and V and display them in table
LD = [%Line no. From To R X
1 1 2 0.0922 0.0470
2 2 3 0.4930 0.2511
3 3 4 0.3660 0.1864
4 4 5 0.3811 0.1941
4 5 6 0.8190 0.7070
6 6 7 0.1872 0.6188
7 7 8 0.7114 0.2351
8 8 9 1.0300 0.7400
9 9 10 1.0440 0.7400
10 10 11 0.1966 0.0650
11 11 12 0.3744 0.1238
12 12 13 1.4680 1.1550
13 13 14 0.5416 0.7129
14 14 15 0.5910 0.5260
15 15 16 0.7463 0.5450
16 16 17 1.2890 1.7210
17 17 18 0.7320 0.5740
18 2 19 0.1640 0.1565
19 19 20 1.5042 1.3554
20 20 21 0.4095 0.4784
21 21 22 0.7089 0.9373
22 3 23 0.4512 0.3083
23 23 24 0.8980 0.7097
24 24 25 0.8960 0.7011
25 6 26 0.2030 0.1034
26 26 27 0.2842 0.1447
27 27 28 1.0590 0.9337
28 28 29 0.8042 0.7006
29 29 30 0.5075 0.2585
30 30 31 0.9744 0.9630
31 31 32 0.3105 0.3619
32 32 33 0.3410 0.5302]; %load('linedata.m'); %line data
BD = [%line no. P (KVA) Q (KVA)
1 0 0
2 100 60
3 90 40
4 120 80
5 60 30
6 60 20
7 200 100
8 200 100
9 60 20
10 60 20
11 45 30
12 60 35
13 60 35
14 120 80
15 60 10
16 60 20
17 60 20
18 90 40
19 90 40
20 90 40
21 90 40
22 90 40
23 90 50
24 420 200
25 420 200
26 60 25
27 60 25
28 60 20
29 120 70
30 200 600
31 150 70
32 210 100
33 60 40
]; %load('busdata.m'); %bus data
%for transform data to pu, first define basic power and basic voltage
Sbase = 100; %MVA [Power]
Vbase = 11; %KV [Voltage]
Zbase = (Vbase^2)/Sbase; %[Impedance]
%convert to pu data
LD(:,4:5) = LD(:,4:5)/Zbase
BD(:,2:3) = BD(:,2:3)/(1000*Sbase);
rowLD = 32;
rowBD = 33;
Sload = complex(BD(:,2),BD(:,3)); %power of each load
V = ones(rowBD,1); %initial voltage value.
Z = complex(LD(:,4),LD(:,5));
Iline = zeros(rowLD,1);
Iter = 2000;
%% The algorithm
%Backward
for i=1:Iter
Iload = conj(Sload/V);
for j = size(LD,1):-1:1 %start from the end of the feeder
r = [];
c = [];
[r c] = find(LD(:,2:3)==LD(j,3));
if size(r,1)==1
Iline(LD(j,1)) = Iload(LD(j,3));
V(LD(j,3)) = V(LD(j,2))-Iline(LD(j,1))*Z(j);
R_pow(j) = V(LD(j,3)).*Iline(LD(j,1)); % reactive power
else
Iline(LD(j,1)) = Iload(LD(j,3))+sum(Iline(LD(r,1)))-Iline(LD(j,1));
V(LD(j,3)) = V(LD(j,2))-Iline(LD(j,1))*Z(j);
R_pow(j) = V(LD(j,3)).*Iline(LD(j,1)); % reactive power
end
end
%Forward
end
Voltage = abs(V);
Vangle = angle(V);
%% Losses
P = real(Z.*(Iline.^2));
Q = imag(Z.*(Iline.^2));
T = table(abs(R_pow).',P,Q,'VariableNames',{'Reactive Power Capacity', 'Loss-Active','Loss-Reactive'})
%% Plot
plot(Voltage)
3 个评论
VBBV
2022-12-8
"I want to have a table consisting of capacitor values (for example, 100 kilovar, 125 kilovar, etc.) and calculate the reactive power of the feeder. I put the capacitor in each of the busses to check the loss where it is less. In the output, a table should be given that each bus can have the least losses with the amount of capacitor capacity"
From your question and the description, it seems you wanted a table instead of graphs. If you need additional help on required graphs, please post a new question.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Power Converters 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!