from __future__ import division
from math import sqrt, pi
# Calculation of wavelength seperation between longitudinal modes.
#Given data
lamda=0.85# # Wavelength
n1=3.6# # Refractive index of GaAs
L=200*10**-6# # Length of cavity
# Wavelength seperation between longitudinal modes.
lambda1=((lamda)**2)*(10**-12)/(2*n1*L)#
lambda1=lambda1*10**9#
#Displaying results in the command window
print"Wavelength seperation = %0.1f nm**2"%(lambda1)#
# Computation of overall external efficiency
#Given data
eg=1.43# # Bandgap energy
v=2.5# # Electrical supply Voltage
nd=0.18# # Optical efficiency of laser diode
# Computation of overall external efficiency
ne=(nd*eg/v)*100#
print"Overall external efficiency = %0.0f %%"%(ne)#
# Calculation of overall external efficiency of a Laser diode
#Given data
eg=1.43# # Bandgap energy
v=2.5# # Voltage applied
nd=0.30# # Optical efficiency of laser diode
## Overall external efficiency
ne=(nd*eg/v)*100#
print"Overall external efficiency = %0.0f %%"%(ne)#