import math
#page no 616
#prob no. 20.1
# Variables
lembda = 1300.*10**-9; #wavwlength in m
c = 3*10**8; #speed of light in m/s
# Calculations
f = c/lembda #in Hz
# Results
print 'frequency of laser is ,f = %.0f THz'%(f*10**-12);
import math
# Variables
theta_i = 30; #degree
ni = 1.00; #incident refraction index
nr = 1.52; #refeacted ray refraction index
# Calculations
theta_r = math.asin(ni/nr*math.sin(theta_i*math.pi/180)); #in radians
# Results
print 'angle of refraction is %.2f degree'%(theta_r*180/math.pi);
import math
# Variables
theta_r = 90.; #degree
ni = 1.52; #refraction index for crown glass
nr = 1.00; #refraction index for air
# Calculations
theta_i = math.asin(nr/ni*math.sin(theta_r*math.pi/180)); #in radians
# Results
print 'critical angle is %.2f degree'%(theta_i*180/math.pi);
#misprinted theta_r in the text
#values are raunded up in the text
# Variables
eta = .8; #efficiency
lembda = 850; #nm
# Calculations
R = eta*lembda/1234; # A/W
# Results
print 'The responsivity of diode is R = %.2f A/W'%(R);
# Calculations
eta = .6; #efficiency
lembda = 1310; #nm
# Calculations
R = eta*lembda/1234; # A/W
# Results
print 'The responsivity of diode is R = %.2f A/W'%(R);
# Calculations
L = .4*.8; #loss in dB
# Results
print 'The loss usong this cable is L = %.2f dB'%(L);
# Calculations
L = 2.7*.8; #loss in dB
# Results
print 'The loss usong multimode cable is L = %.2f dB'%(L);