import math
#variable declaration
m = 9.11*1e-31 #Electron rest mass (kg)
me = 6.19*10**-32 #Effective electron mass = 0.068m (kg)
mh = 5.10*10**-31 #Effective hole mass = 0.56m (kg)
Eg = 1.42*1.60218*1e-19 #bandgap energy (volts)
kB = 1.38054*1e-23 #Boltzman's constant
T = 300 #room temperature (kelvin)
h = 6.6256*1e-34 #Planck's constant
#calculation
K = 2.0*((2.0*math.pi*kB*T/(h**2.0))**(1.5))*((me*mh)**(0.75)) #characteristic constant of material
ni = K*(math.exp(-Eg/(2.0*kB*T))) #intrinsic carrier concentration(1/m^3)
#result
print "Instrinsic carrier concentration = ",round(ni*10**-12+0.07,2)*1e12,"1/m^3","=",round(ni*10**-12+0.07,2)*10**6 ,"1/cm^3"
import math
#variable declaration
x = 0.07 #compositional parameter of GaAlAs
#calculation
Eg = 1.424+1.266*x+0.266*x**2 #energy gap(eV)
Lam_bda = 1.240/Eg #peak emission wavelength(um)
#result
print "Bandgap energy Eg = " ,round(Eg,2),"eV"
print "Peak emission Wavelength lam_bda = " ,round(Lam_bda,2),"um"
import math
#variable declaration
y = 0.57 #compositional parameter of InGaAsP
#calculation
Eg = 1.35-0.72*y+0.12*(y**2) #energy gap(eV)
Lam_bda = 1.240/Eg #peak emission wavelength(um)
#result
print "Bandgap energy Eg = " ,round(Eg,2),"eV"
print "Peak emission wavelength Lam_bda = " ,round(Lam_bda,2),"um"
import math
#variable declaration
tuo_r = 30.0 #radiative re-combination (ns)
tuo_nr =100.0 #non-radiative re-combination (ns)
h = 6.6256*1e-34 #Plank's constant (J.s)
C = 3.0*1e8 #free space velocity (m/sec)
q = 1.602*1e-19 #electron charge (coulombs)
I = 0.040 #drive current (Amps)
Lam_bda = 1.31*1e-6 #peak wavelength of InGaAsP LED
#calculation
tuo_ = (tuo_r*tuo_nr)/(tuo_r+tuo_nr) #bulk recombination time(ns)
Etta_internal = tuo_/tuo_r #internal quantum efficiency
Pinternal = Etta_internal*h*C*I/(q*Lam_bda) #internal power level(mW)
#result
print "Bulk recombination time = " ,round(tuo_,1),"ns"
print "Internal quantum efficiency Etta_internal = ", round(Etta_internal,2)
print "Internal power level = " , round(Pinternal*1000,1), "mW"
import math
#variable declaration
n = 3.5 #refractive index of an LED
#calculation
Etta_External = 1/(n*(n+1)**2) #external quantum efficiency
#result
print "External quantum efficiency = ",round(Etta_External*100,2), "%"
import math
#variable declaration
L = 500*1e-6 #Laser diode length (meters)
R1 = 0.32 #reflection co-efficient value of one end
R2 = 0.32 #reflection co-efficient value of another end
alpha_bar =10*100 #absorption co-efficient(1/cm)
#calculation
alpha_end = (1/(2*L))*(math.log(1/(R1*R2))) #mirrorloss in the lasing cavity
alpha_threshold = alpha_bar+alpha_end #the lasing threshold(1/cm)
#result
print "The lasing threshold gain = " , round(alpha_threshold/100),"1/cm"
import math
#variable declaration
Lam_bda = 850*1e-9 #Emission wavelength of LASER diode(nm)
n = 3.7 #refractive index of LASER diode
L = 500.0*1e-6 #length of LASER diode(um)
C = 3*1e8 #velocity of Light in free space(m/s)
Half_power = 2*1e-9 #half power point 3 (nm)
#calculation
delta_frequency = C/((2*L)*n) #frequency spacing(GHz)
delta_Lamda = (Lam_bda**2)/((2*L)*n) #wavelength spacing(nm)
sigma = math.sqrt(-(Half_power**2)/(2*math.log(0.5))) #spectral width of gain(nm)
#result
print "Freqency spacing = " ,round(delta_frequency/1e9),"GHz"
print "Wavelegth spacing = " , round(delta_Lamda/1e-9,2),"nm"
print "Spectral width of gain = " , round(sigma/1e-9,2),"nm"
import math
#variable declaration
Lam_bda = 900*10e-9 # wavelength of light emitted by laser diode(nm)
L = 300*10e-6 #length of laser chip(um)
n = 4.3 #refractive index of the laser material
#calculation
m = 2*L*n/Lam_bda #number of half-wavelengths
delta_Lambda = (Lam_bda**2)/(2*L*n) #wavelength spacing(nm)
#result
print "Number of half-wavelength spanning the region betwen mirror = " , round(m)
print "Wavelength spacing between lasing modes = " , round(delta_Lambda*1e8,1),"nm"