from __future__ import division
from math import log
#Calculation of barrier potential
#Given data
p=5# # Resistivity of p-region
n=2# # Resistivity of n-region
mu=3900#
k=0.026# #Boltzmann constant
ni=2.5*10**13# #Density of the electron hole pair
e=1.6*10**-19# #charge of electron
#Barrier potential calculation
r0=(1/p)# # Reflection at the fiber air interface
r1=(1/n)#
m=r1/(mu*e)#
p=6.5*10**14# #Density of hole in p -region
Vb=k*log(p*m/ni**2)#
print "Barrier potential = %0.3f V"%Vb
# The answers vary due to round off error
# Calculation of external efficiency
#Given data
ne1=0.20# #Total efficiency
V=3# # Voltage applied
Eg=1.43# # Bandgap energy
# External efficiency
ne=(ne1*Eg/V)*100#
print "External efficiency of the device = %0.1f %% "%(ne)#
from math import exp
# Calculation of ratio of threshold current densities
# Given data
To1=160# # Device temperature
To2=55# # Device temperature
T1=293#
T2=353#
J81=exp(T1/To1)# # Threshold current density
J21=exp(T2/To1)#
J82=exp(T1/To2)##
J22=exp(T2/To2)##
cd1=J21/J81# # Ratio of threshold current densities
cd2=J22/J82#
print"Ratio of threshold current densities= %0.2f "%(cd1)
print"Ratio of threshold current densities= %0.2f "%(cd2)
#Computation of conversion efficiency
#Given data
i=10*10**-6# # Device current
p=5# # Electrical power
op=50 *10**-6# # Optical power
ip=5*10*10**-3# # Input power
#Conversion efficiency
c=op/ip*100#
print "Conversion efficiency = %0.1f %% "%(c)
# Calculation of total power emitted
#Given data
r=0.7# # Emissivity
r0=5.67*10**-8# # Stephen's constant
A=10**-4# # Surface area
T=2000# # Temperature
# Total power emitted
P=r*r0*A*T**4#
print"Total power emitted = %0.1f Watts "%P
# Computation of total energy
#Given data
h=6.63*10**-34# # Planck constant
v=5*10**14# # Bandgap frequency of laser
N=10**24# # Population inversion density
V=10**-5# # Volume of laser medium
# Total energy
E=(1/2)*h*v*(N)*V#
print "Total energy = %0.1f J "%E
# Computation of pulse power
# Given data
L=0.1# # Length of laser
R=0.8# # Mirror reflectance of end mirror
E=1.7# # Laser pulse energy
c=3*10**8# # Velocity of light
t=L/((1-R)*c)# # Cavity life time
# Pulse power
p=E/t#
print"Pulse power = %0.0f W "%p