0% found this document useful (0 votes)
19 views9 pages

EEE4154 170205148 Report8

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

EEE4154 170205148 Report8

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

Ahsanullah University of Science & Technology

Department of Electrical & Electronic Engineering

Course Title: Power System II Lab


Course No.: EEE 4154

Software Project on Load Flow Study Using MATLAB

Submitted by:
Name: MD TALHA JUBAIR PEASH
Student ID:17.02.05.148
Section :C1
Group :4
MATLAB code using Gauss Seidel Method:

no_bus=input('Total number of bus is: ');


[P,Q,V,d]=deal(zeros(1,no_bus));

for m=1:no_bus
sprintf('\n Enter the real power, reactive power, \n voltage & angle
of voltage of bus %d : ',m)
sprintf('\n For unknown P & Q => inf \n For unknown V => 1\n For
unknown delta => 0') P(m)=input('P= ');
Q(m)=input('Q= ');
V(m)=input('V= ');
d(m)=input('delta= '); end
busName=['']; for
m=1:no_bus
if (P(m)==inf)&&(Q(m)==inf)
busName{m}='Slack';
slackBus=m; elseif Q(m)==inf
busName{m}='PV'; else
busName{m}='PQ';
end end
[r,x,z]=deal(zeros(no_bus,no_bus));
sprintf('\n Now, provide Line resistance & reactance from bus to bus.\n
If no connection between the buses, put r=inf & x=0')
for m=1:no_bus for n=m+1:no_bus
sprintf('Enter Line Resistance & Reactance between bus %d & bus
%d: ',m,n)
r(m,n)=input('r=');
x(m,n)=input('x=');
z(m,n)=r(m,n)+1i*x(m,n); end
end
z(z==0.0000 + 0.0000i)=inf+0.0000i;
for m=1:no_bus for n=1:no_bus
if z(m,n)==Inf + 0.0000i
z(m,n)=z(n,m); end
end end y=1./z;
sprintf('\n Now,forming YBus a.k.a. Bus Admittance Matrix')
Y=zeros(no_bus,no_bus); for
m=1:no_bus
for n=1:no_bus
if m==n
Y(m,n)=sum(y(m,:))-y(m,n);
else Y(m,n)=-y(m,n); end
end end iter=1; tol=0.0001;
sprintf('\n Using Gauss Seidel Method...')
[Pnew,Qnew,vnew,Vnew,dnew]=deal(zeros(1,no_bus));
del=ones(1,no_bus); while (max(del)>tol)
del(slackBus)=0; for m=1:no_bus
if strcmp(busName(m),'PV')
Qnew(m)=-imag(conj(V(m)).*(sum(Y(m,:).*V)-Y(m,m).*V(m)));
vnew(m)=(1/Y(m,m)).*(((P(m)-1i.*Q(m))/conj(V(m)))-
(sum(Y(m,:).*V)-Y(m,m).*V(m)));
dnew(m)=angle(vnew(m));
del(m)=max(abs(Q(m)-Qnew(m)), abs(dnew(m)-d(m)));
Q(m)=Qnew(m); d(m)=dnew(m);
elseif strcmp(busName(m),'PQ')
vnew(m)=(1/Y(m,m)).*(((P(m)-1i.*Q(m))/conj(V(m)))-
(sum(Y(m,:).*V)-Y(m,m).*V(m)));
Vnew(m)=abs(vnew(m));
dnew(m)=angle(vnew(m));
del(m)=max(abs(V(m)-Vnew(m)), abs(dnew(m)-d(m)));
V(m)=Vnew(m); d(m)=dnew(m); end end
iter=iter+1; end
for m=1:no_bus
if strcmp(busName(m),'Slack')
P(m)=abs(conj(V(m)).*(sum(Y(m,:).*V)));
Q(m)=-imag(conj(V(m)).*(sum(Y(m,:).*V))); end
end
S=zeros(no_bus, no_bus);
for m=1:no_bus for
n=m+1:no_bus for
k=1:no_bus if
r(m,n)~=inf
S(m,n)=V(m).*conj((V(m)-V(k)).*Y(m,k));
end end end end

OUTPUT:

>> pr8
Total number of bus is: 4

ans =Enter the real


power,reactive power,

voltage & angle of voltage of


bus 1 :

ans =
For unknown P & Q => inf
For unknown V => 1
For unknown delta => 0

P= inf
Q= inf V=
1.04
delta= 0
ans =

Enter the real power, reactive power,


voltage & angle of voltage of bus 2 :

ans =
For unknown P & Q => inf
For unknown V => 1
For unknown delta => 0
P= 0.5
Q= inf V=
1 delta=
0 ans =

Enter the real power, reactive power,


voltage & angle of voltage of bus 3 :

ans =
For unknown P & Q => inf
For unknown V => 1
For unknown delta => 0

P= -1.0
Q= 0.5 V=
1 delta=
0 ans =

Enter the real power, reactive power,


voltage & angle of voltage of bus 4 :

ans =
For unknown P & Q => inf
For unknown V => 1
For unknown delta => 0
P= 0.3
Q= -0.1 V=
1 delta= 0
ans =

Now, provide Line resistance & reactance from bus to bus.


If no connection between the buses, put r=inf & x=0 ans =

Enter Line Resistance & Reactance between bus 1 & bus 2:


r=0.05
x=0.15
ans =

Enter Line Resistance & Reactance between bus 1 & bus 3:


r=0.10
x=0.30

ans =

Enter Line Resistance & Reactance between bus 1 & bus 4:


r=inf
x=0

ans =

Enter Line Resistance & Reactance between bus 2 & bus 3:


r=0.15 x=0.45
ans =

Enter Line Resistance & Reactance between bus 2 & bus 4:


r=0.10
x=0.30

ans =

Enter Line Resistance & Reactance between bus 3 & bus 4:


r=0.05
x=0.15
>> p
Undefined function or variable 'p'.

Did you mean:


>> P

P=

0.2487 0.5000 -1.0000 0.3000

>> Q

Q=

0.2359 -11.4191 0.5000 -0.1000

>> del

del =

1.0e-04 *

0 0.6353 0.0542 0.0360


>> r

r=

0 0.0500 0.1000 Inf 0 0 0.1500 0.1000


0 0 0 0.0500
0 0 0 0

>> x

x=

0 0.1500 0.3000 0
0 0 0.4500 0.3000
0 0 0 0.1500
0 0 0 0

>> inter
Undefined function or variable 'inter'.

>> iter
iter = 10

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy