summaryrefslogtreecommitdiff
path: root/2372/CH2/EX2.6/ex6.sce
diff options
context:
space:
mode:
Diffstat (limited to '2372/CH2/EX2.6/ex6.sce')
-rw-r--r--2372/CH2/EX2.6/ex6.sce28
1 files changed, 28 insertions, 0 deletions
diff --git a/2372/CH2/EX2.6/ex6.sce b/2372/CH2/EX2.6/ex6.sce
new file mode 100644
index 000000000..be53f2564
--- /dev/null
+++ b/2372/CH2/EX2.6/ex6.sce
@@ -0,0 +1,28 @@
+clc;
+clear;
+e1=input("source #1 voltage mag. =");
+a1=input("source #1 phase angle =");
+e2=input("source #2 voltage mag. =");
+a2=input("source #2 phase angle =");
+r=input("line resistance =");
+x=input("line reactance =");
+z=r+(%i*x);
+a1=((-30+a1):5:(30+a1))';
+a1r=a1*%pi/180;
+k=length(a1);
+a2=ones(k,1)*a2;
+a2r=a2*%pi/180;
+v1=e1.*cos(a1r)+%i*e1.*sin(a1r);
+v2=e2.*cos(a2r)+%i*e2.*sin(a2r);
+i12=(v1-v2)./z;
+i21=-i12;
+s1=v1.*conj(i12);p1=real(s1);q1=imag(s1);
+s2=v2.*conj(i21);p2=real(s2);q2=imag(s2);
+sl=s1+s2;pl=real(sl);ql=imag(sl);
+result1=[a1,p1,p2,pl];
+disp("delta 1 p-1 p-2 p-l");
+disp(result1);
+plot(a1,p1,a1,p2,a1,pl);
+xlabel("source #1 voltage phase angle");
+ylabel("P,watts");
+plotframe;