summaryrefslogtreecommitdiff
path: root/3640/CH3/EX3.7/Ex3_7.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.7/Ex3_7.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.7/Ex3_7.sce')
-rw-r--r--3640/CH3/EX3.7/Ex3_7.sce43
1 files changed, 43 insertions, 0 deletions
diff --git a/3640/CH3/EX3.7/Ex3_7.sce b/3640/CH3/EX3.7/Ex3_7.sce
new file mode 100644
index 000000000..a87048517
--- /dev/null
+++ b/3640/CH3/EX3.7/Ex3_7.sce
@@ -0,0 +1,43 @@
+clc
+//the code uses a 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
+r1=3
+r2=0.03
+x1=15
+x2=0.15
+V1B=2400 //primary side voltage
+V2B=240 //secondary side voltage
+a=V1B/V2B
+Zeq2=(r1/(a^2))+r2+(%i*((x1/(a^2))+x2))//ans may vary due to roundoff error
+disp('Zeq2='+complexstring(Zeq2)+'Ω')
+SB=10000// rated kva of the trnsformer
+V2B=240
+I2B=SB/V2B
+mprintf("I2B=%fA\n",I2B)//ans may vary due to roundoff error
+//with V2 reference
+//0.8 pf lagging
+I2=I2B*exp(%i*(-1)*acos(0.8))//ans may vary due to roundoff error
+disp('I2='+complexstring(I2)+'A')
+V2=240
+V1=a*(V2+I2*Zeq2)//ans may vary due to roundoff error
+disp('V1/a='+complexstring(V1/a)+'V')
+mprintf("|V1|=%fV\n",abs(V1))
+//0.8 pf leading
+I2B=SB/V2B
+I2=I2B*exp(%i*acos(0.8))//ans may vary due to roundoff error
+V1=a*(V2+(I2*Zeq2))//ans may vary due to roundoff error
+disp('V1='+complexstring(V1/a)+'V')
+mprintf("|V1|=%fV\n",abs(V1))//ans may vary due to roundoff error
+
+
+