summaryrefslogtreecommitdiff
path: root/3793/CH11/EX11.3/exp_11_3.sce
diff options
context:
space:
mode:
Diffstat (limited to '3793/CH11/EX11.3/exp_11_3.sce')
-rw-r--r--3793/CH11/EX11.3/exp_11_3.sce47
1 files changed, 47 insertions, 0 deletions
diff --git a/3793/CH11/EX11.3/exp_11_3.sce b/3793/CH11/EX11.3/exp_11_3.sce
new file mode 100644
index 000000000..8c608bc74
--- /dev/null
+++ b/3793/CH11/EX11.3/exp_11_3.sce
@@ -0,0 +1,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);