#Example 3.2
#What is Minimum required energy
#given data
l=6000 #in Angstrum
h=6.6*10**(-34) #Planks constant
c=3*10**8 #speed of light in m/s
e=1.602*10**(-19) #Constant
#calculation
phi=c*h/(e*l*10**(-10))
#result
print"Minimum required energy is",round(phi,2),"eV "
#Exa 3.3
#calculate Work function of the cathode material
#given data
Emax=2.5 #maximum energy of emitted electrons in eV
l=2537.0 #in Angstrum
#Calculation
EeV=12400.0/l #in eV
phi=EeV-Emax #in eV
#result
print "Work function of the cathode material is ",round(phi,2),"eV"
#Example 3.4
#Find (i)The fraction of each photon energy unit which is converted into heat",f
#(ii)Energy converted into heat in ,((2-1.43)/2)*0.009,"J/s"
#(iii)Number of photons per second given off from recombination events ",0.009/(e*2)
#given data
t=0.46*10**-4 #in centi meters
hf1=2 #in ev
hf2=1.43
Pin=10 #in mW
alpha=50000 # in per cm
e=1.6*10**-19 #constant
Io=0.01 #in mW
import math
#Calculation
It=Io*math.exp(-alpha*t) #in mW
Iabs=Io-It
f=(hf1-hf2)/hf1
E=f*Iabs
N=Iabs/(e*hf1)
#result
print"(i)Thus power absorbed is ",round(Iabs,3),"J/s"
print"(ii)Energy converted into heat is",round(E,4),"J/s"
print"(iii)Number of photons per second given off from recombination events ",round(N,-14)
#In book there is calculation mistake in Number of photons.
#Example 3.5
#What is Photoconductor gain
#Electron transit time.
#given data
L=100 #in uM
A=10&-7 #in cm**2
th=10**-6 #in sec
V=12 #in Volts
ue=0.13 #in m**2/V-s
uh=0.05 #in m**2/V-s
#Calculation
E=V/(L*10**-6) #in V/m
tn=(L*10**-6)/(ue*E)
Gain=(1+uh/ue)*(th/tn)
#result
print"Electron transit time in sec is ",round(tn,10),"s"
print"Photoconductor gain is ",Gain
#Example3.6
#Calculate Current flowing through diode .
#given datex
import math
Io=0.15 #in uA
V=0.12 #in mVolt
Vt=26 #in mVolt
#calculation
I=Io*10**-6*(math.exp(V/(Vt*10**-3))-1) #in A
#result
print"Current flowing through diode is ",round(I*10**6,2),"micra A"
#Exa 3.7
#Determine the Forward voltage
#given data
import math
Io=2.5 #in uA
I=10 #in mA
Vt=26 #in mVolt
n=2 #for silicon
#Calculation
V=n*Vt*10**-3*math.log((I*10**-3)/(Io*10**-6))
#Result
print "Forward voltage is ",round(V,2),"V"
#Example 3.8
#What is Reverse saturation current density
#given data
ND=10**21 #in m**-3
NA=10**22 #in m**-3
De=3.4*10**-3 #in m**2-s**-1
Dh=1.2*10**-3 #in m**2-s**-1
Le=7.1*10**-4 #in meters
Lh=3.5*10**-4 #in meters
ni=1.6*10**16 #in m**-3
e=1.602*10**-19 #constant
#calculation
IoA=e*ni**2*(Dh/(Lh*ND)+De/(Le*NA))
#Result
print"Reverse saturation current density is ",round(IoA*10**6,2),"uA "