summaryrefslogtreecommitdiff
path: root/3809/CH6/EX6.5/EX6_5.sce
diff options
context:
space:
mode:
Diffstat (limited to '3809/CH6/EX6.5/EX6_5.sce')
-rw-r--r--3809/CH6/EX6.5/EX6_5.sce23
1 files changed, 23 insertions, 0 deletions
diff --git a/3809/CH6/EX6.5/EX6_5.sce b/3809/CH6/EX6.5/EX6_5.sce
new file mode 100644
index 000000000..ec6b7be01
--- /dev/null
+++ b/3809/CH6/EX6.5/EX6_5.sce
@@ -0,0 +1,23 @@
+//Chapter 6, Example 6.5
+clc
+//Initialisation
+pi=3.14 //pi
+f=50 //frequency in hertz
+i=5 //current in ampere
+r=10 //resistance in ohm
+L=25*10**-3 //inductance in henry
+VL=39.3 //from phasor diagram
+VR=50 //from phasor diagram
+
+
+//Calculation
+Vr=i*r //voltage across resistor
+w=2*pi*f //angular frequency
+Xl=w*L //inductive reactance
+Vl=i*Xl //voltage across inductor
+V=sqrt(VR**2+VL**2) //voltage
+phi=atan(VL/VR) //phase angle
+
+//Results
+printf("Voltage, V = %.1f V\n",V)
+printf("Phase Angle, phi = %.1f Degree",phi*180/pi)