Power system

profileAAAAAAA
LF_6BusSystemSolutions1-2.pdf

clear all %This is the Assignment 6 Bus System nbus=6; MVAbase=100; KVbase=230; % Bus Data Vslack=1.05+0i; P2=(50)/MVAbase; V2mag=1.05; P3=(60)/MVAbase; V3mag=1.07; P(4)=(-70)/MVAbase; Q(4)=(-70)/MVAbase; P(5)=(-70)/MVAbase; Q(5)=(-70)/MVAbase; P(6)=(-70)/MVAbase; Q(6)=(-70)/MVAbase; % All elements of ybus and Ybus matrices = zeros ybus=zeros(nbus,nbus); Ybus=zeros(nbus,nbus); % Branch Admittance Data y(1,1)=j*0.07; y(1,2)=1/(0.1+j*0.2); y(1,4)=1/(0.05+j*0.2); y(1,5)=1/(0.08+j*0.3); y(2,2)=j*0.105; y(2,3)=1/(0.05+j*0.25); y(2,4)=1/(0.05+j*0.1); y(2,5)=1/(0.10+j*0.3); y(2,6)=1/(0.07+j*0.2); y(3,3)=j*0.065; y(3,5)=1/(0.12+j*0.26); y(3,6)=1/(0.02+j*0.1); y(4,4)=j*0.07; y(4,5)=1/(0.2+j*0.4); y(5,5)=j*0.145; y(5,6)=1/(0.1+j*0.3); y(6,6)=j*0.065; for ii=1:nbus for jj=1:nbus y(jj,ii)=y(ii,jj); end end y; % Developing the Ybus Matrix % Filling all eements with -y(i,j) for jj=1:nbus for ii=1:nbus Ybus(jj,ii)=-y(jj,ii); end end % Filling in the Diagonals for jj=1:nbus Ybus(jj,jj)=0; for ii=1:nbus Ybus(jj,jj)=Ybus(jj,jj)+y(jj,ii); end end Ybus; disp(' Load Flow Starts') Y=Ybus; disp('Initial Bus Voltages') V=[Vslack V2mag+0i V3mag+0i 1+0i 1+0i 1+0i] for kk=1:10 Iteration=kk;

%Load Bus 4, 5, 6 for jj=4:6 %This jj counter should include all load buses X=0.; for ii=1:nbus X=X -(Y(jj,ii)*V(ii))/Y(jj,jj) ; end V(jj)=(P(jj)-j*Q(jj))/( conj(V(jj))*Y(jj,jj) ) + ( X + (Y(jj,jj)*V(jj))/Y(jj,jj) ) ; end %Generator Buses 2, 3 V2mag=1.05; Q2 = -imag( ( Y(2,1)*V(1)+Y(2,2)*V(2)+ Y(2,3)*V(3)+Y(2,4)*V(4)+Y(2,5)*V(5)+Y(2,6)*V(6) ) * conj(V(2)) ); V(2) = ( ((P2-j*Q2) / conj(V(2))) - Y(2,1)*V(1)-Y(2,3)*V(3)- Y(2,4)*V(4)-Y(2,5)*V(5)-Y(2,6)*V(6) ) / Y(2,2); e = sqrt(V2mag^2- (imag (V(2))) ^2 ); V(2) = e + (j * imag(V(2))); V3mag=1.07; Q3 = -imag( ( Y(3,1)*V(1)+Y(3,2)*V(2)+ Y(3,3)*V(3)+Y(3,4)*V(4)+Y(3,5)*V(5)+Y(3,6)*V(6) ) * conj(V(3)) ); V(3) = ( ((P3-j*Q3) / conj(V(3))) - Y(3,1)*V(1)-Y(3,2)*V(2)- Y(3,4)*V(4)-Y(3,5)*V(5)-Y(3,6)*V(6) ) / Y(3,3); e = sqrt(V3mag^2- (imag (V(3))) ^2 ); V(3) = e + (j * imag(V(3))); end disp ('Final Bus Voltages ') Vbuspol_PU_and_KV=[abs(V.') (180/pi)*angle(V.') KVbase*abs(V.') (180/pi)*angle(V.')] %Line and Generator Current Flows %disp ('Line and Generator Currents ') I12 = (V(1)-V(2)) * -Y(1,2); I14 = (V(1)-V(4)) * -Y(1,4); I15 = (V(1)-V(5)) * -Y(1,5); I23 = (V(2)-V(3)) * -Y(2,3); I24 = (V(2)-V(4)) * -Y(2,4); I25 = (V(2)-V(5)) * -Y(2,5); I26 = (V(2)-V(6)) * -Y(2,6); I35 = (V(3)-V(5)) * -Y(3,5); I36 = (V(3)-V(6)) * -Y(3,6); I45 = (V(4)-V(5)) * -Y(4,5); I56 = (V(5)-V(6)) * -Y(5,6); IG1=(I12+I14+I15); IG2=(-I12+I23+I24+I25+I26); IG3=(-I23+I35+I36); LineI=[I12 I14 I15 I23 I24 I25 I26 I35 I36 I45 I56].'; LineCurrents=[LineI abs(LineI) (angle(LineI))*180/pi] GenI=[IG1 IG2 IG3].'; GeneratorCurrents=[GenI abs(GenI) (angle(GenI))*180/pi] % Line Power Flows disp ('Line Power Flows ')

