KODE TRANSMISI SIRKIT R (ohms) X (ohms) Panjan g (Km) DARI BUS KE BUS DARI KE

  LA AMPIRAN 1. ONELI SUMBA

    Universitas Sumatera Utara

  LAMPIRAN 2. PEMBANGKIT DI SUMATERA BAGIAN UTARA NO GARDU NAMA PEMBANGKIT Kapasitas (MW)

  10 Sipansipahoras 2 PLTA SIPANSIPAHORAS 2

  17 Banda Aceh PLTD Leung Bata Sewa 147.88

  11

  16 Lhokseumawe PLTD Cot Trueng Sewa

  15 Paya Pasir PLTG PAYA PASIR SEWA 122.5

  8

  14 Lhokseumawe PLTD Cot Trueng

  49.82

  13 Banda Aceh PLTD Leung Bata

  12.5

  12 Titi Kuning PLTD TITI KUNING

  80

  11 Renun PLTA RENUN

  17

  33

  1 Belawan PLTGU BELAWAN 585.9

  9 Sipansipahoras 1 PLTA SIPANSIPAHORAS 1

  11

  8 Glugur PLTG GLUGUR

  90

  7 Paya Pasir PLTG PAYA PASIR

  90

  INALUM

  6 Kuala tanjung

  10

  5 Berastagi PLTP SIBAYAK

  4 Sigli PLTU Nagan R 200

  3 Labuhan Angin PLTU LABUHAN ANGIN 140

  2 Belawan PLTU BELAWAN 260

  TOTAL 1868.6 Universitas Sumatera Utara

  LAMPIRAN 3. DATA SALURAN TRANSMISI No SALURAN TRANSMISI

KODE

TRANSMISI

SIRKIT R

  20 Paya Pasir Sei Rotan

  6.2

  19 Belawan (Tu) Labuhan

  10

  11

  1 0.45 1.125

  2.95

  13

  10

  30 1 2.475

  9.45

  23.72

  21 Paya Pasir Sei Rotan

  13

  30 2 2.475

  13 2 0.225 1.575

  18 Belawan (Tu) Paya Pasir

  23.72

  10

  9

  1

  1.35

  10.35

  35

  16 Belawan (Gu) Binjai

  9

  6.2

  2

  1.35

  10.35

  35

  17 Belawan (Tu) Paya Pasir

  10

  13 1 0.225 1.575

  9.45

  22 Paya Pasir Mabar

  15 Belawan (Gu) Binjai

  27 Sei Rotan Kim

  21.27

  26 Sei Rotan Kim

  30

  31

  1 1.35 6.075

  20.74

  30

  2.25

  31

  2 1.35 6.075

  20.74

  28 Sei Rotan Titi Kuning

  30

  18

  1 1.8 6.975

  8.55

  2

  13

  24 Paya Pasir Paya Geli

  14 1 0.675 2.475

  5.93

  23 Paya Pasir Mabar

  13

  14 2 0.675 2.475

  5.93

  13

  15

  15

  1

  2.25

  8.55

  21.27

  25 Paya Pasir Paya Geli

  13

  10

  26.39

  (ohms)

  8 2 9.2249

  6

  8 1 9.2249

  31.05

  78.27

  5 Langsa P. Brandan

  6

  31.05

  24.12

  78.27

  6 Idie Lhokseumawe

  5

  4 1 9.675 32.625

  81.19

  7 Lhokseumawe Bireun

  4 Langsa P. Brandan

  9.45

  3 1 7.2000

  18.45

  X (ohms) Panjan g (Km) DARI BUS KE BUS DARI KE

  1 Langsa Idie

  6

  5

  1

  5.4

  46.3

  7 1 2.925

  2 Langsa Lhokseumawe

  6

  4

  1

  15.3 50.85 128.49

  3 Langsa Tualang Cut

  6

  4

  24.3

  2 0.45 6.975

  36.45

  36.45

  91.9

  12 Sigli

  B. Aceh

  2

  1 2 11.025

  91.9

  2

  13 Belawan (Gu) Sei Rotan

  10

  30 1 0.4275 6.6262

  25.07

  14 Belawan (Gu) Sei Rotan

  10

  30

  1 1 11.025

  B. Aceh

  61.3

  3

  8 Lhokseumawe Bireun

  4

  3 2 7.2000

  24.3

  61.3

  9 Bireun Sigli

  2

  11 Sigli

  1 11.7 39.375

  99.2

  10 Bireun Sigli

  3

  2

  2 11.7 39.375

  99.2

  17.2 Universitas Sumatera Utara

  No SALURAN TRANSMISI

