#given data :
J=2.4 #in A/mm**2
J=2.4*10**6 #in A/m**2
n=5*10**28 #unitless
e=1.6*10**-19 # in coulomb
#Formula : J=e*n*v
v=J/(e*n) #in m/s
print "Drift velocity is : ",(v)," m/s or ",(v*10**3)," mm/s"
#given data :
#Electron density
n=1*10**24 #unit less
#Electron charge
e=1.6*10**-19 # in coulomb
#Drift velocity
v=1.5*10**-2 # in meter per second
#cross-sectional area
A=1 # in centimeter square
A=1*10**-4 # in meter square
I=e*n*v*A # in ampere
print "Magnitude of current is :",(I)," A"
#given data :
miu_e=7.04*10**-3 #in m**2/V-s
n=5.8*10**28 # in /m**3
e=1.6*10**-19 # in coulomb
m=9.1*10**-31 #in kg
#(i) Relaxation time,
tau=miu_e/e*m
print "Relaxation time is : ",(tau)," second"
sigma=(n*e*miu_e)
#(ii) Resistivity of conductor,
rho=1/sigma
print "Resistivity of conductor is : %0.3e"%rho," ohm-meter"
#given data :
rho=1.73*10**-8 #in ohm-meter
toh=2.42*10**-14 #in second
e=1.6*10**-19 #in C
m=9.1*10**-31 #in kg
sigma=1/rho
#(i) Number of free electrons per m**3
print "Number of free electrons per cube meter is : ",(n)
n=(m*sigma)/(e**2*toh)
#(ii) Mobility of electrons,
miu_e=(e*toh)/m
print "Mobility of electrons is : %0.3e"%(miu_e)," m**2/V-s"
#Note: Answer in the book is wrong
#given data :
rho=1.54*10**-8 #in ohm-meter
#since sigma=1/roh
sigma=1/rho
n=5.8*10**28 #unit less
e=1.6*10**-19 #in C (electron charge)
m=9.1*10**-31 #in kg (mass of electron)
#(i) Relaxation time
toh=(sigma*m)/(n*e**2)
print "(i) Relaxation time of electrons is : %0.3e"%(toh)," seconds"
#(ii) Mobility of electrons,
miu_e=(e*toh)/m
print "(ii) Mobility of electrons is : %0.3e"%(miu_e)," m**2/V-s"
#given data :
rho=1.7*10**-8 #in ohm-meter
#since sigma=1/roh
sigma=1/rho
n=8.5*10**28 #unit less
e=1.6*10**-19 #in C (electron charge)
m=9.1*10**-31 #in kg
# Relaxation time
toh=(sigma*m)/(n*e**2)
print " Relaxation time of electrons is : %0.3e"%(toh)," seconds"
#given data :
E=100 #in V/m
rho=1.5*10**-8 #in ohm-meter
#since sigma=1/roh
sigma=1/rho
n=6*10**28 #unit less
e=1.601*10**-19 #in C
m=9.107*10**-31 #in kg
# Relaxation time
toh=(sigma*m)/(n*e**2)
print "(i) Relaxation time of electrons is : %0.3e"%(toh)," seconds"
#Drift velocity
v=(e*E*toh)/m
print "(ii) Drift velocity is : %0.3f"%(v)," m/s"
from math import pi
#given data :
#Diameter of copper wire
d=2 #in milimeter
d=.002 #in meter
#conductivity of copper
nita=5.8*10**7 #in second per meter
#Electron mobility
miu_e=.0032 #in meter square per volt-second
#Applied electric field
E=20 #in mV/m
E=.02 #in V/m
e=1.6*10**-19
#(i) From eq. (2.13)
#charge density
n=nita/(e*miu_e) #in per meter cube
print "(i) Charge density is : %0.3e"%(n)," /meter cube"
#(ii) from eq. (2.9)
#current density
J=nita*E # in A/m**2
print "(ii) Current density is : ",(J)," A/m**2"
#(iii) Current flowing in the wire I=J* Area of x-section of wire
# Area of x-section of wire= (pi*d**2)/4
I=(J*pi*d**2)/4
print "(iii) Current flowing in the wire is : %0.2e"%(I)," A"
#(iv) form eq.2.14
#Electron drift velocity
v=miu_e*E
print "(iv) Electron drift velocity is : %0.1e"%(v)," m/s"
#given data
rho=0.5 # in ohm-meter
J=100 #in A/m**2
miu_e=0.4 #in m**2/V-s
E=J*rho # since E=J/sigma
# Formula v=miu_e*E
v=miu_e*E
print "Electron drift velocity is : ",(v)," m/s"
print "Time taken by the electron to travel 10*10**-6 m in crystal =",
# let Time taken by the electron to travel 10*10**-6 m in crystal = t
t=(10*10**-6)/v
print (t),"second"
#given data
miu_e=0.17 #in m**2/V-s
miu_h=0.035 #in m**2/V-s
nita_i=1.1*10**16 #in /m**3
e=1.6*10**-19 # in C (electron charge)
# Intrinsic conductivity,
sigma_i=(nita_i*e)*(miu_e+miu_h)
IntrinsicResistivity=1/sigma_i
print "Intrinsic resistivity is : %0.2e"%(IntrinsicResistivity)," ohm-meter"
#given data
rho_i=2*10**-3 #in ohm-m (there is miss printed in this line in the book)
sigma_i=1/rho_i
miu_e=0.3 # in m**2/V-s
miu_h=0.1 # in m**2/V-s
e=1.6*10**-19 # in C
# Formula sigma_i=nita_i*e*(miu_e+miu_h)
nita_i=sigma_i/(e*(miu_e+miu_h))
print "Carrier density is : %0.2e"%(nita_i)," /m**3"
from __future__ import division
#given data
R_15=250 # in ohm
R_t2=300 # in ohm
alpha=0.0039 # in degree C
t1=15
#Formula R_t2 = R_15 * [1 + alpha1*(t2 - t1)]
t2=((R_t2/R_15)-1)/alpha+t1
print "Temperature when its resistance is 300 ohms is : ",round(t2,1)," degree C"
#given data
alpha0=0.0038 # in ohm/ohm/degree C
t1=20 #in degree C
alpha20=1/(1/alpha0+t1)
R1=400 #in ohm
#Formula R2=R1*[1+alpha20*(t2-t1)]
R2=R1*(1+alpha20*(80-20))
print "Resistance of wire at 80 degree C si : ",round(R2,1)," ohm"
# given data
R1 = 50 # ohm
R2 = 57.2 # ohm
t1 = 25 # degree C
t2 = 70 # degree C
from sympy import symbols, solve, N
alfa0, R0 = symbols('alfa0 R0') # temperature coefficient at 0 degree C
# Accrding to formula :
#r1 = R0(1+t1*alfa0)
#r2 = R0(1+t2*alfa0)
r1byr2 = R1/R2
alfa0 = solve((1+t1*alfa0)/(1+t2*alfa0)-r1byr2)[0]
alfa0 = N(alfa0, 3)
print "alpha0 = ",alfa0," ohm/ohm/degree C"
# given data
R1 = 45 # ohm
R2 = 59 # ohm
t1 = 25 # degree C
t2 = 75 # degree C
from sympy import symbols, solve, N
alfa0, R0 = symbols('alfa0 R0') # temperature coefficient at 0 degree C
# Accrding to formula :
#r1 = R0(1+t1*alfa0)
#r2 = R0(1+t2*alfa0)
r1byr2 = R1/R2
alfa0 = solve((1+t1*alfa0)/(1+t2*alfa0)-r1byr2)[0]
alfa0 = N(alfa0, 5)
print "alpha0 = %0.2e"%alfa0," ohm/ohm/degree C"
# given data
R1 = 3.146 # ohm
R2 = 3.767 # ohm
t1 = 40 # degree C
t2 = 100 # degree C
from sympy import symbols, solve, N
alfa0, R0 = symbols('alfa0 R0') # temperature coefficient at 0 degree C
# Accrding to formula :
#r1 = R0(1+t1*alfa0)
#r2 = R0(1+t2*alfa0)
r1byr2 = R1/R2
alfa0 = solve((1+t1*alfa0)/(1+t2*alfa0)-r1byr2)[0]
alfa0 = N(alfa0, 3)
print "Temperature coefficient of resistance at 40 degree C = ",
alpha40=1/(1/alpha0+40)
print round(alpha40,5)
#Formula R1 = R0 * (1+40*alpha0)
R0=R1/(1+40*alpha0)
print "Resistance of platinum coil at 0 degree C is : ",round(R0,3)," ohm "
# given data
R1 = 18 # ohm
R2 = 20 # ohm
R3 = 21 # ohm
t1 = 20 # degree C
t2 = 50 # degree C
ts = 15 # degree C # surrounding temperature
from sympy import symbols, solve, N
alfa0, R0, t = symbols('alfa0 R0 t') # temperature coefficient at 0 degree C
# Accrding to formula :
#r1 = R0(1+t1*alfa0)
#r2 = R0(1+t2*alfa0)
#r3 = R0(1+t*alfa0)
r1byr2 = R1/R2
alfa0 = solve((1+t1*alfa0)/(1+t2*alfa0)-r1byr2)[0]
alfa0 = N(alfa0, 3)
r3byr2 = R3/R2
t = solve(r3byr2 - (1+alfa0*t)/(1+alfa0*t2), t)[0]
tr = t-ts # temp. rise
print "Temperature rise = %0.f degree C" %tr
from __future__ import division
from fractions import Fraction
#given data
alpha20=1/254.5 # in ohm/ohm/degree C
t2=60 #degree C
t1=20 #degree C
rho0=1.6*10**-6
alpha60=1/(1/alpha20+(t2-t1))
print "Temperature coefficient of resistance at 60 degree C is : ",Fraction(alpha60).limit_denominator(1000),"or",round(alpha60,5)," ohm/(ohm/degree C)"
#from alpha20=1/(1/alpha0+20)
alpha0=1/(1/alpha20-20)
#Formula rho60=rho0*(1+alpha0*t)
rho60=rho0*(1+alpha0*t2)
print "Specific resistance at 60 degree C is : %0.4e"%(rho60)," ohm-cm"
#given data
R=95.5 #in ohm
l=1 #in meter
d=0.08 #in mm
d=d*10**-3 #in meter
a=(pi*d**2)/4
#Formula R=rho*l/a
rho=R*a/l
print "Resistance of the wire material is : %0.3e"%(rho)," ohm-meter"
#given data
R=4 #in ohm
d=0.0274 #in cm
d=0.000274 #in meter
rho=10.3 #in miu ohm-cm
rho=10.3*10**-8 #in ohm-m
a=(pi*d**2)/4
#Formula R=rho*l/a
l=R*a/rho
print "Lenght of wire is : %0.2f"%(l)," meters"
#given data
V=220 # in V
W=100 #in watt
R100=V**2/W #in ohm
alpha20=0.005
t1=20
t2=2000
# since R100=R20*[1+alpha20*(t2-t1)]
R20=R100/(1+alpha20 * (t2-t1))
I20=V/R20
print "Current flowing at the instant of switching on a 100 W metal filament lamp is : ",round(I20,2)," A"
from fractions import Fraction
#given data
t2=50 # in degree C
t1=20 # in degree C
R1=600 # in ohm
R2=300 # in ohm
# Let resistance of 600 ohm resistance at 50 degree C = R_600
R_600=R1*(1+(t2-t1)*.001) # in ohm
# Let resistance of 300 ohm resistance at 50 degree C = R_300
R_300=R2*(1+(t2-t1)*.004) # in ohm
R_50=R_600+R_300 # in ohm
print "Resistance of combination at 50degree C is : ",(R_50)," ohm"
R_20=R1+R2 # in ohm
alpha_20=(R_50/R_20-1)/(t2-t1)
alpha_50=1/(1/(alpha_20)+(t2-t1))
print "Effective temperature coefficient of combination at 50 degree C is : ",Fraction(alpha_50).limit_denominator(1000),"per degree C"
#given data
toh=1.73#in micro-ohm-cm
tohDesh=1.74 #in micro-ohm-cm
sigma=1/toh # conductivities of pure metal
sigmaDesh=1/tohDesh #conductivities metal with impurity
PercentImpurity=((sigma-sigmaDesh)/sigma)*100
print " Percent impurity in the rod is : %0.4f"%(PercentImpurity)," %"
#given data
ElectricalResistivity=2.86*10**-6 #in ohm-cm
sigma=1/ElectricalResistivity
T=273+20 # in Kelvin (Temperature)
#Formula K/(sigma*T)=2.44*10**-8
K=(2.44*10**-8*T*sigma)
print "Thermal conductivity of Al = %0.2f"%K
#given data
E_AC=16*10**-6 #in V per degree C
E_BC=-34*10**-6 #in V per degree C
#By law of successive contact (or intermediate metals)
E_AB=E_AC-E_BC #in V/degree C
E_AB=E_AB*10**6 # in miu V/degree C
print "EMF of iron with respect to constantan is : ",(E_AB)," micro V/degree C"
#given data
E_AC=7.4 #in miu V per degree C
E_BC=-34.4 #in miu V per degree C
#By law of successive contact (or intermediate metals)
E_AB=E_AC-E_BC #in miu V/degree C
E_AB=E_AB*10**-6 # in V/degree C
# Let Thermo-emf for a temperature difference of 250 degree C = EMF_250
EMF_250=E_AB*250 # in V
EMF_250=EMF_250*10**3 #in mV
print "Termo-emf for a temperature difference of 250 degree C is ",(EMF_250)," mV"
#given data
#Take iron as metal A and copper as metal B with respect to lead
#For metal A:
p_A=16.2
q_A=-0.02
#For metal B:
p_B=2.78
q_B=+0.009
p_AB=p_A-p_B
q_AB=q_A-q_B
T2=210 #in degree C
T1=10 # in degree C
E=p_AB*(T2-T1)+q_AB/2*(T2**2-T1**2)
print "Thermo-electric emf is : ",(E)," micro V"
Tn=-p_AB/q_AB
print "Neutral temperature is : ",round(Tn,0)," degree C"
from math import ceil
#given data
p_A=17.34
q_A=-0.0487
p_B=1.36
q_B=+0.0095
p_AB=p_A-p_B
q_AB=q_A-q_B
T2=210 #in degree C
T1=10 # in degree C
E=p_AB*(T2-T1)+q_AB/2*(T2**2-T1**2) #in miu V
E=E*10**-3 #in m V
print "Thermo-electric emf is : ",(ceil(E))," m V"
Tn=-p_AB/q_AB
print "Neutral temperature is : ",(ceil(Tn))," degree C"
Tc=10 # in degree C
Ti=Tn+(Tn-Tc)
print "Temperature of inversion is : ",(ceil(Ti))," degree C"
E_max=15.98*(275-10)-1/2*0.0582*(275**2-10**2) #in miu V
E_max=E_max*10**-3 # in mV
print "Maximum possible thermo-electric emf at neutral temperature that is at 275 degree C is : %0.3f"%(E_max)," mV"
#given data
rho=146*10**-6# in ohm-cm
a=1 #in cm**2
l=1 #in cm
# let current = i
i=0.06 #in amp
R=rho*l/a #in ohm
# Let potential difference per degree centigrade = P
P=i*R # By Ohm's law
print "Potential difference per degree centigrade is : ",(P)," volt"
from sympy.mpmath import quad
#given data
T_lower=10 # in degree C
T_upper=150 # in degree C
# T for iron at any temperature T degree C w.r.t. lead is given by (17.34-0.0487 T)*10**-6 and that for copper by (1.36-.0095 T)*10**-6
T_i = lambda T: (17.34-0.0487*T)*10**-6 #Thermo-electric power
T_c = lambda T: (1.36-0.0095*T)*10**-6 #Thermo-electric power
# Thermo-electric power, P=dE/dT
# or dE=P*dT
# Thermo-emf for copper between temperature 10 degree C and 150 degree C,
E_c= quad(T_c,[T_lower,T_upper])
# Thermo-emf for iron between temperature 10 degree C and 150 degree C,
E_i= quad(T_i,[T_lower,T_upper])
# Thermo-emp for copper-iron thermo-couple
E=E_i-E_c
print "Thermo-emf for iron between temperature 10 degree C and 150 degree C is : ",(E*10**6)," micro V"
#given data
Hc_0=8*10**5 #in A/m
Tc=7.26 #in K
T=4 #in K
Hc_T=Hc_0*(1-(T/Tc)**2)
print "The critical value of magnetic field at T=4 K is : %0.4e"%(Hc_T)," A/m"
from __future__ import division
#given data
Hc=7900 #in A/m
d=1 #in mm
r=d/2 #in mm
r=r*10**-3 #in m
Ic=2*pi*r*Hc
print "Critical current is : %0.3f"%(Ic)," A"
#given data
Hc_0=8*10**4 #in A/m
Tc=7.2 #in K
T=4.5 #in K
d=1 #in mm
r=d/2 #in mm
r=r*10**-3 #in m
Hc=Hc_0*(1-(T/Tc)**2)
print "The critical field at T=4.5 K is : %0.3e"%(Hc)," A/m"
Ic=2*pi*r*Hc
print "Critical current is : %0.2f"%(Ic)," A"
from math import sqrt
# Formula R=rho*l/a
#putting value for copper wire
R=2 # in ohm
l=100 #in meter
rho=1.7*10**-8 # (for copper)
a=rho*l/R #in meter
a=a*10**6 # in mm
# Formula a=pi/4*d**2
d_copper=sqrt(a*4/pi) # (d_copper is diameter for copper)
# Formula R=rho*l/a
#putting value for Aluminium wire
R=2 # in ohm
l=100 #in meter
rho=2.8*10**-8 # (for aluminium)
a=rho*l/R #in meter
a=a*10**6 # in mm
# Formula a=pi/4*d**2
d_aluminium=sqrt(a*4/pi) # (d_aluminium is diameter for aluminium)
DiaRatio=d_aluminium/d_copper # (DiaRatio is ratio of diameter of aluminium and copper)
print "The diameter of the aluminium wire is ",round(DiaRatio,2)," times that of copper wire"
from math import log
#given data
l=60 # in cm
l=l*10**-2 #in meter
d=20 # in cm
d=d*10**-2 #in meter
D=35 # in cm
D=D*10**-2 #in meter
r1=d/2
r2=D/2
rho=8000 # in ohm-cm
rho=80 # in ohm-m
# Let Insulation resistance of the liquid resistor = Ir
Ir=(rho/(2*pi*l))*log(r2/r1)
print " Insulation resistance of the liquid resistor is : ",round(Ir,2)," ohm"
#given data
R_desh=1820 # in M ohm
R_desh=R_desh*10**6 # in ohm
d1=1.5 # in cm
d1=d1*10**-2 # in meter
d2=5 # in cm
d2=d2*10**-2 # in meter
l=3000 # in meter
r1=d1/2
r2=d2/2
rho= (2*pi*l*R_desh)/log(r2/r1)
print "Resistivity of dielectric is : %0.2e"%(rho)," ohm meter"
# given data
# First Case:
r1=1.5/2 # in cm
# let radius thickness of insulation = r1_t
r1_t=1.5 # in cm
r2=r1+r1_t
R_desh=500 # in M ohm
R_desh=R_desh*10**6 # in ohm
# Second case:
r1_desh=r1 # in cm (as before)
# let radius thickness of insulation = r2_t
r2_t=2.5 # in cm
r2_desh=r1+r2_t
# since Insulation resistance , R_desh= sigma/(2*pi*l)*log(r2/r1) and
# R1_desh= sigma/(2*pi*l)*log(r2_desh/r1_desh)
# Dividing R1_desh by R1, We get
# R1_desh/R_desh = log(r2_desh/r1_desh)/log(r2/r1)
# Let R = R1_desh/R_desh, Now
R= log(r2_desh/r1_desh)/log(r2/r1)
R1_desh=R*R_desh
print "New insulation resistance is : ",round(R1_desh*10**-6,2)," M ohm"
from math import exp
# given data
t1=20 # in degree C
t2=36 # in degree C
alpha_20=0.0043 # in per degree C (Temperature Coefficient)
InsulationResistance=480*10**6 # in ohm
copper_cond_res=0.7 # in ohm (copper conductor resistance)
l=500*10**-3 # in kilo meter (length)
R1_desh=InsulationResistance * l # in ohm
# From Formula log(R2_desh)= log(R1_desh-K*(t2-t1))
# K= 1/(t2-t1)*log(R1_desh/R2_desh)
# since when t2-t1=10 degree C and R1_desh/R2_desh= 2
K=1/10*log(2)
# (i) Insulation resistance at any temperature t2, R2_desh is given by
logR2_desh= log(R1_desh)-(t2-t1)/10* log(2)
R2_desh= exp(logR2_desh)
print "(i) Insulation resistance at any temperature : ",round(R2_desh*10**-6,2)," Mega ohm"
# (ii)
R_20= copper_cond_res/l # in ohm
R_36=R_20*(1+alpha_20*(t2-t1))
print "(ii) Resistance at 36 degree C is : ",(R_36)," ohm"