0% found this document useful (0 votes)
55 views5 pages

Listing Program Matlab

This MATLAB program simulates power flow analysis of an 84 bus system under normal operating conditions. It initializes parameters, builds the bus admittance and impedance matrices, calculates bus voltages and line currents through an iterative process, and outputs results including line losses, active and reactive power flows.

Uploaded by

Yoakim Mora
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views5 pages

Listing Program Matlab

This MATLAB program simulates power flow analysis of an 84 bus system under normal operating conditions. It initializes parameters, builds the bus admittance and impedance matrices, calculates bus voltages and line currents through an iterative process, and outputs results including line losses, active and reactive power flows.

Uploaded by

Yoakim Mora
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

LISTING PROGRAM MATLAB

clear all; clc;


tegangan=20; MVAb=100; Zb=tegangan^2/MVAb;
fprintf('\n');
nn=84;
fprintf(' Kondisi normal \n');
linedata = [1 2 0.1296 0.1983
2 3 0.0054 0.0082625
3 4 0.0108 0.016525
4 5 0.0108 0.016525
5 6 0.0108 0.016525
6 7 0.0108 0.016525
7 8 0.0108 0.016525
8 9 0.0216 0.03305
9 10 0.0108 0.016525
10 11 0.0108 0.016525
11 12 0.0108 0.016525
12 13 0.0054 0.0082625
13 14 0.0054 0.0082625
14 15 0.0108 0.016525
15 16 0.0108 0.016525
16 17 0.0216 0.03305
17 18 0.0108 0.016525
18 19 0.0216 0.03305
19 20 0.0108 0.016525
20 21 0.0108 0.016525
21 22 0.0054 0.0082625
22 23 0.0216 0.03305
23 24 0.0108 0.016525
24 25 0.0216 0.03305
25 26 0.013608 0.0208215
26 27 0.0054 0.0082625
27 28 0.0054 0.0082625
28 29 0.0216 0.03305
29 30 0.0108 0.016525
30 31 0.0108 0.016525
31 32 0.0216 0.03305
32 33 0.0108 0.016525
33 34 0.0108 0.016525
34 35 0.0108 0.016525
35 36 0.0054 0.0082625
36 37 0.0054 0.0082625
37 38 0.0108 0.016525
38 39 0.0108 0.016525
39 40 0.0108 0.016525
40 41 0.0054 0.0082625
41 42 0.0108 0.016525
42 43 0.0108 0.016525
43 44 0.0054 0.0082625
44 45 0.0108 0.016525
45 46 0.0108 0.016525
46 47 0.0108 0.016525
47 48 0.0054 0.0082625
48 49 0.0108 0.016525
49 50 0.0108 0.016525
50 51 0.0216 0.03305
51 52 0.0108 0.016525
52 53 0.0108 0.016525
5 54 0.0108 0.016525
9 55 0.0108 0.016525
11 56 0.0108 0.016525
17 57 0.0108 0.016525
57 58 0.0108 0.016525
23 59 0.0108 0.016525
25 60 0.0108 0.016525
30 61 0.0108 0.016525
32 62 0.0216 0.03305
4 63 0.0216 0.03305
63 64 0.0108 0.016525
10 65 0.02808 0.042965
65 66 0.0216 0.03305
19 67 0.0054 0.0082625
27 68 0.0054 0.0082625
68 69 0.0108 0.016525
69 70 0.0108 0.016525
70 71 0.0054 0.0082625
71 72 0.0108 0.016525
29 73 0.0216 0.03305
73 74 0.0054 0.0082625
74 75 0.0054 0.0082625
33 76 0.0054 0.0082625
37 77 0.0216 0.03305
41 78 0.0216 0.03305
46 79 0.0216 0.03305
79 80 0.0108 0.016525
80 81 0.0108 0.016525
51 82 0.0108 0.016525
52 83 0.0054 0.0082625
53 84 0.0054 0.0082625];

