from math import sqrt,atan,pi
# If a R=30 ohms and Xl=40 ohms are in series with 100V applied, find the following: Zt, I, Vr, Vl and Theta z. What is the phase angle between Vl and Vr with respect to I? Prove that the sum of the series voltage drop equals the applied voltage Vt
# Given data
R = 30.# # Resistance=30 Ohms
Xl = 40.# # Inductive reactance=40 Ohms
Vt = 100.# # Applied voltage=100 Volts
R1 = R*R#
Xl1 = Xl*Xl#
Zt = sqrt(R1+Xl1)#
print 'Zt = %0.2f ohms'%Zt
I = (Vt/Zt)#
print 'I = %0.2f Ampers'%I
Vr = I*R#
print 'Vr = %0.2f Volts'%Vr
Vl = I*Xl#
print 'Vl = %0.2f Volts'%Vl
Oz = atan(Xl/R)*180/pi
print 'Theta z = %0.2f degree'%Oz
#Prove that the sum of the series voltage drop equals the applied voltage Vt
Vt = sqrt((Vr*Vr)+(Vl*Vl))#
print 'Sum of Voltage Drop = %0.f which is Equal to Applied Voltage 100V '%Vt
from math import sqrt
# What is the total Z of a 600-Ohms R in parallel with a 300 Ohms Xl? Assume 600 V for the applied voltage.
# Given data
R = 600.# # Resistance=600 Ohms
Xl = 300.# # Inductive reactance=300 Ohms
V = 600.# # Applied voltage=600 Volts
Ir = V/R#
Il = V/Xl#
A = Ir*Ir#
B = Il*Il#
It = sqrt(A+B)#
Zeq = V/It#
print 'The Total Impedence = %0.2f Ohms'%Zeq
# An air-core coil has an Xl of 700 Ohms and an Re of 2 Ohms. Calculate the value of Q for this coil.
# Given data
Xl = 700# # Inductive reactance=700 Ohms
Re = 2# # AC effective resistance=2 Ohms
Q = Xl/Re#
print 'The Q of Coil = %0.2f'%Q
from math import pi
# A 200 uH coil has a Q of 40 at 0.5 MHz. Find Re.
# Given data
L = 200.*10**-6# # L of coil=200 uHenry
Q = 400# # Q=40
f = 0.5*10**6# # Frequency=0.5 MHz
pi = 3.14#
Xl = 2*pi*L*f#
Re = Xl/Q#
print 'The AC Effective Resistance = %0.2f Ohms'%Re