PSA File
PSA File
Po0.6661
)SG
|V;|= 1.05
i=2,... n (10.36)
k=|
Note: If we kaow V, V,, ... ,V, we can solvefor S, explicitly using (10.3a). Since
we already do know V, it only remains to find V½, V3, ... ,V,. These n -1 un
knownsmay be found from the n - 1equations of (10.3b). Thus, the heart of the
problem is the solution of n- 1implicit equations in the unknown V,, Vs, ...
V, where V,and S, S5, ... ,S, are known. Equivalently, taking complex conju
gates, we can replace ([10.3) by
S;=vEN k=l
i-2,3,... (10.6)
or, rearanging,
n
Code in MATLABmfile:
clc
clear all
%Data%
slb=l;pvb=l;pgb=l; nb=slb+pvbtpgb;
Y=[-j*19.98 j*10 j*10:j*10 -j*19.98 j*10;j*10 j*10 -j *19.98] :
y=abs,(Y) phi=angle (Y) :
v(1) =1.0;th(1)=0;v(2) =1.05;
Psp (2) =0.6661; Psp (3) =-2.8653; Qsp(3) =-1.2244 ;
%initial quess for unknown theta and v %
th (2)=0;v(3) =1.0;th (3) =0;
m=180/pi;
%Program for Gauss Siedel algorithm%
err=1.0; t=0; 8 ' t ' is the number of iterations of the algorithm
while err>le-4
for i=2:3
Px (i)=0:Qx (i) =0;
for k=1:3
Px (i) =Px (i) +v (i) *v (k)*y (i,k) *cos (th (i)-th (k) -phi (i, k) ):
Qx (i)=Qx (i) +v (i) *v (k)*y (i, k) *sin (th (i)-th (k) -phi(i, k) ):
end
end
for i=1:3
V(i) =v (i) * (cos (th (i ))+j*sin (th(i)));
end
for i=2:3
vint (i)=0;
for k=l:3
if kr=i
vint (i) =vint (i) +Y (i, k) *V(k) ;
else
end
end
end
for i=2: nb
if i<= (slb+pvb)
V(i) =(((Psp (i) -j*Ox (i)) /conj (V(i) ) -vint (i) ) /Y (i, i) );
else
V(i) =(((Psp (i) -j*Qsp(i)) /conj (V (i)) -vint (i))/Y (i, i) );
end
end
for i=2:nb
if i<= (slb+pvb)
th(i)=angle (V(i) );
else
v (i)=abs (V (i) ):
th (i) =angle (V(i)):
end
end
delp=Psp-Px;
delg=0sp-Qx;
delpqx=[delp'; delg']:
err-abs (max (delpqx) ):
t=t+l:
end
[v' m*th']