1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
clear;
clc;
function [S,pin,deltam,itr,delta1]=pinstab (V,X1,Xt,Xd,pf,typee,tolr);
Xtot=X1+Xt+Xd;
Pu=input('Generator output power');
phi=acosd(pf);
Qu=Pu*tand(phi);
if typee==0
S=Pu+%i*Qu;
else
S=Pu-%i*Qu;
end
I=conj(S)/conj(V);
Edash=V+I*(%i*Xtot);
Edash=abs(Edash);
delta0=asin(Pu*Xtot/(Edash*V));
itr=0;
deltam=input('initial estimate of deltam');
ndeltam=0;
difff=abs(ndeltam-deltam);
while difff > tolr;
itr=itr+1;
fdeltam=cos(delta0)-(deltam-delta0)*sin(deltam)-cos(deltam);
dfdeltam=(deltam-delta0)*cos(deltam);
ndeltam=deltam+fdeltam/dfdeltam;
difff=abs(ndeltam-deltam);
deltam=ndeltam;
end
delta1=%pi-deltam;
pin=(Edash*V/Xtot)*sin(delta1);
deltam=deltam*180/%pi;
delta1=delta1*180/%pi;
mprintf("Magnitude of power input without loosing synchronism is %.4f",pin);
endfunction
V=1;
X1=.15;
Xt=.2;
Xd=.15;
pf=.8;
typee=0;
tolr=.001;
[S,pin,deltam,itr,delta1]=pinstab (V,X1,Xt,Xd,pf,typee,tolr);
|