KODE

TRANSMISI

SIRKIT R

  52.32

  46 Titi Kuning Brastagi

  18

  20

  1

  6.3

  20.7

  47 Titi Kuning Brastagi

  7.2

  18

  20

  2

  6.3

  20.7

  52.32

  18.2

  19 2 2.025

  29

  1.35

  1.35

  3.2

  43 Titi Kuning Namurambe

  18

  17

  1

  4.95

  18

  12.44

  44 Titi Kuning Gis Listrik

  18

  19 1 2.025

  7.2

  18.2

  45 Titi Kuning Gis Listrik

  48 Perbaungan Tebing

  28 1 4.275

  1

  12

  7

  52 Sipan Sihaporas 2

  Sibolga

  44

  42

  1 1.35 4.725

  53 Sipan Sihaporas 1

  0.9

  Sibolga

  43

  42

  1

  0.45

  1.8

  4.45 No SALURAN TRANSMISI KODE SIRKIT R

  2.7

  1

  14.4

  50 Renun Sidikalang

  36.51

  49 Renun Brastagi

  21

  20 1 6.075

  19.8

  50.19

  21

  43

  22 1 2.925

  9.9

  24.89

  51 Sipan Sihaporas 2

  Sipan Sihaporas

  1

  44

  0.45

  12

  (ohms)

  1

  30

  32 1 0.675 3.375

  1

  33 Sei Rotan Tebing

  30

  28

  6.30

  7.76

  21.15

  53.48

  34 Paya Geli Binjai

  15

  9

  1

  0.9

  32 Sei Rotan Denai

  2.25

  13.92

  30 Sei Rotan Perbaungan

  X (ohms) Panjan g (Km) DARI BUS KE BUS DARI KE

  29 Sei Rotan Titi Kuning

  30

  18

  2 1.8 6.975

  17.2

  30

  0.45

  29

  1 6.3 21.375

  1

  31 Sei Rotan Tanjung Morawa

  30

  33

  1

  4.05

  35 Paya Geli Binjai

  11

  40 Binjai P. Brandan

  16 1 1.125 4.725

  11.92

  39 Paya Geli Glugur

  15

  16 2 1.125 4.725

  11.92

  9

  38 Paya Geli Glugur

  8 1 6.075 20.025

  50.8

  41 Binjai P. Brandan

  9

  8 2 6.075 20.025

  50.8

  42 Labuhan Lamhotma

  15

  1

  15

  15

  9

  2

  0.9

  4.05

  13.92

  36 Paya Geli Titi Kuning

  18

  1 1.8 7.425

  1

  3.15

  12.15

  30.43

  37 Paya Geli Namurambe

  15

  17

  X Panjan Universitas Sumatera Utara

  TRANSMISI (ohms) (ohms) g (Km) DARI BUS KE BUS DARI KE

  42 2 5.8500 19.575

  1

  38 1 10.935 31.432

  39

  74 G. Tua R. Prapat

  1

  36 1 10.507 30.172

  37

  73 Aek Kanopan Kisaran

  1

  1 5.76 18.832

  38

  37

  72 Aek Kanopan R. Prapat

  49.52

  24

  39

  69 Porsea Tarutung

  32.4

  81.5

  68 Porsea Tarutung

  25

  24 1 7.4249 24.525

  61.69

  25

  71 Tarutung Sibolga

  24 2 7.4249 24.525

  61.69

  70 Tarutung Sibolga

  24

  42 1 5.8500 19.575

  49.52

  75 G. Tua P. Sidempuan

  40 1 10.125

  23

  42

  22.5

  40 1 6.6599

  41

  82 Martabe P. Sidempuan

  14.85 49.05 124

  1

  40

  38

  81 R. Prapat P. Sidempuan

  36 1 11.925 40.05 101.04

  38

  80 R. Prapat Kisaran

  70.78

  40 1 8.3249 28.125

  79 Sibolga P. Sidempuan

  33.03

  77 Sibolga Labuhan Angin

  1

  76 Sibolga Labuhan Angin

  42

  45

  1 2.25 11.025

  38

  42

  14.16

  45

  2 2.25 11.025

  38

  78 Sibolga Martabe

  42

  41 2 1.665 5.625

  24 2 9.6749

  67 Tele Tarutung

  54 Tanjung Morawa

  49.4

  35

  60 Kuala Tanjung Kisaran

  57.01

  22.5

  6.75

  1

  36

  35

  59 Kuala Tanjung Kisaran

  1

  27 1 3.465 11.677

  28

  G. Para

  58 Tebing

  26 1 5.850 19.575

  2

  28

  Denai

  33

  32 1 0.675

  3.15

  11.15

  55 Tebing Kuala Tanjung

  35 1 4.275 14.175

  28

  35.73

  56 Tebing Kuala Tanjung

  28

  35 2 4.275 14.175

  35.73

  57 Tebing P. Siantar

  36

  6.75

  24 1 14.625 48.375 122

  1 7.65 25.425

  8.55

  28.8

  72.48

  64 Brastagi Sidikalang

  20

  22

  63.98

  25

  65 Sidikalang Tele

  22

  23 2 4.725 15.975

  40.35

  66 Sidikalang Tarutung

  22

  2

  26

  22.5

  1

  57.01

  61 P. Siantar

  G. Para

  26

  27 1 2.9025

  9.81

  62 P. Siantar Porsea

  63 P. Siantar Porsea

  26

  25

  1

  8.55

  28.8

  72.48

  56.62 Universitas Sumatera Utara LAMPIRAN  4. KODE PROGRAM KOMPUTER PENENTUAN SLACK BUS PADA JARINGAN TENAGA  LISTRIK  SUMBAGUT 150 KV MENGGUNAKAN METODE ARTIFICIAL BEE COLONY. 

  % M.FILE I. PENENTUAN_SB_SUMBAGUT basemva = 100; accuracy = 0.0001; accel = 1.8; maxiter = 500;

