from __future__ import division
#given
#wavelength of light
lamda=5.893*10**-7 #m
#plank's constant
h=6.626*10**-34 #J s
#velocity of light
c=3*10**8 #m/s
#energy of photon
Ephoton=h*c/lamda #J
#we know that 1eV=1.6*10**-19 J
#so
EPhoton=Ephoton/(1.6*10**-19) #eV
print " the energy of photon is %.23f J or %f eV"%(Ephoton,EPhoton)
from math import exp
#given
##thickness of sample
t=0.45*10**-4 #cm
#energy of light
E1=3 #eV
#absorption coefficient
alpha=50000 #per cm
#incident power on the sample
I0=15*10**-3 #W
#we know that
#intensity of transmitted light is given by
It=I0*exp(-alpha*t) #W or J/s
#thus total energy absorbed is
Iabsorbed=I0-It #W or J/s
print " total energy absorbed is %0.3e J/s"%(Iabsorbed)
#plank's constant
h=6.626*10**-34 #J s
#energy of outgoing radiation
E2=2.35 #eV
#fraction of each photon energy unit which is converted ton heat
E=(E1-E2)/E1
#therefore total amount of energy converted to heat per second is
EC=E*Iabsorbed #J/s
print " total amount of energy coverted to heat is %0.3e J/s"%(EC)
#charge on an electron
e=1.6*10**-19 #C
#no of photons = nphoton
nphoton=Iabsorbed/(e*E1) #photons/sec (calculation mistake is there in book)
print " the no of photon given off from recombination is %0.3e photons/sec"%(nphoton)
#given
#energy of photon
E=1.5*10**-19 #J
#quantum eficiency
muquantam=0.6
#photon current
Iopc=3*10**-6 #A
#speed of light
c=3*10**8 #m/s
#plank's constant
h=6.626*10**-34 #J s
#wavelength at which the photodiode is operatng
lamda=h*c/E*10**6 #micro m
#responsivity of diode
R=0.64
#incident optical power is given by
Piop=Iopc/R*10**6 #micro W
print "wavelength at which photodiode is operating is %0.3f micro m \n and incident optical power is %0.3f micro W"%(lamda,Piop)
from math import asin, pi
#given
#refractive index of core and cladding
mucladding=1.47
mucore=1.50
#critocal angle at the core cladding interface
thetac=asin(mucladding/mucore) *180/(pi) #degrees
print "the critical angle at core cladding interface is %0.3f degrees"%(thetac)
#given
#energy band gap
Eg=0.75*1.6*10**-19 #J
#plank's constant
h=6.626*10**-34 #Js
#speed of light
c=3*10**8 #m/s
#wavelength of light
lamda=h*c/Eg*10**10 #A
print " wavelength of light is %.f A"%(lamda)
#given
#frequency of light
f=1.5*10**9*10**6 #Hz
#pank's constant
h=6.626*10**-34 #J s
#threshold frequency is
f0=1.2*10**9*10**6 #Hz
#maximum energy of emitted photoelectron is
Emax=h*(f-f0)/(1.6*10**-19) #eV
print "The maximum enery of the emitted photoe lectron is %0.3f eV"%(Emax)