#importing modules
import math
#Variable declaration
h=6.626*10**-34;
c=3*10**8;
lamda=632.8*10**-9; #wavelength in m
P=5*10**-3; #output power in W
#Calculation
E=(h*c)/lamda; #energy of one photon
E_eV=E/(1.6*10**-19); #converting J to eV
E_eV=math.ceil(E_eV*1000)/1000; #rounding off to 3 decimals
N=P/E; #number of photons emitted
#Result
print("energy of one photon in eV is",E_eV);
print("number of photons emitted per second is",N);
#importing modules
import math
#Variable declaration
h=6.626*10**-34;
c=3*10**8;
lamda=632.8*10**-9; #wavelength in m
#Calculation
E=(h*c)/lamda; #energy of one photon
E_eV=E/(1.6*10**-19); #converting J to eV
E_eV=math.ceil(E_eV*1000)/1000; #rounding off to 3 decimals
#Result
print("energy of one photon in eV is",E_eV);
#importing modules
import math
#Variable declaration
E1=0; #value of 1st energy level in eV
E2=1.4; #value of 2nd energy level in eV
lamda=1.15*10**-6;
h=6.626*10**-34;
c=3*10**8;
#Calculation
E=(h*c)/lamda; #energy of one photon
E_eV=E/(1.6*10**-19); #converting J to eV
E3=E2+E_eV;
E3=math.ceil(E3*100)/100; #rounding off to 2 decimals
#Result
print("value of E3 in eV is",E3);
#answer given in the book for E3 is wrong
#Variable declaration
h=6.626*10**-34;
c=3*10**8;
E2=3.2; #value of higher energy level in eV
E1=1.6; #value of lower energy level in eV
#Calculation
E=E2-E1; #energy difference in eV
E_J=E*1.6*10**-19; #converting E from eV to J
lamda=(h*c)/E_J; #wavelength of photon
#Result
print("energy difference in eV",E);
print("wavelength of photon in m",lamda);
#Variable declaration
h=6.626*10**-34;
c=3*10**8;
E=1.42*1.6*10**-19; #band gap of GaAs in J
#Calculation
lamda=(h*c)/E; #wavelength of laser
#Result
print("wavelength of laser emitted by GaAs in m",lamda);
#importing modules
import math
#Variable declaration
T=300; #temperature in K
lamda=500*10**-9; #wavelength in m
h=6.626*10**-34;
c=3*10**8;
k=1.38*10**-23;
#Calculation
#from maxwell and boltzmann law, relative population is given by
#N1/N2=exp(-E1/kT)/exp(-E2/kT)
#hence N1/N2=exp(-(E1-E2)/kT)=exp((h*new)/(k*T));
#new=c/lambda
R=(h*c)/(lamda*k*T);
RP=math.exp(R);
#Result
print("relative population between N1 and N2 is",RP);
#importing modules
import math
#Variable declaration
T=300; #temperature in K
h=6.626*10**-34;
c=3*10**8;
k=1.38*10**-23;
lamda=600*10**-9; #wavelength in m
#Calculation
R=(h*c)/(lamda*k*T);
Rs=1/(math.exp(R)-1);
#Result
print("the ratio between stimulated emission to spontaneous emission is",Rs);
#importing modules
import math
#Variable declaration
P=5*10**-3; #output power in W
I=10*10**-3; #current in A
V=3*10**3; #voltage in V
#Calculation
e=(P*100)/(I*V);
e=math.ceil(e*10**6)/10**6; #rounding off to 6 decimals
#Result
print("efficiency of laser in % is",e);
#importing modules
import math
#Variable declaration
P=1e-03; #output power in W
d=1e-06; #diameter in m
#Calculation
r=d/2; #radius in m
I=P/(math.pi*r**2); #intensity
I=I/10**9;
I=math.ceil(I*10**4)/10**4; #rounding off to 4 decimals
#Result
print("intensity of laser in W/m^2 is",I,"*10**9");
#importing modules
import math
#Variable declaration
lamda=632.8*10**-9; #wavelength in m
D=5; #distance in m
d=1*10**-3; #diameter in m
#Calculation
deltatheta=lamda/d; #angular speed
delta_theta=deltatheta*10**4;
r=D*deltatheta;
r1=r*10**3; #converting r from m to mm
A=math.pi*r**2; #area of the spread
#Result
print("angular speed in radian is",delta_theta,"*10**-4");
print("radius of the spread in mm is",r1);
print("area of the spread in m^2 is",A);