% Bus Bus Volt Angle ---Load--- -------Generator-- Static Mvar

% No code Mag. Degree MW Mvar MW Mvar Qmin Qmax +Qc/-Ql busdata=[1 1 1.0 0.0 31.5 15.0 49.82 0.0 0 0 0 2 2 1.0 0.0 11.8 7.2 200.0 0.0 0 0 0 3 0 1.0 0.0 19.1 11.8 0.0 0.0 0 0 0 4 2 1.0 0.0 34.9 21.8 8.0 0.0 0 0 0 5 0 1.0 0.0 10.4 6.4 0.0 0.0 0 0 0 6 0 1.0 0.0 8.2 5.1 0.0 0.0 0 0 0 7 0 1.0 0.0 8.6 5.3 0.0 0.0 0 0 0 8 0 1.0 0.0 24.5 15.2 0.0 0.0 0 0 0 9 0 1.0 0.0 44.1 27.0 0.0 0.0 0 0 0 10 2 1.0 0.0 0.0 0.0 595.9 0.0 0 0 0 11 0 1.0 0.0 9.0 5.6 0.0 0.0 0 0 0 12 0 1.0 0.0 5.3 3.3 0.0 0.0 0 0 0 13 2 1.0 0.0 36.0 21.3 90.0 0.0 0 0 0 14 0 1.0 0.0 11.7 6.8 0.0 0.0 0 0 0 15 0 1.0 0.0 66.7 41.1 0.0 0.0 0 0 0 16 2 1.0 0.0 81.7 51.4 11.0 0.0 0 0 0 17 0 1.0 0.0 18.8 11.6 0.0 0.0 0 0 0 18 2 1.0 0.0 0.0 0.0 12.5 0.0 0 0 0 19 0 1.0 0.0 16.0 10.2 0.0 0.0 0 0 0 20 2 1.0 0.0 16.0 10.2 10.0 0.0 0 0 0 21 2 1.0 0.0 0.0 0.0 80.0 0.0 0 0 0 22 0 1.0 0.0 7.0 12.0 0.0 0.0 0 0 0 23 0 1.0 0.0 5.3 3.3 0.0 0.0 0 0 0 24 0 1.0 0.0 8.0 4.5 0.0 0.0 0 0 0 25 0 1.0 0.0 5.7 3.5 0.0 0.0 0 0 0 26 0 1.0 0.0 30.4 18.6 0.0 0.0 0 0 0 27 0 1.0 0.0 4.8 2.9 0.0 0.0 0 0 0 28 0 1.0 0.0 25.3 15.6 0.0 0.0 0 0 0 29 0 1.0 0.0 15.7 9.7 0.0 0.0 0 0 0 30 0 1.0 0.0 43.3 28.6 0.0 0.0 0 0 0 31 0 1.0 0.0 33.5 20.7 0.0 0.0 0 0 0 32 0 1.0 0.0 27.1 16.7 0.0 0.0 0 0 0 33 0 1.0 0.0 22.4 13.9 0.0 0.0 0 0 0

  Universitas Sumatera Utara

  34 0 1.0 0.0 48.0 36.0 0.0 0.0 0 0 0 35 2 1.0 0.0 17.6 10.9 90.0 0.0 0 0 0 36 0 1.0 0.0 25.6 15.7 0.0 0.0 0 0 0 37 0 1.0 0.0 7.8 4.8 0.0 0.0 0 0 0 38 0 1.0 0.0 27.0 16.6 0.0 0.0 0 0 0 39 0 1.0 0.0 4.5 2.8 0.0 0.0 0 0 0 40 0 1.0 0.0 19.8 12.1 0.0 0.0 0 0 0 41 0 1.0 0.0 7.8 4.8 0.0 0.0 0 0 0 42 0 1.0 0.0 12.8 8.6 0.0 0.0 0 0 0 43 2 1.0 0.0 0.0 0.0 33.0 0.0 0 0 0 44 2 1.0 0.0 0.0 0.0 17.0 0.0 0 0 0 45 2 1.0 0.0 0.0 0.0 140.0 0.0 0 0 0]; % Line code % Bus bus R X 1/2 B = 1 for lines

