from __future__ import division
from numpy import exp
#Given data :
lamda=1.5 #in um
T=900 #in kelvin
h=6.63*10**-34 #Planks contant
c=3*10**8 #speed of light in m/s
K=1.38*10**-23 #Boltzman Constant
#Formula : StiEmissionRate/SponEmissionRate=1/(exp(h*F/(K*T))-1)=1/(exp(h*c/(K*T*lamda))-1)
StiEmRateBySponEmRate=1/(exp(h*c/(K*T*lamda*10**-6))-1)
print "Stimulated Emission Rate/Spontanious Emission Rate = %0.2e "%StiEmRateBySponEmRate
#Given data :
lamda=0.8 #in um
lamda=lamda*10**-6 #in meter
deltaNEU=300 #in GHz
deltaNEU=deltaNEU*10**9 #in Hz
c=3*10**8 #speed of light in m/s
n=3.6 #Refractive index(unitless)
#Part (a) :
#Formula : deltaNEU=c/(2*n*L)
L=c/(2*n*deltaNEU) #in meter
print "(a) Length of optical cavity = %0.2f micro meter" %(L*10**6)
#Part(b) :
K=2*n*L/lamda #No. of longitudinal modes
print "(b) No. of longitudinal modes = %0.f " %K
#Given data :
lamda=0.55 #in um
lamda=lamda*10**-6 #in meter
c=3*10**8 #speed of light in m/s
n=1.78 #Refractive index(unitless)
K=260000 #No. of longitudinal modes
#Part (a) :
L=K*lamda/(2*n) #in meter
print "(a) Length of the crystal = %0.4f meter" %L
#Part (b) :
deltaNEU=c/(2*n*L) #in Hz
print "(b) Frequency separation of longitudinal modes = %0.3f GHz" %(deltaNEU*10**-9)
#Given data :
Eg=1.43 #in eV
deltalamda=0.1 #in nm
deltalamda=deltalamda*10**-9#in meter
c=3*10**8 #speed of light in m/s
h=6.63*10**-34 #Planks contant
#Part (a) :
#Fomula : Eg=h*c/lamda
lamda=h*c/(Eg*1.6*10**-19) #in meter
print "(a) Wavelength of optical emission = %0.2f micro meter " %(lamda*10**6)
#Part (b) :
#Formula : deltaNEU=c*deltalamda/lamda**2 #in Hz
deltaNEU=c*deltalamda/lamda**2 #in Hz
print "(b) Frequency separation of longitudinal modes = %0.1f GHz " %(deltaNEU*10**-9)
#Given data :
To=150 #in kelvin
T1=20 #in degree C
T1=T1+273 #in kelvin
T2=70 #in degree C
T2=T2+273 #in kelvin
#Formula Jth=exp(T/To)
Jth20=exp(T1/To)
Jth70=exp(T2/To)
ratio=Jth70/Jth20 #unitless
print "Ratio of current densities for AlGaAs injection laser = %0.1f " %ratio
#Given data :
lamda=1.55 #in um
m=1 #for first order
n=3.5 #Refractive Index(unitless)
#Formula : GratingPeriod=m*lamda/(2*n)
GratingPeriod=m*lamda/(2*n) #in um
print "Grating Period for an InGaAsP DFB Laser diode = %0.2f micro meter" %GratingPeriod
#Given data :
L=0.3 #in mm
L=L*10**-3 #in meter
n=3.6 #Refractive Index(unitless)
c=3*10**8 #speed of light in m/s
lamda=0.82 #in um
lamda=lamda*10**-6 #in meter
deltaNEU=c/(2*n*L) #in Hz
print "Frequency spread between longitudinal modes = %0.f GHz" %(deltaNEU*10**-9)
deltalamda=lamda**2/(c/deltaNEU)#in meter
print "Wavelength spread between longitudinal modes = %0.2f nm"%(deltalamda*10**9)