from math import exp, log
from __future__ import division
#given
pE=0.05
#let E-Ef=EE
EE=0.4 #eV
k=8.614*10**-5
#we know that
#p(E)=1/exp((E-EF)/k/T)
#putting above values in above equation we get
T=EE/k/log(1/pE-1) #K
print """The temperature at which there is a probability of 5 percent
for an electron to occupy energy state which is 0.4 eV above the fermi level is %0.3f K"""%(T)
from __future__ import division
#given
#resistivity of pure silicon is
rho= 3000 #ohm m
#conductivity of pure silicon is reciproca of resistivity
sigma=1/rho #(ohm m)**-1
#mobility of electrons and holes
muh=0.05 #m**2/V s
mue=0.14 #m**2/V s
#charge on elctron
e=1.602*10**-19 #C
# we know that
#sigme=ne*ee*mue+nh*eh*muh
#here we have ne=nh=n and ee=eh=e
#so we have sigma=n*e*muh+n*e*mue
#so
n=sigma/(e*muh+e*mue) #ohm m**2/(C V s)
print " the density of intrensic carriers is %0.3e /m**3"%(n)
#given
#mobility of silicon
mue=0.17 #m**2/V s
#mobility of holes
muh=0.035 #m**2/V s
#carrier density
n=1.1*10**16 #per m**3 (here ne=nh=n)
#electronic charge
e=1.602*10**-19 #C (here ee=eh)
#as we know that
#sigma=ne*ee*mue+nh*eh*muh
#so we get
sigma=n*e*(mue+muh) #per ohm m
#resistivity
rho=1/sigma #ohm m
print " the resistivity of silicon is %0.3f ohm m approx."%(rho)
#given
#resistivity
rho=2*10**-3 #ohm m
#conductivity
sigma=1/rho #per ohm m
#electrons and holes mobility
mue=0.3 #m**2/V s
muh=0.1 #m**2/V s
#charge on holes and electrons are same so
e=1.602*10**-19 #C
#we know that
#sigma=ne*e*mue+nh*e*muh
#here ne=nh=n
#so
n=sigma/(e*(mue+muh)) #per m**3 (some approximation is done in book)
print "the carrier density is %0.3e per m**3"%(n)
#given
#current density
Id=1000 #A/m**2
#resistivity
rho=0.05 #ohm m
#conductivity
sigma=1/rho #per ohm m
#electron mobility
mue=0.4 #m**2/V m
#length of crystal
l=100*10**-6 #m
#charge on electron
e=1.602*10**-19 #C
#in n-type semiconductor ne>>>nh
#so
n=sigma/e/mue #per m**3
#also we know that
#Ie=n*e*vd
#so
vd=Id/n/e #m/s
#the distance l travelled in time t at drift velocity vd, by an electron is given by
#l=t*vd
#so
t=l/vd*10**6 #micro sec
print "the velocity and time taken by the electron to travel 100 m in the crystal is %d m/s and %d micro sec"%(vd,t)
from math import pi
#given
#electronic charge
e=1.602*10**-19 #C
#lengthof rod
l=10*10**-3 #m
#diameter of rod
d=1*10**-3 #m
#area of cross section
A=(pi)/4*d**2 #m**2
#resistance of wire
R=100 #ohm
#mobility of holes
muh=0.19 #m**2/V s
#resistivity of wire
rho=R*A/l #ohm m
#conductivity
sigma=1/rho #per ohm m
#we know that i p-type semiconductore nh>>>ne and eh=e
#so
#sigma=nh*e*muh
#so
nh=sigma/e/muh #per m**3
print "the impurity conc in the rod is %0.3e per m**3"%(nh)
#given
#hole density
n=10**19 #per m**3
#intrinsic carriers concentration
ni=1.5*10**16 # per m**3
#no of conduction electrons are given by
p=(ni)**2/n #per m**3
print "The no of intrinsic carrier are %0.3e per m**3"%(p)
#given
#hole density in silicon
ND=10**17 #per cm**3
#intrinsic carrier concentretion
ni=1.5*10**10 #per cm**3
#since ND>>>> ni, so ne=ND
ne=ND
#the holes concentration
nh=(ni)**2/ne #per cm**3
print " the hole concentration is %.f per cm**3"%(nh)
#relative location of EF and Ei are found from
#EF-Ei=k*Tlog (ne/ni)
#let us assume for notation
#EF-Ei=EE
#temp
T=300 #K
k=8.614*10**-5 #eV
#so now
EE=k*T*log(ne/ni) #eV
print " EF is located at %0.3f eV away from Ei, toeards Ec side as denoted in book"%(EE)
#given
#deimension of aluminium piece
t=15*10**-3 #m (thickness)
b=60*10**-3 #m (width)
l=180*10**-3 #m (length)
#magnetic field
betaz=0.6 #T (tesla)
#current
I=25 #A
#hole mobility
sigmah=0.0012
#electrical conductivity
sigma=3.8*10**7 # per ohm m
#part(a)
#hall coefficient
HC=sigmah/sigma #Vm/AT
#part(b)
#hall voltage
VAB=HC*I*betaz/t #V
#part(c)
#resistance
R=l/sigma/b/t #ohm
print " the hall coefficient is %.12f Vm/AT\n, hall voltage is %.9f V\n and resistance is %.6f ohm"%(HC,VAB,R)
#given
#electron mobility
mue=1.065*10**-3 #m**2/V s
#relaxation time
tau=6*10**-15 #s
#charge on electron
e=1.6*10**-19 #C
#no of electrons
n=1
#mass of electron
me=9.1*10**-31 #kg
#as we know that
#mue=sigma*HC and sigma=n*e**2*tau/me
#so
#mue=n*e**2*tau*HC/me
#from above equation we can get
HC=mue*me/n/e**2/tau #V m**3/A Wb
#condustivity
sigma=mue/HC #per ohm m (calculation mistake in book)
print " the hall coefficient is %.2e V m**3/A Wb and conductivity is %.2e per ohm m"%(HC,sigma)
#given
#electron mobility
mue=1.065*10**-3 #m**2/Vs
#relaxation time
tau=6*10**-15 #sec
#charge on an electron
e=1.6*10**-19 #C
#mass of electron
me=9.1*10**-31 #Kg
n=1
#as we know that
#mue=sigma*Hc and sigma=n*e**2*tau/me
#so
#mue=n*e**2*tau*Hc/me
#upon rearrangement
Hc=mue*me/n/e**2/tau
#and
sigma=mue/Hc #(ohm m)**-1 #(ohm m)**-1 (calulation mistake is there in book)
print " the hall coefficent is %0.3e \n and conductivity of Al sample is %0.3e (ohm m)**-1 "%(Hc,sigma)
from math import atan
#given
#magnetic flux density
betaz=0.5 #T or Wb/m**2
#hall coefficient
HC=3.66*10**-4 #m**3/C
#resistivity of semiconductors
rho=0.00893 #ohm m
#hall angle
thetaH=(atan(HC*betaz/rho))*180/(pi) #degrees
print " the hall angle is %0.3f degrees"%(thetaH)
from math import sqrt
#given
#fermi velocity of electron
VF=0.85*10**6 #m/s
#rest mass of electron
m0=9.109*10**-31 #kg
#charge on an electron
e=1.602*10**-19 #C
#fermi energy is
EF=1/2*m0*(VF)**2 # J
#energy in eV
E=EF/e #eV
print "the fermi energy value = %0.2f ev"%E
print "it indicate that the metal is potassium\n"
#speed of light
c=3*10**8 #m/s
#varying mass of electron can bee calculated as
m=m0*sqrt(1-(VF/c)**2) #kg
#fermi energy
EF=1/2*m*(VF)**2 #J
#energy in eV
E=EF/e #eV
print "the fermi energy value = %0.2f ev"%E
print "it indicate that the metal is potassium\n"
#given
#wavelength of the edge of the absorption edge of a semiconductor material is
lamda=1771*10**-9 #m
#plank's constant
h=6.626*10**-34
#speed of light
c=3*10**8 #m/s
#band gap energy
Eg=h*c/lamda #J
#charge on electron
e=1.602*10**-19 #C
#energy in eV
E=Eg/e #eV
print " the band gap energy is %0.3f eV"%(E)