summaryrefslogtreecommitdiff
path: root/147/CH3/EX3.7/Example3_7.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /147/CH3/EX3.7/Example3_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 '147/CH3/EX3.7/Example3_7.sce')
-rw-r--r--147/CH3/EX3.7/Example3_7.sce41
1 files changed, 41 insertions, 0 deletions
diff --git a/147/CH3/EX3.7/Example3_7.sce b/147/CH3/EX3.7/Example3_7.sce
new file mode 100644
index 000000000..55860a4ec
--- /dev/null
+++ b/147/CH3/EX3.7/Example3_7.sce
@@ -0,0 +1,41 @@
+close();
+clear;
+clc;
+//voltage source 'V', frequency of source 'f', resistance 'R', inductance 'L', capacitance 'C'
+V = 100;
+V_arg = 0;
+f = 79.6; //Hz
+R = 100; //ohm
+L = 1; //H
+C = 5*10^(-6); //F
+
+//(a)
+//angular frequency 'w'
+w = 2*%pi*f; //rad/s
+//inductive reactance 'Xl'
+Xl = w*L; //ohm
+Xl_arg = %pi/2; //rad
+//capacitive reactance 'Xc'
+Xc = 1/(w*C);
+Xc_arg = -%pi/2; //rad
+//impedance 'Z'
+Z = sqrt(R^2 + (Xl-Xc)^2);
+Z_arg = atan((Xl-Xc)/R); //rad
+//input current magnitude 'I' and argument 'I_arg'
+I = V/Z;
+I_arg = V_arg-Z_arg; //rad
+mprintf("input current, I = %0.3f arg(%d degree )\n\n",I,I_arg*180/%pi);
+
+//(b)
+//voltage across R 'Vr'
+Vr = R*I;
+Vr_arg = I_arg;
+//volatge across L 'Vl'
+Vl = Xl*I;
+Vl_arg = Xl_arg+I_arg;
+//voltage across C 'Vc'
+Vc = Xc*I;
+Vc_arg = Xc_arg+I_arg;
+mprintf("Voltage across resistance, Vr = %0.1f arg(%d degree )\n\n",Vr, round(Vr_arg*180/%pi));
+mprintf("Voltage across inductor, Vl = %0.1f arg(%d degree )\n\n",Vl, round(Vl_arg*180/%pi));
+mprintf("Voltage across capacitor, Vc = %0.1f arg(%d degree )",Vc, round(Vc_arg*180/%pi)); \ No newline at end of file