% nl nr p.u. p.u. p.u. > 1 or < 1 tr. tap at bus nl

linedata=[1 2 0.0490 0.1618 0.0 1 2 3 0.0519 0.1748 0.0 1 3 4 0.0320 0.1079 0.0 1 4 5 0.0430 0.1449 0.0 1 4 6 0.0679 0.2258 0.0 1 5 6 0.0240 0.0819 0.0 1 6 7 0.0130 0.0420 0.0 1 6 8 0.0410 0.1379 0.0 1 8 9 0.0270 0.0889 0.0 1 9 10 0.0060 0.0460 0.0 1 9 15 0.0040 0.0180 0.0 1 10 11 0.0010 0.0025 0.0 1 10 13 0.0010 0.0070 0.0 1 11 12 0.0020 0.0060 0.0 1 13 14 0.0030 0.0110 0.0 1 13 15 0.0100 0.0380 0.0 1 15 16 0.0050 0.0210 0.0 1 15 17 0.0080 0.0330 0.0 1 15 18 0.0140 0.0539 0.0 1 17 18 0.0060 0.0220 0.0 1 18 19 0.0090 0.0320 0.0 1 18 20 0.0280 0.0919 0.0 1 20 21 0.0270 0.0879 0.0 1 20 22 0.0340 0.1129 0.0 1 21 22 0.0130 0.0440 0.0 1

  Universitas Sumatera Utara

  22 23 0.0210 0.0709 0.0 1 22 24 0.0649 0.2148 0.0 1 23 24 0.0430 0.1439 0.0 1 24 42 0.0260 0.0869 0.0 1 24 25 0.0330 0.1089 0.0 1 25 26 0.0380 0.1279 0.0 1 26 27 0.0129 0.0436 0.0 1 26 28 0.0260 0.0869 0.0 1 27 28 0.0154 0.0518 0.0 1 28 29 0.0190 0.0639 0.0 1 28 30 0.0280 0.0939 0.0 1 28 35 0.0190 0.0629 0.0 1 29 30 0.0280 0.0949 0.0 1 30 10 0.0020 0.0310 0.0 1 30 13 0.0110 0.0420 0.0 1 30 18 0.0080 0.0310 0.0 1 30 31 0.0060 0.0270 0.0 1 30 32 0.0030 0.0150 0.0 1 30 33 0.0020 0.0100 0.0 1 32 33 0.0030 0.0140 0.0 1 33 34 0.0030 0.0140 0.0 1 35 36 0.0300 0.0999 0.0 1 36 37 0.0467 0.1340 0.0 1 37 38 0.0256 0.0836 0.0 1 38 36 0.0529 0.1778 0.0 1 38 39 0.0486 0.1396 0.0 1 39 40 0.0450 0.1467 0.0 1 40 38 0.0659 0.2178 0.0 1 41 40 0.0296 0.0999 0.0 1 42 40 0.0370 0.1249 0.0 1 42 41 0.0074 0.0250 0.0 1 43 42 0.0010 0.0040 0.0 1 44 43 0.0040 0.0120 0.0 1 44 42 0.0030 0.0105 0.0 1 45 42 0.0100 0.0490 0.0 1]; abc_SCOUT

  Universitas Sumatera Utara

  % M.FILE II. abc_SCOUT global xSLT; basdata(:,:)=busdata(:,:); tLoses(:,2)=busdata(:,4); pos=0; kodebus=length(busdata(:,2)); for brs=1:kodebus if (busdata(brs,2)==1) pos=brs; end end

  Lebah_Pekerja % panggil lebah pekerja tLoses(pos,1)=pos; tLoses(pos,2)=real(xSLT); tLoses(pos,3)=imag(xSLT); total=sqrt((real(xSLT))^2+(imag(xSLT))^2); tLoses(pos,4)=total; tLoses(pos,5)=1/total; pause; tmp=0; posisi=pos; for ibrs=1:kodebus busdata(:,:)=basdata(:,:); if (busdata(ibrs,2)==2) busdata(ibrs,2)=1; busdata(posisi,2)=2; Lebah_Pekerja % panggil lebah pekerja tLoses(ibrs,1)=ibrs; tLoses(ibrs,2)=real(xSLT); tLoses(ibrs,3)=imag(xSLT); total=sqrt((real(xSLT))^2+(imag(xSLT))^2); tLoses(ibrs,4)=total; tLoses(ibrs,5)=1/total; pos=ibrs; pause; end end pause; clc; fprintf( '\n' )

