# Chapter 4: The Semiconductor in Equilibrium¶

## Example 4.1, Page 108¶

In [1]:
import math

#Variable declaration
T=300 #K
Nc=2.8*10**19 #cm**-3
k=8.617*10**-5 #eV K**-1

#Calculations&Results
#E=Ec
#a=Ec-Ef
a=-0.25
#fF(E)=1/(1+exp(Ec-Ef/kT)) =exp(-(Ec-Ef)/kT)
#b=k*T
#print b)
c=k*T
fFE=math.exp(a/c)
print "fF(E) value is= %.2e"%fFE
n0=Nc*math.exp(-a/(k*T))
print "n0 value is %.1e cm**-3"%n0
#answer in the textbook is wrong

fF(E) value is= 6.31e-05
n0 value is 4.4e+23 cm**-3


## Example 4.2, Page 109¶

In [2]:
import math

#Variable declaration
T1=400. #K
T2=300 #K
N=1.04*10**19 #cm^-3
k=8.617*10**-5 #eV/K

#Calculations&Results
Nv=N*(T1/T2)**(3./2)
print 'Nv=%.2e cm^-3'%Nv

a=k*T2*(T1/T2)
print 'kT=%.5f eV'%a

#p0=Nv*exp(-(Ef-Ev)/kT)
p0=Nv*math.exp(-0.27/a)
print 'p0=%.2e cm^-3'%p0

Nv=1.60e+19 cm^-3
kT=0.03447 eV
p0=6.35e+15 cm^-3


## Example 4.3, Page 112¶

In [3]:
import math

#Variable declaration
T1=300 #K
T2=450. #K
Nc=4.7*10**17 #cm**-3
N=7*10**18 #cm**-3
k=8.617*10**-5 #eV/K

#Calculations&Results
a=k*T1*(T2/T1)
print 'kT=%.5f eV'%a

ni=math.sqrt(Nc*N*math.exp(-1.42/(k*T1)))
print 'ni=%.2e cm**-3'%ni

ni=math.sqrt(Nc*N*(T2/T1)**3*math.exp(-1.42/a))
print 'ni=%.2e cm**-3'%ni

kT=0.03878 eV
ni=2.14e+06 cm**-3
ni=3.72e+10 cm**-3


## Example 4.4, Page 114¶

In [4]:
import math

#Variable declaration
T=300 #K
mn=1.08 #m0
mp=0.56 #m0
k=8.617*10**-5 #eV/K

#Calculations
#Efi-Emidgap=(3./4)k*T*log(mp/mn)
#a=Efi-Emidgap
a=(0.75)*k*T*math.log(mp/mn)

#Result
print 'Efi-Emidgap=%.4f eV'%a

Efi-Emidgap=-0.0127 eV


## Example 4.5, Page 123¶

In [5]:
import math

#Variable declaration
T=300 #K
Nn=2.8*10**19 #cm**-3
Np=1.04*10**19 #cm**-3
#a=Ef-Ev
an=0.25 #eV
ap=0.87 #eV
k=8.617*10**-5 #eV/K

#Calculations&Results
n0=Nn*math.exp(-an/(k*T))
print "n0 in cm**-3 is= %.1e"%n0

p0=Np*math.exp(-ap/(k*T))
print "p0 in cm**-3 is=%.1e"%p0

n0 in cm**-3 is= 1.8e+15
p0 in cm**-3 is=2.5e+04


## Example 4.6, Page 126¶

In [6]:
import math

#Variable declaration
nf=2
T=300 #K
Nc=2.8*10**19 #cm^-3

#Calculations
#n0=(2/sqrt(%pi))*Nc*F12(nf)
#x=F12(nf)=2.3
x=2.3
n0=(2./math.sqrt(math.pi))*Nc*x

#Result
print "n0 in cm^-3 is= %.2e"%n0

n0 in cm^-3 is= 7.27e+19


## Example 4.7, Page 130¶

In [7]:
import math

#Variable declaration
Nd=10**16 #cm^-3
Ne=2.8*10**19 #cm^-3
T=300 #K

#Calculations
#(nd/(n0+nd))=z=1/(1+(Ne/2*Nd)*exp(-(Ec-Ed)/kT))
#y=Ec-Ed
y=0.045
k=8.617*10**-5 #eV/K
z=1./(1+(Ne/(2*Nd))*math.exp(-y/(k*T)))