busdata = [2 0.073214106 0.045651147


3 0.072429325 0.043622212
4 0 0
5 0 0
6 0.012654291 0.007890322
7 0.09373908 0.058449081
8 0.061872176 0.038579121
9 0 0
10 0 0
11 0 0
12 0.08272506 0.051581513
13 0.051859988 0.032336231
14 0.021814487 0.013601973
15 0.070961366 0.044246498
16 0.068899779 0.042961039
17 0 0
18 0.005475414 0.003414082
19 0 0
20 0.044762187 0.027910541
21 0.057486634 0.035844604
22 0.073756436 0.045989308
23 0 0
24 0.04435086 0.027654065
25 0 0
26 0.14414027 0.0898757
27 0 0
28 0.043062357 0.026850645
29 0 0
30 0 0
31 0.18710272 0.11666405
32 0 0
33 0 0
34 0.0679932 0.04239576
35 0.10057328 0.062710402
36 0.044064055 0.027475223
37 0 0
38 0.08760662 0.054625312
39 0.039996599 0.024939056
40 0.04544324 0.028335194
41 0 0
42 0.0019908 0.001063269
43 0.08134901 0.050723499
44 0.003181931 0.001792122
45 0.008389116 0.00523086
46 0 0
47 0.044741949 0.027897923
48 0.10168626 0.063404368
49 0.071811535 0.044776608
50 0.040229313 0.025084159
51 0 0
52 0 0
53 0 0
54 0.00272737 0.001536105
55 0.11279352 0.070330077
56 0.08631085 0.046097847
57 0.065079206 0.040578805
58 0.042708236 0.026629834
59 0.026438424 0.016485138
60 0.046775672 0.029166012
61 0.036137731 0.022532941
62 0.039657642 0.024727702
63 0.051468889 0.03209237
64 0.038640781 0.024093657
65 0.010000354 0.005632384
66 0.07050247 0.043960373
67 0.07376442 0.039396902
68 0.046097767 0.028743312
69 0.002575849 0.001450765
70 0.004545615 0.002560174
71 0.060859226 0.03794751
72 0.07972203 0.049709036
73 0.044898395 0.027995472
74 0.006101175 0.003804262
75 0.014236077 0.008876613
76 0.055274693 0.031131723
77 0.065079206 0.040578805
78 0.028811107 0.017964573
79 0.09042089 0.048292978
80 0.074841085 0.046665619
81 0.066180053 0.041265212
82 0.048183642 0.030043915
83 0.19279337 0.10296917
84 0.0275745 0.015530468];
Pbeban = busdata(:,2);
Qbeban = busdata(:,3);
S = (Pbeban+(Qbebanj));

% Membangun K-matrik
bus1 = linedata(:,1); % bus awal
bus2 = linedata(:,2); % bus akhir
K=diag(ones(nn-1,1));
for i=2:(nn-1)
x=linedata(i,1)-1;
y=linedata(i,2)-1;
K(x,y)=-1;
end

%Inisiasi BIBC dan BCBV


BIBC = inv(K);
BCBV = BIBC';

% Membangun matrik impedansi


Zmatrik = zeros(nn-1);
for i=1:(nn-1)
Zmatrik(:,i) = linedata(i,3)+(linedata(i,4)*j);
end

%tegangan
V = zeros((nn-1),1);
V(:,1) = tegangan;
I = zeros((nn-1),1);
% S = (busdata(:,2)+(busdata(:,3)*j));
Icek = 1; % inisiasi itertasi
t = 1;
while (Icek > 0.00001)
DLF = (BCBV.*Zmatrik)*(BIBC);
dV = DLF*I(:,1,t);
t = t+1;
Vu = V-dV;
I(:,1,t) = conj(S./Vu);
Icek = max(abs(I(:,1,t))-abs(I(:,1,t-1)));
end
Vakhir= [tegangan; Vu];

%tampilan hasil iterasi


arus1 = BIBC*I(:,1,t)*1000;
arus = [max(arus1);arus1];
bus_arus = abs(arus./sqrt(3));
arus_losses=(arus1./sqrt(3));
mag_arusL=abs(arus_losses);
angle_arusL = angle(arus_losses).*(180/pi);

SL = zeros((nn-1),1);
Vd = zeros((nn-1),1);
for k=1:(nn-1)
Vd(k,1)=(arus1(k,1)/1000)*(linedata(k,3)+linedata(k,4)*j);
Vd1(k,1)=100*(abs(Vakhir(k,1))/tegangan);
Sa(k,1)=Vakhir(linedata(k,1),1)*conj(arus1(k,1));
Sb(k,1)=Vakhir(linedata(k,2),1)*conj(-(arus1(k,1)));
SL(k,1)=Sa(k,1)+Sb(k,1);
end
Psal=real(Sa);
Qsal=imag(Sa);
cosphi=Psal./abs(Sa);
PL=real(SL);
plt2=sum(PL)
QL=imag(SL);
qlt=sum(QL);

You might also like