fprintf( '#===========================================================#\n' );

fprintf( '= K E S I M P U L A N =\n' )

fprintf( '= PENENTUAN SLACK BUS PADA JARINGAN TENAGA LISTRIK =\n' )

fprintf( '= SUMBAGUT 150 KV MENGGUNAKAN METODE ARTIFICIAL BEE COLONY =\n' )

fprintf( '= OLEH : TOMMY OYS DAMANIK (100402066) =\n' )

fprintf( '= No # No SLack # ----- Losses ----- # =\n' )

fprintf( '=Urut # Bus # MW Mvar MVA # Fitness =\n' )

fprintf( '#===========================================================#\n' );

Lebah_Onlooker % panggil M.File lebah_onlooker

  Universitas Sumatera Utara

  % M.FILE III. Lebah_Pekerja FRlfybus % form the bus admittance matrix FRlfnewton % Load flow solution by Newton-Raphson method FRbusout % Prints the power flow solution on the screen FRlineflow % Computes and displays the line flow and losses % M.FILE IV. FRlfybus % Copyright (C) 1998 by H. Saadat. j=sqrt(-1); i = sqrt(-1); nl = linedata(:,1); nr = linedata(:,2); R = linedata(:,3); X = linedata(:,4); Bc = j*linedata(:,5); a = linedata(:, 6); nbr=length(linedata(:,1)); nbus = max(max(nl), max(nr)); Z = R + j*X; y= ones(nbr,1)./Z; %branch admittance for n = 1:nbr if a(n) <= 0 a(n) = 1; else end Ybus=zeros(nbus,nbus); % initialize Ybus to zero %******************* formation of the off diagonal elements for k=1:nbr; Ybus(nl(k),nr(k))=Ybus(nl(k),nr(k))-y(k)/a(k); Ybus(nr(k),nl(k))=Ybus(nl(k),nr(k)); end end

  %******************** formation of the diagonal elements for n=1:nbus for k=1:nbr if nl(k)==n

  Ybus(n,n) = Ybus(n,n)+y(k)/(a(k)^2) + Bc(k); elseif nr(k)==n

  Ybus(n,n) = Ybus(n,n)+y(k) +Bc(k); else , end end end Ybus %Zbus=inv(Ybus) clear Pgg % M.FILE V. FRlfnewton % Copyright (C) 1998 by H. Saadat. ns=0; ng=0; Vm=0; delta=0; yload=0; deltad=0; nbus = length(busdata(:,1)); for k=1:nbus n=busdata(k,1); kb(n)=busdata(k,2); Vm(n)=busdata(k,3); delta(n)=busdata(k, 4); Pd(n)=busdata(k,5); Qd(n)=busdata(k,6); Pg(n)=busdata(k,7); Qg(n) = busdata(k,8);

  Universitas Sumatera Utara Qmin(n)=busdata(k, 9); Qmax(n)=busdata(k, 10); Qsh(n)=busdata(k, 11); if Vm(n) <= 0 Vm(n) = 1.0; V(n) = 1 + j*0; else delta(n) = pi/180*delta(n);

  V(n) = Vm(n)*(cos(delta(n)) + j*sin(delta(n))); P(n)=(Pg(n)-Pd(n))/basemva; Q(n)=(Qg(n)-Qd(n)+ Qsh(n))/basemva; S(n) = P(n) + j*Q(n); end end for k=1:nbus if kb(k) == 1, ns = ns+1; else , end if kb(k) == 2 ng = ng+1; else , end ngs(k) = ng; nss(k) = ns; end Ym=abs(Ybus); t = angle(Ybus); m=2*nbus-ng-2*ns; maxerror = 1; converge=1; iter = 0; % Start of iterations clear A DC J DX