S12 = V(1) * conj(I12) % This is supposed to be conj(V(1))*I12 but was reversed for negative Q12 S21 = V(2) * conj(-I12) S14 = V(1) * conj(I14) S41 = V(4) * conj(-I14) S15 = V(1) * conj(I15) S51 = V(5) * conj(-I15) S23 = V(2) * conj(I23) S32 = V(3) * conj(-I23) S24 = V(2) * conj(I24) S42 = V(4) * conj(-I24) S25 = V(2) * conj(I25) S52 = V(5) * conj(-I25) S26 = V(2) * conj(I26) S62 = V(6) * conj(-I26) S35 = V(3) * conj(I35) S53 = V(5) * conj(-I35) S36 = V(3) * conj(I36) S63 = V(6) * conj(-I36) S45 = V(4) * conj(I45) S54 = V(5) * conj(-I45) S56 = V(5) * conj(I56) S65 = V(6) * conj(-I56) %Slack Bus Power I10=(V(1)-0)* y(1,1); S10=V(1)*conj(I10); SlackP_Q=(S10+S12+S14+S15)*MVAbase %Line Losses and Chargings disp ('Line Losses ') L12Loss=S12+S21 L14Loss=S14+S41 L15Loss=S15+S51 L23Loss=S32+S23 L24Loss=S42+S24 L25Loss=S52+S25 L26Loss=S62+S26 L35Loss=S35+S53 L36Loss=S36+S63 L45Loss=S54+S45 L56Loss=S56+S65 Results: Load Flow Starts Initial Bus Voltages V = 1.0500 1.0500 1.0700 1.0000 1.0000 1.0000 Final Bus Voltages: Vbuspol_PU_and_KV = 1.0500 0 241.5000 0 1.0500 -3.2240 241.5000 -3.2240 1.0700 -3.7067 246.1000 -3.7067 0.9891 -3.8150 227.4831 -3.8150 0.9855 -4.7995 226.6583 -4.7995 1.0046 -5.3338 231.0590 -5.3338

LineCurrents = 0.2395 + 0.1115i 0.2642 24.9530 0.3840 - 0.2197i 0.4424 -29.7768 0.3130 - 0.1431i 0.3442 -24.5747 0.0240 + 0.0825i 0.0859 73.7868 0.2999 - 0.4648i 0.5531 -57.1651 0.1365 - 0.1756i 0.2224 -52.1298 0.2279 - 0.1607i 0.2788 -35.1814 0.1676 - 0.2524i 0.3030 -56.4207 0.3626 - 0.6025i 0.7033 -58.9588 0.0381 + 0.0069i 0.0388 10.3229 0.0146 + 0.0656i 0.0672 77.4977 GeneratorCurrents = 0.9365 - 0.2514i 0.9697 -15.0249 0.4488 - 0.8300i 0.9435 -61.5974 0.5062 - 0.9375i 1.0654 -61.6309 Line Power Flows : S12 = 0.2515 - 0.1170i S21 = -0.2445 + 0.1310i S14 = 0.4032 + 0.2307i S41 = -0.3934 - 0.1915i S15 = 0.3287 + 0.1503i S51 = -0.3192 - 0.1148i S23 = 0.0203 - 0.0879i S32 = -0.0199 + 0.0897i S24 = 0.3419 + 0.4695i S42 = -0.3266 - 0.4389i S25 = 0.1535 + 0.1760i S52 = -0.1485 - 0.1612i S26 = 0.2484 + 0.1550i S62 = -0.2430 - 0.1394i S35 = 0.1964 + 0.2580i S53 = -0.1854 - 0.2341i S36 = 0.4289 + 0.6183i S63 = -0.4190 - 0.5688i S45 = 0.0372 - 0.0094i S54 = -0.0369 + 0.0100i S56 = 0.0089 - 0.0657i S65 = -0.0084 + 0.0670i SlackP_Q = 98.3332 +18.6766i Line Losses : L12Loss = 0.0070 + 0.0140i L14Loss = 0.0098 + 0.0391i L15Loss = 0.0095 + 0.0355i L23Loss = 0.0004 + 0.0018i L24Loss = 0.0153 + 0.0306i L25Loss = 0.0049 + 0.0148i L26Loss = 0.0054 + 0.0155i L35Loss = 0.0110 + 0.0239i L36Loss = 0.0099 + 0.0495i L45Loss = 3.0067e-004 +6.0135e-004i L56Loss = 0.0005 + 0.0014i