summaryrefslogtreecommitdiff
path: root/147/CH3/EX3.7/Example3_7.sce
diff options
context:
space:
mode:
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