while maxerror >= accuracy & iter <= maxiter % Test for max. power mismatch

for i=1:m for k=1:m A(i,k)=0; %Initializing Jacobian matrix end , end iter = iter+1; for n=1:nbus nn=n-nss(n); lm=nbus+n-ngs(n)-nss(n)-ns; J11=0; J22=0; J33=0; J44=0; for i=1:nbr if nl(i) == n | nr(i) == n if nl(i) == n, l = nr(i); end if nr(i) == n, l = nl(i); end

  J11=J11+ Vm(n)*Vm(l)*Ym(n,l)*sin(t(n,l)- delta(n) + delta(l)); J33=J33+ Vm(n)*Vm(l)*Ym(n,l)*cos(t(n,l)- delta(n) + delta(l)); if kb(n)~=1

  J22=J22+ Vm(l)*Ym(n,l)*cos(t(n,l)- delta(n) + delta(l)); J44=J44+ Vm(l)*Ym(n,l)*sin(t(n,l)- delta(n) + delta(l)); else , end if kb(n) ~= 1 & kb(l) ~=1 lk = nbus+l-ngs(l)-nss(l)-ns; ll = l -nss(l);

  % off diagonalelements of J1 A(nn, ll) =-Vm(n)*Vm(l)*Ym(n,l)*sin(t(n,l)- delta(n) + delta(l)); if kb(l) == 0 % off diagonal elements of J2

  

A(nn, lk) =Vm(n)*Ym(n,l)*cos(t(n,l)- delta(n) + delta(l)); end

if kb(n) == 0 % off diagonal elements of J3

  A(lm, ll) =-Vm(n)*Vm(l)*Ym(n,l)*cos(t(n,l)- delta(n)+delta(l)); end if kb(n) == 0 & kb(l) == 0 % off diagonal elements of J4

  A(lm, lk) =-Vm(n)*Ym(n,l)*sin(t(n,l)- delta(n) + delta(l)); end else end else , end end

  Pk = Vm(n)^2*Ym(n,n)*cos(t(n,n))+J33; Universitas Sumatera Utara

  Qk = -Vm(n)^2*Ym(n,n)*sin(t(n,n))-J11; if kb(n) == 1 P(n)=Pk; Q(n) = Qk; end % Swing bus P if kb(n) == 2 Q(n)=Qk; if Qmax(n) ~= 0

  Qgc = Q(n)*basemva + Qd(n) - Qsh(n); if iter <= 7 % Between the 2th & 6th iterations if iter > 2 % the Mvar of generator buses are if Qgc < Qmin(n), % tested. If not within limits

  Vm(n)

