114740048 newton raphson method
DESCRIPTION
electricalTRANSCRIPT
Ex.No :
Date:
Newton Raphson Method
Aim:
To calculate various line flows of an interconnected power system using the Newton
Raphson method of power flow analysis and determine the voltage and load angle at all buses
in the system.
Software Used:
Matlab Software
Theory:
Load flow analysis is performed on a symmentrical steady state operating condition of
power system under normal mode of operation
The solution of load flow gives bus voltages and line/transformer power flow for a given load
condition.
This information is essential for long term planning and operational planning.
Long Term Planning
Load flow analysis helps in investigating the effectiveness of alternative plans and choosing
the bus best pan for system expansion to meet the projected operating state
Operational planning
It helps in choosing the best unit commitment plan and generation schedules to run the plan
and generation schedules to run the system efficiently for the next day’s load condition without
violating the bus voltages and line flow operating limits.
Steps for load flow study:
The following work has to be performed for a load flow study
Representation of the system by single line diagram
Determining the impedance diagram using the information in single line diagram
Formulation of network equation
Solution of network equation
Complex power balancing at a bus
P+JQ=(PGi – Pdi)+j(QGi-QDi)
I=Yij Vj
P-jQ = V*I = Σ Vi Vj Yij
=Σ |Vi||Vj||Yij|<(θij-δi+δj)
Equating real and imaginary part
Pical=Σ |Vi||Vj||Yij|cos(θij-δi+δj)
Qical=- |Vi||Vj||Yij|sin(θij-δi+δj)
The quation constitute a set of non linear algebraic equation in terms of the independent variables V
in p.u. and phase angle in radians
Pi(δ,V) – Pii=0
Qi(δ,V) – Qii=0
For every bus whose bus phase angle δ is unknown include the respective real power
balance equation
For every bus whose bus voltage magnitude V is unknown, include respect power balance
equation.
Algorithm:
Step 1:
Formulate Y bus matrix
Step 2:
Assume flat start for starting voltage solution
δ i=0, for i=1,2,3, ...N for all buses except slackbus
|Vi|= 1.0, for i=M+1,M+2, ...N (for all PQ buses)
|Vi|=|Vi| for all PV buses and slack bus
Step 3:
For load bus Calculate Pi cal and Qi
cal
Pical=Σ |Vi||Vj||Yij|cos(θij-δi+δj)
Qical=- |Vi||Vj||Yij|sin(θij-δi+δj)
Step 4:
For PV buses, check for Q limit violation
If Qi(min) < Qi cal < Qi(max), the bus acts as PV bus
If Qi cal > Qi (max), Qi(spec) = Qi(max)
If Qi cal < Qi (min) , Qi(spec) = Qi(min), the PV bus will act as a PQ bus
Step 5:
Compute mismatch vector using
ΔPi =Pi(spec) – Pi cal
ΔQi = Qi(spec) – Qi cal
Step 6:
ΔPi (max) = max | ΔPi|; i=1,2,3,...N except slack bus
ΔQi (max) = max |ΔQi| i=M+1,....N
Step 7:
Compute Jacobian matrix using
J= ƏPi/ Əδ ƏQi/ Ə|V|
ƏQi/ Əδ ƏQi/ Ə|V|
The diagonal and off diagonal elements of J1 are
ƏPi/ Əδi= Σ |Vi||Vj||Yij|sin(θij-δi+δj)
ƏPi/ Əδj = -|Vi||Vj||Yij|sin(θij-δi+δj) for i≠j
The diagonal and off diagonal elements of J2 are
ƏPi/ ƏVi= Σ |Vj||Yij|cos(θij-δi+δj)+2|Vi||Yij|cosθii
ƏPi/ ƏVj = -|Vi||Yij|cos(θij-δi+δj) for i≠j
The diagonal and off diagonal elements of J3 are
ƏQi/ Əδi= Σ |Vi||Vj||Yij|cos(θij-δi+δj)
ƏQi/ Əδj = -|Vi||Vj||Yij|cos(θij-δi+δj) for i≠j
The diagonal and off diagonal elements of J4 are
ƏQi/ ƏVi= -Σ |Vj||Yij|sin(θij-δi+δj)-2|Vi||Yij|sinθii
ƏQi/ ƏVj = -|Vi||Yij|sin(θij-δi+δj) for i≠j
J = J1 J2
J3 J4
Step 8 :
Obtain state correction vector
Δδ ΔP
= [ J ]-1
Δ|V| ΔQ
Step 9:
Update state vector using
V new = V old + ΔV
Δnew = δ old + Δδ
Step 10:
This procedure is continued until
|ΔP|<ε and |ΔQ| <ε, otherwise go to step 3.
Start
Read linear data, bus data tolerance for ΔP and ΔQ
Compute Y bus
Initial voltage state vector
Bus No i=1 I=i+1
Calculate Pi
cal=Σ |Vi||Vj||Yij|cos(θij-δi+δj) Qi
cal=- Σ |Vi||Vj||Yij|sin(θij-δi+δj)
Is I refer to Pv bus
Calculate ΔPi =Pi(spec) – Pi
cal
Check for Q limit
If Qi
cal > Qi (max) If Qi(min) < Qi cal < Qi(max) If Qi
cal < Qi (min) , Qi(spec) = Qi(max) Qi(spec) = Qi(min),
Is i< N Form J= ƏPi/ Əδ ƏQi/ Ə|V| ƏQi/ Əδ ƏQi/ Ə|V|
Δδ ΔP = [ J ]-1
Δ|V| ΔQ
Update state vector using V new = V old + ΔV Δnew = δ old + Δδ
Check For tolerance |ΔP|<ε and |ΔQ| <ε,
Iter=iter+1
Calculate line flow Slack bus power Total line losses
Reactive power generator at pv bus
Stop Flow chart for Newton Raphon method
Manual Calculation: Step 1: Y = Y11 Y12 Y13 Y21 Y22 Y23 Y31 Y32 Y33 Y= (1/J0.18)+(1/j0.18) -(1/J0.18) -(1/J0.18) -(1/J0.18) (1/J0.18)+(1/j0.18) -(1/J0.18) -(1/J0.18) -(1/J0.18) (1/J0.18)+(1/j0.18) Y = 11.1111<-1.57 5.5556<1.57 5.5556<1.57 5.5556<1.57 11.1111<-1.57 5.5556<1.57 5.5556<1.57 5.5556<1.57 11.1111<-1.57 Step 2 Initial Bus Voltages V1 old = 1.03V V2 old=1.02V V3old=1.0V Δδ1=0 δ=0 δ=0 Slackbus PV bus PQ Bus Bus No Bus No 2 bus No 3 Step 3: Check for Q limit Violation Q2
cal = -{|V2||V1||Y21|sin(θ21-δ2+δ1)+|V2|2|Y22|sin (θ22)+|V2||V3||Y23|sin(θ21-δ2+δ3)} = -{ 1.02x1.03x5.5556xsin(1.57) + 1.022sin(-1.57) + 1.02x1.0x5.5556xsin(1.57) = -{ 5.8367-11.1111+5.6667} = 0.05658 Step 4: Calculate |ΔP| and |ΔQ| P2(spec) = PG2- PD2 = 1.5-0=1.5 P3(spec) = PG3-PD3 = 0-2 = -2 Q2(spec)=QG2 – QD2=0- Q3(spec) = QG3-QD3=0-0.5 = -0.5 P2
cal = {|V2||V1||Y21|cos(θ21-δ2+δ1)+|V2|2|Y22|cos (θ22)+|V2||V3||Y23|cos(θ21-δ2+δ3)} ={1.02x1.03x5.5556xcos(1.57) + (1.02)2x11.1111xcos(-1.57)+ 1.02x1.0x5.5556xcos(1.57)} ={4.6479x10-3+9.2055x10-3+4.5126x10-3} = 0.018366 P3
cal = {|V3||V1||Y31|cos(θ31-δ3+δ1)+ |V3||V2||Y32|cos(θ32-δ3+δ2)+|V3|2|Y33|cos (θ33)} ={1x1.03x5.5556xcos(1.57)+1x1.02x5.5556xcos(1.57)+1x1x11.1111xcos(-1.57)} ={4.5568x10-3+4.5126x10-3+8.8841x10-3} = 0.017954 Q3 cal = -({|V3||V1||Y31|sin(θ31-δ3+δ1)+ |V3||V2||Y32|sin(θ32-δ3+δ2)+|V3|2|Y33|sin (θ33)} =-{(1.0x1.03x5.5556xsin(1.57)+1.0x1.02xsin(1.57)+1x1x11.1111xsin(-1.57)} =-{5.7223+5.6667-11.1111} = -0.2779
ΔP2 =P2(spec) – P2 cal=1.5 – 0.018366 =1.481634 ΔP3 =Pi(spec) – P3 cal = -2-0.017954=-2.017954 ΔQ3 = Qi(spec) – Q3 cal=-0.5-(-0.2779)=-0.2221
Step 6
Step7:
Compute Jacobian matrix
J= ƏPi/ Əδ ƏPi/ Ə|V| ƏQi/ Əδ ƏQi/ Ə|V| J = J1 J2 J3 J4 The diagonal and off diagonal elements of J1 are
ƏPi/ Əδi= Σ |Vi||Vj||Yij|sin(θij-δi+δj)
ƏPi/ Əδj = -|Vi||Vj||Yij|sin(θij-δi+δj) for i≠j
P2 cal = {|V2||V1||Y21|cos(θ21-δ2+δ1)+|V2|2|Y22|cos (θ22)+|V2||V3||Y23|cos(θ21-δ2+δ3)}
ƏP2/ Əδ2={|V2||V1||Y21|sin(θ21-δ2+δ1)+|V2||V3||Y23|sin(θ23-δ2+δ3)} ={1.02x1.03x5.5556xsin(1.57) + 1.02x1x5.5556xsin(1.57)} ={5.8367+5.6667}
= 11.5034 ƏP2/ Əδ3=-{|V2||V3||Y23|sin(θ23-δ2+δ3)} =-{1.02x1.03x5.5556xsin(1.57) =-{5.8367} P3
cal = {|V3||V1||Y31|cos(θ31-δ3+δ1)+ |V3||V2||Y32|cos(θ32-δ3+δ2)+|V3|2|Y33|cos (θ33)} ƏP3/ Əδ2=-{|V3||V2||Y32|sin(θ32-δ3+δ2)} =-{1.0x1.02x5.5556xsin(1.57)} =-{5.6667} ƏP3/ Əδ3={|V3||V1||Y31|sin(θ31-δ3+δ1)+ |V3||V2||Y32|sin(θ32-δ3+δ2)} =-{1.0x1.03x5.5556xsin(1.57)+1x1.02x5.5556xsin(1.57) =-{5.7223+5.6667}=-11.389 The diagonal and off diagonal elements of J2 are
ƏPi/ ƏVi= Σ |Vj||Yij|cos(θij-δi+δj)+2|Vi||Yij|cosθii ƏPi/ ƏVj = -|Vi||Yij|cos(θij-δi+δj) for i≠j P2
cal = {|V2||V1||Y21|cos(θ21-δ2+δ1)+|V2|2|Y22|cos (θ22)+|V2||V3||Y23|cos(θ21-δ2+δ3)} ƏP2/ ƏV2 = {|V1||Y21|cos(θ21-δ2+δ1)+2|V2||Y22|cos (θ22)+|V3||Y23|cos(θ21-δ2+δ3)} = 1.03x5.5556xcos(1.57) + 2x1.02x11.1111xcos(-1.57)+1.0x5.5556xcos(1.57)} = {4.5568x10-3 +0.01805+4.4241x10-3}
=0.02703 P3 cal = {|V3||V1||Y31|cos(θ31-δ3+δ1)+ |V3||V2||Y32|cos(θ32-δ3+δ2)+|V3|2|Y33|cos (θ33)} ƏP3/ ƏV3= {|V1||Y31|cos(θ31-δ3+δ1)+ |V2||Y32|cos(θ32-δ3+δ2)+2|V3||Y33|cos (θ33)} = 1.03x5.5556xcos(1.57) + 1.02x5.5556xcos(1.57)+2x1.0x11.1111cos(-1.57) ={4.5568x10-3+4.5126x10-3+0.017696}
=0.026765
The diagonal and off diagonal elements of J3 are
ƏQi/ Əδi= Σ |Vi||Vj||Yij|cos(θij-δi+δj) ƏQi/ Əδj = -|Vi||Vj||Yij|cos(θij-δi+δj) for i≠j Q2
cal = -{|V2||V1||Y21|sin(θ21-δ2+δ1)+|V2|2|Y22|sin (θ22)+|V2||V3||Y23|sin(θ21-δ2+δ3)} ƏQ2/ Əδ2= {|V2||V1||Y21|cos(θ21-δ2+δ1)+|V2||V3||Y23|cos(θ21-δ2+δ3)} = 1.02x1.03x5.5556xcos(1.57)+1.02x1.0x5.5556xcos(1.57) ={4.6479x10-3+4.51255x10-3} =9.1605x10-3 Q3 cal = -({|V3||V1||Y31|sin(θ31-δ3+δ1)+ |V3||V2||Y32|sin(θ32-δ3+δ2)+|V3|2|Y33|sin (θ33)} ƏQ3/ Əδ3 =({|V3||V1||Y31|cos(θ31-δ3+δ1)+ |V3||V2||Y32|cos(θ32-δ3+δ2)} =1.0x1.03x5.5556xcos(1.57)+1.0x1.02x5.5556xcos(1.57) ={4.5568x10-3+4.51255x10-3} =9.06935x10-3
The diagonal and off diagonal elements of J4 are
ƏQi/ ƏVi= -Σ |Vj||Yij|sin(θij-δi+δj)-2|Vi||Yij|sinθii ƏQi/ ƏVj = -|Vi||Yij|sin(θij-δi+δj) for i≠j Q2
cal = -{|V2||V1||Y21|sin(θ21-δ2+δ1)+|V2|2|Y22|sin (θ22)+|V2||V3||Y23|sin(θ21-δ2+δ3)} ƏQ2/ ƏV2= -{|V1||Y21|sin(θ21-δ2+δ1)+2|V2||Y22|sin (θ22)+|V3||Y23|sin(θ21-δ2+δ3)} =-{1.03x5.5556xsin(1.57) +2x1.02x11.1111xsin(-1.57)+1.0x5.5556xsin(1.57) =5.7223-22.6666+5.5556 =-11.3887 Q3 cal = -({|V3||V1||Y31|sin(θ31-δ3+δ1)+ |V3||V2||Y32|sin(θ32-δ3+δ2)+|V3|2|Y33|sin (θ33)} ƏQ3/ ƏV3=-{|V1||Y31|sin(θ31-δ3+δ1)+ |V2||Y32|sin(θ32-δ3+δ2)+2|V3||Y33|sin (θ33)} =-{1.03x5.5556xsin(1.57)+1.02x5.5556xsin(1.57)+2x1.0x11.1111xsin(-1.57)} =-{5.7223+5.6667-22.2222} =10.8332
[J] = J1 J2
J3 J4
[J1] = 11.5034 -5.8367 -5.6667 -11.389 [J2] = 0.02703 0.026765 [J3] = [ 9.1605x10-3 9.06935x10-3] [J4] = [10.8332]
[J] = 11.5034 -5.8367 0.02703 -5.6667 -11.389 0.026765 9.1605x10-3 9.06935x10-3 10.8332 Δδ2 ΔP2 Δδ3 = [J]-1 ΔP3 ΔV3 ΔQ3 Δδ2 0.0705 -0.0333 -9.3527x10-5 1.48163 Δδ3 = -0.03507 -0.071211 2.6346x10-4 -2.01795 ΔV3 -3.0249x10-5 8.7815x10-5 0.09230 -0.2221 Δδ2 0.17177 Δδ3 = 0.09166 ΔV3 -0.0207 Δ2 new = δ2 old + Δδ2 =1.5 + 1.17177 = 1.67177 Δ3 new = δ3 old + Δδ3 =-2 + 0.09166 = -1.90834 V3 new = V3 old + ΔV3 =-0.2221+(-0.0207) = -0.2428 Matlab Coding
Program
n=4;
ng=1;
pd=[0 1.7 2 .8];
q=[0 -1.0535 -1.2394 0];
pg=[0 0 0 3.18];
p=pg-pd;
v=[1 1 1 1.02];
th=[0 0 0 0];
e=.01
yb=[8.98519-44.835953i -3.815629+19.078144i -5.169561+25.847809i 0;
-3.815629+19.078144i 8.98519-44.835953i 0 -5.169561+25.847809i ;
-5.169561+25.847809i 0 8.193267-40.863838i -3.023705+15.118528i;
0 -5.169561+25.847809i -3.023705+15.118528i 8.193267-40.863838i;]
b=imag(yb)
g=real(yb)
an=angle(yb)
my=abs(yb)
for k=1:n
pp(k)=0;
qq(k)=0;
for l=1:n
pe(k)=v(k)*my(k,l)*v(l)*cos(an(k,l)-th(k)+th(l))+pp(k);
pp(k)=pe(k);
qe(k)=-v(k)*my(k,l)*v(l)*sin(an(k,l)-th(k)+th(l))+qq(k);
qq(k)=qe(k);
end
end
pp
delp(1:3)=(p(2:n)-pp(2:n));
delq(1:2)=(q(2:3)-qq(2:3));
chan=[delp delq]
for k=2:n
for l=1:n
if k~=l
j1(k,l)=-v(k)*v(l)*my(k,l)*sin(an(k,l)+th(l)-th(k));
j2(k,l)=v(k)*v(l)*my(k,l)*cos(an(k,l)+th(l)-th(k));
j3(k,l)=-v(k)*v(l)*my(k,l)*cos(an(k,l)+th(l)-th(k));
j4(k,l)=-v(k)*v(l)*my(k,l)*sin(an(k,l)+th(l)-th(k));
end
end
end
for k=2:n
j1(k,k)=0;
j3(k,k)=0;
for m=1:n
if (k~=m)
H(k,k)=j1(k,m)+j1(k,k);
j1(k,k)=H(k,k);
L(k,k)=j3(k,m)+j3(k,k);
j3(k,k)=-L(k,k);
end
end
j1(k,k)=-j1(k,k);
j2(k,k)=pp(k)+v(k)^2*g(k,k);
j4(k,k)=qq(k)-v(k)^2*b(k,k);
j4
end
j11(1:3,1:3)=j1(2:4,2:4);
j12(1:3,1:2)=j2(2:4,2:3);
j13(1:2,1:3)=j3(2:3,2:4);
j22(1:2,1:2)=j4(2:3,2:3);
jacob=[j11 j12;j13 j22];
delta=inv(jacob)*chan';
dth(2:n)=delta(1:3);
th=th+dth
dv=[0 0 0 0];
dv(2:3)=delta(4:n+1);
v=v+dv
x=sign(dv);
for k=1:n
if dv(k)<0
y(k)=-dv(k);
else
y(k)=dv(k);
end
end
z=max(y);
while (z>0.01)
for k=1:n
pp(k)=0;
qq(k)=0;
for l=1:n
pe(k)=v(k)*my(k,l)*v(l)*cos(an(k,l)-th(k)+th(l))+pp(k);
pp(k)=pe(k);
qe(k)=-v(k)*my(k,l)*v(l)*sin(an(k,l)-th(k)+th(l))+qq(k);
qq(k)=qe(k);
end
end
pp
delp(1:3)=(p(2:n)-pp(2:n));
delq(1:2)=(q(2:3)-qq(2:3));
chan=[delp delq]
for k=2:n
for l=1:n
if k~=l
j1(k,l)=-v(k)*v(l)*my(k,l)*sin(an(k,l)+th(l)-th(k));
j2(k,l)=v(k)*v(l)*my(k,l)*cos(an(k,l)+th(l)-th(k));
j3(k,l)=-v(k)*v(l)*my(k,l)*cos(an(k,l)+th(l)-th(k));
j4(k,l)=-v(k)*v(l)*my(k,l)*sin(an(k,l)+th(l)-th(k));
end
end
end
for k=2:n
j1(k,k)=0;
j3(k,k)=0;
for m=1:n
if (k~=m)
H(k,k)=j1(k,m)+j1(k,k);
j1(k,k)=H(k,k);
L(k,k)=j3(k,m)+j3(k,k);
j3(k,k)=-L(k,k);
end
end
j1(k,k)=-j1(k,k);
j2(k,k)=pp(k)+v(k)^2*g(k,k);
j4(k,k)=qq(k)-v(k)^2*b(k,k);
j4
end
j11(1:3,1:3)=j1(2:4,2:4);
j12(1:3,1:2)=j2(2:4,2:3);
j13(1:2,1:3)=j3(2:3,2:4);
j22(1:2,1:2)=j4(2:3,2:3);
jacob=[j11 j12;j13 j22];
delta=inv(jacob)*chan';
dth(2:n)=delta(1:3);
th=th+dth
dv=[0 0 0 0];
dv(2:3)=delta(4:n+1);
v=v+dv
x=sign(dv);
for k=1:n
if dv(k)<0
y(k)=-dv(k);
else
y(k)=dv(k);
end
end
z=max(y);
end
Input
n=4;
ng=1;
pd=[0 1.7 2 .8];
q=[0 -1.0535 -1.2394 0];
pg=[0 0 0 3.18];
v=[1 1 1 1.02];
th=[0 0 0 0];
e=.01
yb=[8.98519-44.835953i -3.815629+19.078144i -5.169561+25.847809i 0;
-3.815629+19.078144i 8.98519-44.835953i 0 -5.169561+25.847809i ;
-5.169561+25.847809i 0 8.193267-40.863838i -3.023705+15.118528i;
0 -5.169561+25.847809i -3.023705+15.118528i 8.193267-40.863838i;]
Output
th = 0 -0.0170 -0.0327 0.0266
v = 1.0000 0.9824 0.9690 1.0200
Result
The program code to calculate various line flows of an interconnected power system using
the Newton Raphson method of power flow analysis was generated and executed and the
voltage and load angle at all buses in the system were determined.