#Result
print "the donor states is= %.2f%%"%(z*100)

the donor states is= 0.41%


## Example 4.9, Page 134¶

In [8]:
import math

#Variable declaration
Nd=10**16 #cm**-3
Na=0
ni=1.5*10**10 #cm**-3
T=300 #K
k=8.617*10**-5 #eV/K

#Calculations&Results
n0=((Nd-Na)/2)+math.sqrt((((Nd-Na)/2)**2)+ni**2)
print "n0 is %.e cm**-3 "%n0

p0=(ni**2)/n0
print "p0 is %.2e cm**-3"%p0

n0 is 1e+16 cm**-3
p0 is 2.25e+04 cm**-3


## Example 4.10, Page 136¶

In [9]:
import math

#Variable declaration
Nd=5*10**13 #cm**-3
Na=0
ni=2.4*10**13 #cm**-3
T=300 #K
k=8.617*10**-5 #eV/K

#Calculations&Results
n0=((Nd-Na)/2)+math.sqrt((((Nd-Na)/2)**2)+ni**2)
print "n0 is %.2e cm**-3"%n0

p0=(ni**2)/n0
print "p0 is %.2e cm**-3"%p0

n0 is 5.97e+13 cm**-3
p0 is 9.66e+12 cm**-3


## Example 4.11, Page 137¶

In [10]:
import math

#Variable declaration
T=300 #K
Nd=3.*10**15 #cm**-3
Na=10.**16 #cm**-3
k=8.617*10**-5 #eV/K
ni=1.5*10**10 #cm^-3

#Calculations&Results
a=((Na-Nd)/2)
b=math.sqrt(((Na-Nd)/2)**2+(ni**2))

p0=a+b
print "p0 is %.e cm^-3"%p0         #textbook ans is wrong

n0=(ni**2)/p0
print "n0 is %.2e cm^-3 "%n0        #textbook ans is wrpng

p0 is 7e+15 cm^-3
n0 is 3.21e+04 cm^-3


## Example 4.12, Page 138¶

In [11]:
import math

#Variable declaration
T1=550. #K
T2=300 #K
Nc=2.8*10**19 #cm**-3
Ne=1.04*10**19 #cm**-3
k=8.617*10**-5 #eV/K
Eg=1.12

#Calculations&Results
#ni^2=Nc*Ne*exp(-Eg/(k*T))
ni=math.sqrt(Nc*Ne*(T1/T2)**3*math.exp((-Eg/(k*T2))*(T2/T1)))
print "ni is %.2e cm^-3 "%ni

#n0=1.05*Nd
#n0=(Nd/2)+sqrt((Nd/2)**2+ni**2)      equation 1

a=(((1.05*2)-1)/2)**2            #simplifying and sloving the about equaton 1
b=ni**2
c=((4*a)-1)/4
Nd=math.sqrt(b/c)
print "Nd value is %.2e cm^-3"%Nd

ni is 3.13e+14 cm^-3
Nd value is 1.37e+15 cm^-3


## Example 4.13, Page 140¶

In [12]:
import math

#Variable declaration
T=300 #K
Na=10**16 #cm^-3
Nc=2.8*10**19 #cm**-3
k=8.617*10**-5 #eV/K

#Calculations
#a=Ec-Ef
a=0.20 #eV
#Ec-Ef=k*T*log(Ne/(Nd-Na))
#Nd-Na=Nc*exp(-(Ec-Ef)/k*T)
Nd=Na+Nc*math.exp(-a/(k*T))

#Result
print "Nd is %.2e cm^-3"%Nd

Nd is 2.22e+16 cm^-3


## Example 4.14, Page 143¶

In [13]:
import math

#Variable declaration
T=300 #K
k=8.617*10**-5 #eV/K
ni=1.5*10**10 #cm^-3
#Ef-Ea=a
a=3*k*T
#Ea-Ev=b
b=0.045 #eV
Eg=1.12 #eV

#Calculations
#Efi-Ef=(Eg/2)-(Ea-Ev)-(Ef-Ea)=kT*log(Na/ni)
c=(Eg/2)-(b)-(a)
Na=ni*math.exp(c/(k*T))

#Result
print "Na is %.1e cm^-3"%Na

Na is 3.4e+17 cm^-3