from numpy import pi
from __future__ import division
#Given data
I=0.5 # in A
rho= 7.4 # in Ω/1000 ft
rho= rho/(3.05*10**4) # in Ω/cm
sigma= 1/rho #in cm/Ω
print "(a) : Conductivity = %0.2e Ω/cm" %sigma
# Part (ii)
n= 6.5*10**28 # in per meter cube
q= 1.6*10**-19 # in C
# Formula sigma= n*q*miu_n
miu_n= sigma/(n*q) # in cm**2/Vs
print "(b) : Mobility = %0.2e cm**2/Vs" %miu_n
# Part (iii)
D= 2.5*10**-3 # in m
A= pi*D**2/4 # in m**2
v_d= I/(n*q*A) # in m/s
print "(c) : Drift velocity = %0.2e m/s" %v_d
#Given data
N_D= 6*10**18 # in per cube cm
N_A= 3*10**15 # in per cube cm
ni= 2.5*10**12
Nn= N_D-N_A # in per cube cm
rho_n= ni**2/Nn # in per cube cm
# Part (i)
print "(a) : The concentration of holes in n-type = %0.2e per cm**3" %rho_n
print " Concentration of electrons in n-type = %0.3e per cm**3" %Nn
# Part (ii)
print "(b) : The material is of n-type"
#Given data
ni= 2.5*10**19
q= 1.6*10**-19 # in C
miu_n= 0.36
miu_p= 0.17
sigma= q*ni*(miu_n+miu_p) # in s/m
rho= 1/sigma # in Ωm
print "The conductivity of Ge = %0.2f s/m" %sigma
print "The resistivity of Ge = %0.2f Ωm" %rho
#Given data
e= 1.6*10**-19 # in C
ni= 1.5*10**16
miu_n= 0.13
miu_p= 0.05
atomicDensity= 5*10**28 #atomic density of Si in /m**3
C= 1/(2*10**8) # concentration
N_D= atomicDensity*C # in /m**3
n=N_D
p= ni**2/N_D # in /m**3
sigma= e*(n*miu_n+p*miu_p) # in s/m
print "Conductivity of the extrinsic semiconductor = %0.1f s/m" %sigma
from math import exp
#Given data
Eg= 0.72 # in eV
Ef= Eg/2 #in eV
K= 8.61*10**-5 # in eV/K
T=300 #in K
nc= 1
n= 1+exp(((Eg-Ef)/(K*T)))
ncBYn= nc/n
print "The fraction of the total number or electrons = %0.2e" %ncBYn
#Given data
ni= 1.4*10**18 #in /m**3
N_D= 1.4*10**24 #in /m**3
n=N_D
p= ni**2/n # in /m**3
nbyp= n/p
print "The ratio of electron to holes concentration = %0.1e" %nbyp
#Given data
d= 2 # in mm
d=d*10**-3 #in m
sigma= 5.8*10**7 # in s/m
miu_c= 0.0032 # in m**2/v-sec
E= 20 #in mV/m
E=E*10**-3 #in V/m
e= 1.6*10**-19 # in C
# Part (a)
n= sigma/(e*miu_c) #in /m**3
print "(a) : Charge density = %0.3e per meter cube" %n
# Part (b)
J= sigma*E #in A/m**2
print "(b) : Current density = %0.2e A/m**2" %J
# Part (c)
Area= pi*d**2/4 # in area of cross-section of wire in m**2
I= J*Area # in A
print "(c) : Current flowing in the wire = %0.3f amp" %I
# Part (d)
v= miu_c*E # in m/sec
print "(d) : Electron drift velocity = %0.1e m/sec" %v
#Given data
rho= 0.5 # in Ω-m
miu_c= 0.4 # in m**2/v-sec
J=100 #in A/m**2
distance=10 # µm
distance=distance*10**-6 #in sec
# V= miu_c*E = miu_c*J/sigma = miu_c*J*rho
V= miu_c*J*rho # in m/sec
print "Drift velocity = %0.f m/sec" %V
T= distance/V # in second
print "The time taken by the electron to travel 10 micro meter in the crystal = %0.1e second" %T
#Given data
Bo= 1.7*10**-5 # in weber/meter**2
miu_o= 4*pi*10**-7 # in weber/amp-meter
H= Bo/miu_o #in A/m
print "The horizontal component of the magnetic intensity = %0.1f A/m" %H
#Given data
H= 5*10**3 # in amp/meter
N= 50
l= 10 #in cm
l=l*10**-2 # in m
n=N/l # in turns/meter
i= H/n # in amp
print "Current should be sent through the solenoid = %0.f ampere" %i
#Given data
vol= 10**-4 # volume of the rod in m**3
i=0.5 # in amp
n= 5 # turns/cm
n= n*10**2 # turns/meter
miu_r= 1000
#B= miu_o*(H+I)
# Where I= Bo/miu_o-H and B= miu*H = miu_r*miu_o*H
# Then I= miu_r*miu_o*H/miu_o - H = (miu_r-1)*H
# H= n*i
I= (miu_r-1)*n*i # in amp/meter
MagMoment= I*vol # in Am**2
print "Magnetic moment = %0.f Am**2" %MagMoment
#Given data
Xm= 9.48*10**-9
miu_r= 1+Xm #
print "Relative permeability = 1 + %0.2e" %Xm
print "That is µr is slightly greater than 1"
#Given data
fie_B= 2*10**-6 # in weber
A= 10**-4 # in m**2
N= 300 # number of turns
l=30 #in cm
l=l*10**-2 #in meter
i=0.032 # in amp
miu_o= 4*pi*10**-7
B=fie_B/A # in weber/meter**2
print "Flux density = %0.1e weber/meter**2" %B
H= N*i/l # in amp-turn/meter
print "Magnetic intensity = %0.f amp-turn/meter"%H
miu= B/H # in weber/amp-meter
print "Pemeability = %0.2e weber/amp-meter" %miu
miu_r= miu/miu_o
print "Relative permeability = %0.f" %miu_r
#Given data
q=1.6*10**-19 # in C
ni= 1.5*10**16 # in /m**3
miu_n= 0.13 # in m**3/vs
miu_p= 0.05 # in m**3/vs
sigma= q*ni*(miu_n+miu_p) # in Ω/m
print "The conductivity = %0.3e Ω/m" %sigma
#Given data
q=1.6*10**-19 # in C
n=4*10**22 # in /m**3
ni= 2.4*10**19 # in /m**3
miu_n= 3500 # in cm**2/vs
miu_n= miu_n*10**-4 # in m**2/vs
# Formula n*p= ni**2
p= ni**2/n # in m**-3
print "Hole concentration = %0.2e m**-3" %p
sigma=q*n*miu_n # in (Ω-m)**-1
print "The conductivity of the extrinsic semiconductor = %0.f (Ωm)**-1" %sigma
# Note : There is miss print in the printed value of p and also calculation error in evaluating the value of p .
# So the answer in the book is wrong
#Given data
ni= 1.8*10**16 # in /m**3
q= 1.6*10**-19 # in C
em=0.14 # electron mobility in m**2/v-sec
hm=0.05 # hole mobility in m**2/v-sec
resistivity= 1.2 # in Ωm
n= 1/(q*em*resistivity) # in /m**3
print "The electron concenration = %0.2e /m**3" %n
p= ni**2/n # in /m**3
print "The hole concentration = %0.1e /m**3" %p
#Given data
miu= 35.2*10**-4 # in m**2/vs
n=7.87*10**28
e= 1.6*10**-19 # in C
sigma= n*e*miu # in s/m
print "Conductivity = %0.3e s/m" %sigma
#Given data
ni= 2.25*10**13 # in /cm**3
e= 1.6*10**-19 # in C
miu_n= 3800 # in cm**2/vs
miu_p= 1800 # in cm**2/vs
no=ni
sigma= no*e*(miu_n+miu_p) # in s/cm
print "The intrinsic conductivity = %0.4f s/cm" %sigma
# Note: Answer in the book is wrong due to calculation error to evaluating the value of sigma
#Given data
e= 1.6*10**-19 # in C
I=100 # in A
n_o= 8.5*10**28 # in m**-3
A=10**-5 # in m**2
# Formula I= n_o*A*e*Vd
Vd= I/(n_o*e*A) # in ms**-1
print "The drift velocity of free electron = %0.3e ms**-1" %Vd
#Given data
miu_n= 0.13 # in m**2/v-sec
lip= 0.05 # in m**2/v-sec
n=5*10**28/10**9 # in /m**3
q= 1.6*10**-19 # in C
sigma= q*n*miu_n # in (Ωm)**-1
print "The conductivity of silicon material = %0.2f (Ωm)**-1" %sigma
#Given data
miu_p= 0.05 # in m**2/v-sec
rho=5*10**28/10**8 # in /m**3
q= 1.6*10**-19 # in C
sigma= q*rho*miu_p # in (Ωm)**-1
print "The conductivity of silicon material = %0.f (Ωm)**-1" %sigma