from __future__ import division
from math import sqrt, pi
# Calculation of (a) wavelength (b) resposivity and (c) incident power
#Given data
e=0.7# # Efficiency
c=3*10**8# # Speed of light
h=6.62*10**-34 # Planck constant
E=2.2*10**-19# # Energy of photons
e1=1.6*10**-19# # Electron charge
# (a) Wavelength computation
lamda=h*c/E # Wavelength of laser source
f=c/lamda#
# (b) Responsivity
R=e*(lamda*e1)/(h*c)#
# (c) Incident power
Ip=2*10**-6# # Photocurrent
P=Ip/R#
print"Wavelength of operation = %0.1f micrometer "%(lamda*10**6)#
print"Responsivity R = %0.2f A/W "%(R)#
print"output power P = %0.2f microwWatt "%(P*10**6)#
# Computation of (a) quantum efficiency and (b) resposivity
#Given data
nh=1.5*10**12# # No. of hole pairs generated
np=2.5*10**12# # No. of incident photons
lamda=0.85*10**-6# # Wavelength of laser source
c=3*10**8# # Speed of light
h=6.62*10**-34 # Planck constant
e1=1.6*10**-19# # Electronic charge
# (a) Quantum efficiency
e=nh/np#
# (b) Responsivity
R=e*(lamda*e1)/(h*c)# #
print"Quantum efficiency = %0.1f "%(e)#
print"Responsivity R = %0.3f A/W "%(R)#
# Computation of (a) wavelength (b) power and (c) resposivity
#Given data
e=0.7# # Quantum efficiency
c=3*10**8# # Speed of light
h=6.62*10**-34 # Planck constant
E=1.5*10**-19# # Energy of photons
e1=1.6*10**-19# # Electronic charge
I=4*10**-6# # Diode photocurrent
# (a) Wavelength of operation
lamda=h*c/E#
# (b) Responsivity
R=e*(lamda*e1)/(h*c)# #
# (c) Incident optical power
p=I/R# #power
print"Wavelength of operation = %0.3f micrometer "%(lamda*10**6)#
print"Responsivity R = %0.3f A/W "%(R)#
print"output power P = %0.3f microwWatt "%(p*10**6)#
# Computation of (a)resposivity (b)output current and (c)multiplication factor
#Given data
e=0.7# # Quantum efficiency
c=3*10**8# # Speed of light
h=6.62*10**-34 # Planck constant
E=1.5*10**-19# # Energy of photons
lamda=0.85*10**-6 # Wavelength of laser source
P=0.6*10**-6# # Incident light power
e1=1.6*10**-19# # Electronic charge
I=10*10**-6# # Output current of the device
# (a) Responsivity
R=e*(lamda*e1)/(h*c)#
# (b) Photocurrent
Ip=R*P#
# (c) Multiplication factor
M=I/Ip
print"Responsivity R = %0.3f A/W "%(R)#
print"Output current Ip = %0.3f microA "%(Ip*10**6)#
print"Multiplication factor M = %0.0f "%(M)#
#Calculation mistake in (b)Phtocurrent in the book
# Computation of cut off wavelength
# Given data
h=6.626*10**-34# # Planck constant.
c=3*10**8# # Speed of light
Eg= 1.43*1.602*10**-19# # Bandgap energy
# Cut off wavelength
lamda= h*c/Eg#
print"Cut off wavelength = %0.3f micrometer "%(lamda*10**6)#
# Computation of cut off wavelength
# Given data
h=6.626*10**-34# # Planck constant
c=3*10**8# # Speed of light
Eg= 0.7*1.602*10**-19# # Bandgap energy
# Cut off wavelength
lamda= h*c/Eg#
print"Cut off wavelength = %0.2f micrometer "%(lamda*10**6)#
# Computation of value of reflectance
# Given data
n1=3.5# # Refractive index of silicon
n2=1# # Refractive index of photodiode
#Value of reflectance
R=((n1-n2)/(n1+n2))**2#
print"Value of reflectance, R = %0.2f "%(R)#