Putting a capacitor in the thread of the load distribution (backward and forward method)

3 visualizaciones (últimos 30 días)
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

Respuesta aceptada

VBBV
VBBV el 7 de Dic. de 2022
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
LD = 32×5
1.0000 1.0000 2.0000 0.0762 0.0388 2.0000 2.0000 3.0000 0.4074 0.2075 3.0000 3.0000 4.0000 0.3025 0.1540 4.0000 4.0000 5.0000 0.3150 0.1604 4.0000 5.0000 6.0000 0.6769 0.5843 6.0000 6.0000 7.0000 0.1547 0.5114 7.0000 7.0000 8.0000 0.5879 0.1943 8.0000 8.0000 9.0000 0.8512 0.6116 9.0000 9.0000 10.0000 0.8628 0.6116 10.0000 10.0000 11.0000 0.1625 0.0537
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'})
T = 32×3 table
Reactive Power Capacity Loss-Active Loss-Reactive _______________________ ___________ _____________ 0.043531 0.00013123 -9.7155e-05 0.037805 0.00053641 -0.00042162 0.026592 0.00018411 -0.00017698 0.024958 0.00017154 -0.00016599 0.023751 0 0 0.011108 6.993e-05 2.8834e-05 0.0089637 4.9071e-05 -3.0574e-05 0.0068336 5.6198e-05 -1.3637e-05 0.0062074 4.7192e-05 -1.2789e-05 0.005628 5.4303e-06 -3.6064e-06 0.0051295 8.7704e-06 -5.5028e-06 0.0044635 3.7081e-05 -7.0659e-06 0.0038286 1.3327e-05 1.3234e-06 0.0025563 5.2777e-06 4.4316e-07 0.0020147 3.8386e-06 -3.7431e-07 0.0014445 4.5736e-06 7.7065e-07
%% Plot
plot(Voltage)
  3 comentarios
VBBV
VBBV el 8 de Dic. de 2022
"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.

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by