summaryrefslogtreecommitdiff
path: root/3640/CH3/EX3.1/Ex3_1.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /3640/CH3/EX3.1/Ex3_1.sce
parentb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff)
downloadScilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip
initial commit / add all books
Diffstat (limited to '3640/CH3/EX3.1/Ex3_1.sce')
-rw-r--r--3640/CH3/EX3.1/Ex3_1.sce40
1 files changed, 40 insertions, 0 deletions
diff --git a/3640/CH3/EX3.1/Ex3_1.sce b/3640/CH3/EX3.1/Ex3_1.sce
new file mode 100644
index 000000000..2e482e057
--- /dev/null
+++ b/3640/CH3/EX3.1/Ex3_1.sce
@@ -0,0 +1,40 @@
+clc
+//code uses userdefined function complexstring
+function s=complexstring(a)
+
+
+ if imag(a)>=0 then
+ s=sprintf('%g+%gi',real(a),imag(a))
+ else
+ s=sprintf('%g%gi',real(a),imag(a))
+
+ end
+ funcprot(0)
+endfunction
+r2=0.02;
+X11=20 //in ohm
+x1=0.05 //in ohm
+X22=2000 //in ohm
+x2=5 //in ohm
+Xm1=X11-x1
+Xm2=X22-x2
+mprintf("Xm1=X11-x1=%fΩ\n",Xm1)
+mprintf("Xm2=X22--x2=%fΩ\n",Xm2)
+X12=sqrt(Xm1*Xm2)
+mprintf("X12=sqrt(Xm1*Xm2)=%fΩ\n",X12)//ans may vary due to roundoff error
+kVA=10 //rated kVA
+V2=1000 //secondary voltage in volts
+I2=(kVA*(10^3))/V2 //rated current
+mprintf("I2=ratedkVA*1000/raated V2=%dA\n",I2)
+Zl=V2/I2 //load impedence
+I1=((Zl+r2+(%i*X22))*I2)/(%i*X12)//ans may vary due to roundoff error
+disp('I1=(Zl+r2+jwL22)*I2/wL12*I1='+complexstring(I1)+'A')
+r1=0.01 //in ohm
+V1=((r1+(%i*X11))*I1)-(%i*X12*I2)
+disp('V1=(r1+jwL11)I1-jwL12I2='+complexstring(V1)+'V')//ans may vary due to roundoff error
+k1=Xm1/X11
+k2=Xm2/X22
+mprintf("k1=%f\n",k1)
+mprintf("k2=%f\n",k2)
+k=sqrt(k1*k2)
+mprintf("k=sqrt(k1*k2)=%f\n",k) \ No newline at end of file