Clear Filters
Clear Filters

Placing the capacitor in the distribution network

1 view (last 30 days)
Hello, I want to add a capacitor in my code, which is related to the backward-forward method of load distribution, and generate reactive power and improve the voltage profile at the output (the voltage profile before and after the capacitor is compared on the same figure) . Also, give the number of capacitors used and the capacity of the capacitor and the bus used.
The capacity of the capacitor is determined from 25 to 1000 with a step of 25.
Can someone please help me?
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

Answers (0)

Community Treasure Hunt

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

Start Hunting!