'''Find the quantum efficiency'''
#Varaible declaration
re = 4.2*10**6 #EHP's
rp = 6*10**6 #no. of photons
lamda = 1200 #wavelength(nm)
#Calculation
N = re/rp
#Result
print "Quantum efficiency =",N*100,"%"
'''Find photocurrent'''
#Varaible declaration
R = 0.85 #responsivity(A/W)
Po = 1 #incident power(mW)
#Calculation
Ip = R*Po
#Result
print "Photocurrent =",Ip,"mA"
'''Find responsivity of photo diode'''
#Varaible declaration
E = 0.75*1.6*10**-19 #energy gap(V)
c = 3*10**8 #speed of light(m/s)
N = 60./100 #quantum efficiency
h = 6.62*10**-34 #Planck's constant
#Calculation
lamda = (h*c)/E
R = (N*lamda)/1248
#Result
print "Responsivity =",round((R/1E-9),1),"A/W"
'''Find responsivity and quantum efficiency'''
#Varaible declaration
re = 1.5*10**12 #EHP's
rp = 3*10**12 #no. of photons
lamda = 0.65*10**-6 #wavelength(m)
h = 6.62*10**-34 #Palnck's constant
c = 3*10**8 #speed of light(m/s)
e = 1.6*10**-19 #charge of an electron(C)
#Calculation
N = re/rp
R = (N*e*lamda)/(h*c)
#Result
print "Quantum efficiency =",N*100,"%"
print "Responsivity =",round(R,3),"A/W"
'''Estimate -
a)operating walength
b)incident optical power'''
#Varaible declaration
E = 1.5*10**-19 #photon energy(J)
c = 3*10**8 #speed of light(m/s)
N = 65./100 #quantum efficiency
Ip = 1.5*10**-6 #photocurrent(A)
h = 6.62*10**-34 #Planck's constant
c = 3*10**8 #speed of light(m/s)
e = 1.6*10**-19 #charge of an electron(C)
#Calculations
#Part a
lamda = (h*c)/E
#Part b
f = c/lamda
R = (N*e)/(h*f)
Po = Ip/R
#Results
print "a)Operating waelength =",lamda/1E-6,"um"
print "b)Optical power =",round((Po/1E-6),2),"uW"
'''Find wavelength'''
#Varaible declaration
Eg = 1.43*1.6*10**-19 #energy gap(V)
c = 3*10**8 #speed of light(m/s)
h = 6.62*10**-34 #Planck's constant
#Calculations
lamda_c = (h*c)/Eg
#Result
print "Wavelength =",round((lamda_c/1E-6),2),"um"
'''Find -
a)responsivity
b)Optical power received
c)no. of received photons'''
#Varaible declaration
N = 50./100 #quantum efficiency
lamda = 900 #wavelength(nm)
Ip = 10**-6 #photocurrent(A)
c = 3*10**8 #speed of light(m/s)
h = 6.62*10**-34 #Planck's constant
#Calculations
#Part a
R = (N*lamda)/1248
#Part b
Po = Ip/R
#Part c
n = (Po*lamda*10**-9)/(h*c)
#Results
print "a)Responsivity =",round(R,2),"A/W"
print "b)Optical power =",round((Po/1E-6),2),"*10^-6 W"
print "c)No. of photons =",round((n/1e+13),3),"*10^13(Calculation mistake in textbook)"
'''Find the multiplication factor of photodiode'''
#Varaible declaration
N = 80./100 #quantum efficiency
lamda = 0.9*10**-6 #wavelength(m)
I = 12*10**-6 #output current(A)
Po = 0.5*10**-6 #incident power(W)
c = 3*10**8 #speed of light(m/s)
h = 6.626*10**-34 #Planck's constant
e = 1.6*10**-19 #charge of an electron(C)
#Calculations
R = (N*e*lamda)/(h*c) #responsivity(A/W)
Ip = Po*R #photocurrent(A)
M = I/Ip
#Result
print "Multiplication factor =",M
'''Find the responsivity and multiplication factor'''
#Varaible declaration
N = 65./100 #quantum efficiency
lamda = 850*10**-9 #wavelength(m)
I = 10*10**-6 #output current(A)
Po = 0.5*10**-6 #incident power(W)
c = 3*10**8 #speed of light(m/s)
h = 6.626*10**-34 #Planck's constant
e = 1.6*10**-19 #charge of an electron(C)
#Calculations
R = (N*e*lamda)/(h*c) #responsivity(A/W)
M = I/(R*Po)
#Result
print "Responsiviy =",round(R,3),"A/W"
print "Multiplication factor =",M
'''Estimate -
a)noise equivalent power
b)specific detectivity'''
#Varaible declaration
N = 55./100 #quantum efficiency
lamda = 1.3*10**-6 #wavelength(nm)
Id = 8*10**-9 #dark current(A)
A = 75*50*10**-12 #dimensions(m)
c = 3*10**8 #speed of light(m/s)
h = 6.62*10**-34 #Planck's constant
#Calculations
#Part a
NEP = (h*c*((2*e*Id)**0.5))/(N*e*lamda)
#Part b
D = A**0.5/NEP
#Results
print "a)Noise equivalent power =",round((NEP/1E-14),2),"*10^-14 W"
print "b)Specific detectivity =",round((D/1E+8),2),"*10^8"
'''Find -
a)optical gain
b)CE current'''
#Varaible declaration
N = 60./100 #quantum efficiency
lamda = 1.26*10**-6 #wavelength(m)
Ic = 15*10**-3 #output current(A)
Po = 125*10**-6 #incident power(W)
c = 3*10**8 #speed of light(m/s)
h = 6.626*10**-34 #Planck's constant
e = 1.6*10**-19 #charge of an electron(C)
#Calculations
#Part a
Go = (h*c*Ic)/(lamda*e*Po)
#Part b
Nfe = Go/N
#Results
print "a)Optical gain =",round(Go,1)
print "b)Common emiiter current =",round(Nfe,1),"A"
'''Calculate the maximum 3dB bandwidth'''
import math
#Variable declaration
tf = 5*10**-12 #transit time(sec)
G = 70 #photoconductive gain
#Calculation
Bm = 1/(2*math.pi*tf*G)
#Result
print "The maximum 3dB bandwidth permitted by photoconductor is",round((Bm/1E+6),1),"MHz"
'''Calculate the output photocurrent'''
#Variable declaration
rp = 10**11 #no. of photons/sec
hf = 1.28*10**19 #energy of photons(J)
e = 1.6*10**-19 #charge of an electron(C)
#Calculations
Po = rp/hf
N = 1 #efficiency for an ideal photodiode
Ip = (N*Po*e)/hf
#Result
print "Output photocurrent =",round((Ip/1E-47),2),"*10^-47 A(Calculation mistake in textbook)"
'''Find the output photocurrent'''
#Variable declaration
R = 0.40 #responsivity(A/W)
phi = 100 #incident flux(uW/mm^2)
A = 2 #active area(mm^2)
#Calculations
Po = phi*A #incident power(uW)
Ip = R*Po
#Result
print "Photocurrent =",Ip/1e+3,"mA"
'''Find the multiplication factor of photodiode'''
#Varaible declaration
N = 50./100 #quantum efficiency
lamda = 1.3*10**-6 #wavelength(m)
I = 8*10**-6 #output current(A)
Po = 0.4*10**-6 #incident power(W)
c = 3*10**8 #speed of light(m/s)
h = 6.626*10**-34 #Planck's constant
e = 1.6*10**-19 #charge of an electron(C)
#Calculations
R = (N*e*lamda)/(h*c) #responsivity(A/W)
Ip = Po*R #photocurrent(A)
M = I/Ip
#Result
print "Multiplication factor =",round(M,2)
'''Calculate the maximum 3dB bandwidth'''
import math
#Variable declaration
tf = 4.5*10**-12 #transit time(sec)
G = 80 #photoconductive gain
#Calculation
Bm = 1/(2*math.pi*tf*G)
#Result
print "The maximum 3dB bandwidth permitted by photoconductor is",round((Bm/1E+10),4),"GHz(Calculation mistake in textbook)"
'''Estimate responsivity and received optical power'''
#Varaible declaration
N = 50./100 #quantum efficiency
lamda = 0.9*10**-6 #wavelength(m)
Ip = 10**-6 #photocurrent(A)
c = 3*10**8 #speed of light(m/s)
h = 6.62*10**-34 #Planck's constant
e = 1.6*10**-19 #charge of an electron(C)
#Calculations
R = (N*e*lamda)/(h*c)
Po = Ip/R
#Results
print "Responsivity =",round(R,2),"A/W"
print "Optical power =",round((Po/1E-6),2),"*10^-6 W"
'''Find the efficiency of a PIN silicon photodiode'''
#Varaible declaration
R = 0.374 #responsivity(A/W)
lamda = 1300*10**-9 #wavelength(m)
c = 3*10**8 #speed of light(m/s)
h = 6.62*10**-34 #Planck's constant
e = 1.6*10**-19 #charge of an electron(C)
#Calculations
N = (R*h*c)/(e*lamda)
#Result
print "Efficiency =",round((N*100),1),"%"
'''Find the thickness of the intrinsic region'''
#Variable declaration
A = 1.5*10**-3 #area(mm^2)
R = 100 #load resistance(Ohms)
Eo = 1.04*10**-10 #permitivitty for Si(F/m)
vd = 10**7 #electron saturation velocity(m/s)
#Calculation
w = (R*Eo*A*vd)**0.5
#Result
print "The required thickness is",round(w/1E-6),"um(Calculation mistake in textbook)"
'''Find the dark current'''
import math
#Varaible declaration
N = 64./100 #quantum efficiency
lamda = 0.85*10**-6 #wavelength(m)
B = 1 #bandwidth(Hz)
D = 7*10**10 #specific detectivity(/MHz-W)
A = 10*10**-6 #dimensions(m)
c = 3*10**8 #speed of light(m/s)
h = 6.62*10**-34 #Planck's constant
e = 1.602*10**-19 #charge of an electron(C)
#Calculations
Id = ((N*math.sqrt(e*A)*lamda)/(h*c*math.sqrt(2)*D))**0.5
#Result
print "Dark current =",round((Id/1E-3),2),"mA"
#Square root of Id has not been taken in the textbook.Hence, the difference in solution