Vm(n) = Vm(n) + 0.01; % is changed in steps of 0.01 pu

to elseif Qgc > Qmax(n), % bring the generator Mvar within Vm(n) = Vm(n) - 0.01; end % the specified limits. else , end else , end else , end end if kb(n) ~= 1

  A(nn,nn) = J11; %diagonal elements of J1 DC(nn) = P(n)-Pk; end if kb(n) == 0

  

A(nn,lm) = 2*Vm(n)*Ym(n,n)*cos(t(n,n))+J22; %diagonal elements of J2

A(lm,nn)= J33; %diagonal elements of J3

A(lm,lm) =-2*Vm(n)*Ym(n,n)*sin(t(n,n))-J44; %diagonal of elements of

J4 DC(lm) = Q(n)-Qk; end end

  DX=A\DC'; for n=1:nbus nn=n-nss(n); lm=nbus+n-ngs(n)-nss(n)-ns; if kb(n) ~= 1 delta(n) = delta(n)+DX(nn); end if kb(n) == 0

  Vm(n)=Vm(n)+DX(lm); end end maxerror=max(abs(DC)); if iter == maxiter & maxerror > accuracy fprintf( '\nWARNING: Iterative solution did not converged after ' ) fprintf( '%g' , iter), fprintf( ' iterations.\n\n' )

