import math
#Variable declaration
T=300# K
ni=1.5*10**10 #cm**-3
k=8.617*10**-5 #eV/K
Nd=10**16 #cm**-3
Va=0.60 #V
#Calculations&Results
#pn=pn0*exp(e*Va/k*T)
pn0=ni**2/Nd
print "thermal equlibrium minority carrier hole concentration is %.2e cm**-3 "%pn0
pn=pn0*math.exp(Va/(k*T))
print "minority carrier hole concentration is %.2e cm**-3 "%pn
#answe varies due exp() method of python
import math
#Variable declaration
T=300#K
Na=10**16 #cm^-3
Nd=10**16 #cm^-3
ni=1.5*10**10 #cm^-3
Dn=25 #cm^2/s
Dp=10 #cm^2/s
taup0=5*10**-7 #s
taun0=5*10**-7 #s
epsilon=11.7
e=1.6*10**-19 #C
#Calculations
#J=(E*D*np0/Ln)+(E*D*pn0/Lp)
Js=e*ni**2*((1./Na)*math.sqrt(Dn/taun0)+(1./Nd)*math.sqrt(Dp/taup0))
#Result
print "reverse saturation current density is %.2e A/cm^2"%Js
import math
#Variable declaration
T=300 #K
k=8.617*10**-5#eV/K
e=1.6*10**-19 #C
Jp=5 #A/cm^2
Jn=20 #A/cm^2
Va=0.65 #V
ni=1.5*10**10 #cm^-3
Dn=25. #cm^2/s
Dp=10 #cm^2/s
taup0=5*10**-7 #s
taun0=5*10**-7 #s
#Calculations&Results
#Jn=(e*Dn*np0/Ln)*[exp(e*Va/k*T)-1]==e*sqrt(Dn/taun0)*(ni^2/Na)*[exp(e*Va/k*T)-1]
Na=e*math.sqrt(Dn/taun0)*(ni**2/Jn)*((math.exp(Va/(k*T)))-1)
print "Na elctron diffusion current density is %.2e cm^-3"%Na
#Jp=(e*Dp*pn0/Lp)*[exp(e*Va/k*T)-1]==e*sqrt(Dp/taup0)*(ni^2/Nd)
Nd=e*math.sqrt(Dp/taup0)*(ni**2/Jp)*((math.exp(Va/(k*T)))-1)
print "Nd hole diffusion current density is %.2e cm^-3 "%Nd
import math
#Variable declaration
T=300 #K
k=8.617*10**-5#eV/K
e=1.6*10**-19 #C
Va=0.65 #V
Js=4.15*10**-11# A/cm^2
Nd=10**16 #cm**-3
un=1350 #cm^2/Vs
Jn=3.29 #A/cm^2
#Calculations&Results
J=Js*(math.exp(Va/(k*T))-1)
print "current density is %.2f A/cm^2"%J
E=Jn/(e*Nd*un)
print "electric field is %.2f V/cm "%E
#Variable declaration
T1=300. #K
T2=310. #K
k=8.617*10**-5#eV/K
e=1.602*10**-19 #C
Va1=0.60 #V
E=1.12 #eV
#Calculations
#J=exp(-Eg/(k*T))*exp((e*Va)/(k*T))
Va2 = (E*(T1-T2))/(e*(T1-T2))
ch = Va2-Va1
#Result
print "Change in forward bias voltage is %.3e"%ch
#Incorrect solution in textbook
#Variable declaration
T=300 #K
k=8.617*10**-5#eV/K
e=1.6*10**-19 #C
Vt=0.0259 #v
lp0=10**-3 #A
taup0=10**-7 #s
Idq=1*10**-3#A
#Calculations&Results
Cd=(1*lp0*taup0)/(2*Vt)
print "diffusion capacitance is %.2e F "%Cd
vd=(Vt/Idq)
print "diffusion is %.1f ohm "%vd
import math
#Variable declaration
T=300 #K
k=8.617*10**-5#eV/K
e=1.6*10**-19 #C
Na=10**16 #cm^-3
Nd=10**16 #cm^-3
ni=1.5*10**10 #cm^-3
tau0=5*10**-7 #s
eps=11.7
#Vbr+Vr=z
z=5 #V
#Calculations&Results
W=math.sqrt(((2*eps))*((Na+Nd)/Na*Nd)*z)
print "depletion width is %.2e cm "%W #textbook ans is wrong
Jgen=(e*ni*W)/(2*tau0)
print "generation current density is %.2e A/cm^2"%Jgen #textbook ans is wrong