Theoretical Calculation:
MATLAB Program :
clc;
clear all;
nob=input('Enter the no. of buses = ');
nol=input('Enter the no. of lines = ');
inp=input('\nEnter send bus in 1st column, end bus in 2nd : ');
sb=inp(:,1); %sending bus
eb=inp(:,2); %ending bus
R=zeros(nol);
X=zeros(nol);
Z=zeros(nol);
inp1=input('\nEnter R in 1st column, X in 2nd : ');
R=inp1(:,1);
X=inp1(:,2);
for i=1:nol
Z(i)=(R(i)+1j*X(i));
end
Y=zeros(nob,nob);
for i=1:nol
a=sb(i);
b=eb(i);
Y(a,a)=Y(a,a)+(Z(i));
Y(b,b)=Y(b,b)+(Z(i));
Y(a,b)=-(Z(i));
Y(b,a)=Y(a,b);
end
disp('Y-Bus Matrix =');
disp(Y);
inp2=input('\nEnter Voltage in 1st column, p in 2nd, q in 3rd: ');
vo=inp2(:,1);
p=inp2(:,2);
q=inp2(:,3);
vn(1)=vo(1);
for i=2:nob
s1=0;
for j=1:i-1
s1=s1+Y(i,j)*vn(j);
end
s2=0;
for j=i+1:nob
s2=s2+Y(i,j)*vo(j);
end
vn(i)=(((p(i)-1j*q(i))/vo(i))-s1-s2)/Y(i,i);
vacc(i)=vo(i)+a*(vn(i)-vo(i));
end
for i=1:nob
fprintf('\nVoltage %d new =',i);
disp(vn(i));
fprintf('\nVoltage %d acc =',i);
disp(vacc(i));
end
MATLAB Output:
YouTube Video of My Channel on the Problem you can use this also
Disclaimer: In this video I missed Vacc ( If you have any problem in doing this you can comment below , I will help as soon as possible) 💗 Thanks For Visiting 💗 |
2 Comments
what about have one pv bus and two PQ bus
ReplyDeleteHi
DeleteHow to find voltage and angle for n atteration in This code?
Thanks