fprintf( 'Press Enter to terminate the iterations and print the results

\n' ) converge = 0; pause, else , end end if converge ~= 1 tech= ( ' ITERATIVE SOLUTION DID NOT CONVERGE' ); else , tech=( ' Power Flow Solution by Newton-Raphson Method' ); end V = Vm.*cos(delta)+j*Vm.*sin(delta); deltad=180/pi*delta; i=sqrt(-1); k=0; for n = 1:nbus if kb(n) == 1 k=k+1;

  Universitas Sumatera Utara S(n)= P(n)+j*Q(n); Pg(n) = P(n)*basemva + Pd(n); Qg(n) = Q(n)*basemva + Qd(n) - Qsh(n); Pgg(k)=Pg(n); Qgg(k)=Qg(n); %june 97 elseif kb(n) ==2 k=k+1; S(n)=P(n)+j*Q(n); Qg(n) = Q(n)*basemva + Qd(n) - Qsh(n); Pgg(k)=Pg(n); Qgg(k)=Qg(n); % June 1997 end yload(n) = (Pd(n)- j*Qd(n)+j*Qsh(n))/(basemva*Vm(n)^2); end busdata(:,3)=Vm'; busdata(:,4)=deltad'; Pgt = sum(Pg); Qgt = sum(Qg); Pdt = sum(Pd); Qdt = sum(Qd); Qsht = sum(Qsh); %clear A DC DX J11 J22 J33 J44 Qk delta lk ll lm %clear A DC DX J11 J22 J33 Qk delta lk ll lm % M.FILE VI. FRbusout % Copyright (C) 1998 by H. Saadat. clc disp(tech) fprintf( ' Maximum Power Mismatch = %g \n' , maxerror) fprintf( ' No. of Iterations = %g \n\n' , iter) head =[ ' Bus Voltage Angle ------Load------ ---Generation--- Injected' ' No. Mag. Degree MW Mvar MW Mvar Mvar ' ' ' ]; disp(head) for n=1:nbus fprintf( ' %5g' , n), fprintf( ' %7.3f' , Vm(n)), fprintf( ' %8.3f' , deltad(n)), fprintf( ' %9.3f' , Pd(n)), fprintf( ' %9.3f' , Qd(n)), fprintf( ' %9.3f' , Pg(n)), fprintf( ' %9.3f ' , Qg(n)), fprintf( ' %8.3f\n' , Qsh(n)) end fprintf( ' \n' ), fprintf( ' Total ' ) fprintf( ' %9.3f' , Pdt), fprintf( ' %9.3f' , Qdt), fprintf( ' %9.3f' , Pgt), fprintf( ' %9.3f' , Qgt), fprintf( ' %9.3f\n\n' , Qsht) % M.FILE VII. FRlineflow % Copyright (c) 1998 H. Saadat SLT= 0; fprintf( '\n' ) fprintf( ' Line Flow and Losses \n\n' ) fprintf( ' --Line-- Power at bus & line flow --Line loss-- Transformer\n' )

  Universitas Sumatera Utara fprintf( ' from to MW Mvar MVA MW Mvar tap\n' ) for n = 1:nbus busprt = 0; for L = 1:nbr; if busprt == 0 fprintf( ' \n' ), fprintf( '%6g' , n), fprintf( ' %9.3f' , P(n)*basemva) fprintf( '%9.3f' , Q(n)*basemva), fprintf( '%9.3f\n' , abs(S(n)*basemva)) busprt = 1; else , end if nl(L)==n k = nr(L); In = (V(n) - a(L)*V(k))*y(L)/a(L)^2 + Bc(L)/a(L)^2*V(n); Ik = (V(k) - V(n)/a(L))*y(L) + Bc(L)*V(k); Snk = V(n)*conj(In)*basemva; Skn = V(k)*conj(Ik)*basemva; SL = Snk + Skn; SLT = SLT + SL; elseif nr(L)==n k = nl(L);

  In = (V(n) - V(k)/a(L))*y(L) + Bc(L)*V(n); Ik = (V(k) - a(L)*V(n))*y(L)/a(L)^2 + Bc(L)/a(L)^2*V(k); Snk = V(n)*conj(In)*basemva; Skn = V(k)*conj(Ik)*basemva; SL = Snk + Skn; SLT = SLT + SL; else , end if nl(L)==n | nr(L)==n fprintf( '%12g' , k), fprintf( '%9.3f' , real(Snk)), fprintf( '%9.3f' , imag(Snk)) fprintf( '%9.3f' , abs(Snk)), fprintf( '%9.3f' , real(SL)), if nl(L) ==n & a(L) ~= 1 fprintf( '%9.3f' , imag(SL)), fprintf( '%9.3f\n' , a(L)) else , fprintf( '%9.3f\n' , imag(SL)) end else , end end end SLT = SLT/2;

xSLT=SLT; % xSLT merupakan var global yang nilainya diambil dari var SLT

fprintf( ' \n' ), fprintf( ' Total loss ' ) fprintf( '%9.3f' , real(SLT)), fprintf( '%9.3f\n' , imag(SLT)) clear Ik In SL SLT Skn Snk % M.FILE VIII. Lebah_Onlooker % LebahOnlooker ==> memutuskan slack bus yang dipilih indeks=1; % no urut busdata(:,:)=basdata(:,:); nLoses=length(busdata(:,1)); maxFitness=tLoses(1,5); slackBus=0; for xbrs=1:nLoses if (tLoses(xbrs,2)>=1.0) if maxFitness<=tLoses(xbrs,5) maxFitness=tLoses(xbrs,5);

  Universitas Sumatera Utara slackBus=tLoses(xbrs,1); end fprintf( '%4g' ,indeks); fprintf( '%9g' ,tLoses(xbrs,1)); fprintf( ' %9.3f' , tLoses(xbrs,2)); fprintf( '%9.3f' , tLoses(xbrs,3)); fprintf( '%9.3f' , tLoses(xbrs,4)); fprintf( ' %9.5f\n' , tLoses(xbrs,5)); indeks=indeks+1; end end

fprintf( '#==============================================================#\n

' ); fprintf( '\n' );

fprintf( '****************************************************************\n

' ); fprintf( '* SLACK BUS YANG DIPILIH = Fitness Terbesar

  • \n' );

  fprintf( '*

  • \n' );

  fprintf( '* Fitness Terbesar Berada Pada Slack Bus No = %2g

  • \n' ,slackBus);

  fprintf( '*

  • \n' );

  fprintf( '* Dengan Fitness =%9.5f

  • \n' ,maxFitness);

  

fprintf( '****************************************************************\n

' );  

  Universitas Sumatera Utara

  Universitas Sumatera Utara