# page no 888
# prob no 24.3
#calculate the core diameter
#given
NA=0.15;
wl=820*10**-9;#in m
#calculations
d_core=2*(0.383*wl/NA);
#results
print 'The core diameter is',d_core,'m'
# page no 890
# prob no 24.4
#calculate the max distance
#given
Bl=500;#in MHz-km
B=85.;#in MHz
#calculations
# By using Bandwidth-distance product formula
l=Bl/B;
#results
print 'The maximun distance that can be use between repeaters is',round(l,2),'km'
# page no 891
# prob no 24.5
#calculate the total dispersion
#given
wl0=1310.;#in ns
So=0.05;#in ps/(nm**2*km)
l=50.;#in km
wl=1550.;#in ns
d=2.;#in nm
#calculations
# Chromatic dispersion is given as
Dc=(So/4)*(wl-(wl0**4/wl**3));
# Dispersion is
D=Dc*d;
# Therefore total dispersion is
dt=D*l;
#results
print 'The total dispersion is',round(dt,2),'ps'
# page no 893
# prob no 24.6
#given
#calculate the bandwidth distance product
#Refer problem 24.5
dt=949*10**-12;#in sed
l=50.;#in km
#calculations
B=1/(2*dt);
#By using Bandwidth-distance product formula
Bl= B*l;
#results
print 'The bandwidth distance product is',Bl,'Hz-km'
# page no 899
# prob no 24.7
#calculate the directivity, power, excess loss
#given
from math import log10
# refer table from the problem page no 899
P_coupling1 =-3; P_coupling2 = -6; P_coupling3 =-40;# in dB
#calculations and results
#Part a) The proportion of input power emerging at port 2
P2_Pin=10**(P_coupling1/10);
print 'a) The proportion of input power emerging at port 2 is',P2_Pin*100,'%'
P3_Pin=10**(P_coupling2/10);
print 'b) The proportion of input power emerging at port 3 is',P3_Pin*100,'%'
# Part b) In the reverse direction,the signal is 40dB down for all combinations, so
directivity = 40;
print 'Directivity is',directivity,'dB'
Pin_total = P2_Pin + P3_Pin;
# excess loss in dB
loss=-10*log10(Pin_total);
print 'the excess loss is',round(loss,2),'dB'
# page no 901
# prob no 24.8
#calculate the energy of photon
#given
wl=1*10**-6;
c= 3*10**8;
h=6.626*10**-34
#calculations
f=c/wl;
E=h*f;# in Joule
#this energy can be converted into electron-volt. we know 1eV=1.6*10**-19 J
eV=1.6*10**-19 ;
E_ev=E/eV;
#results
print 'The energy of photon in eV is',E_ev,'eV'
# page no 909
# prob no 24_9
#calculate the diode current
#given
# refer fig 24.25
P_in=500;Responsivity=0.33;
#calculations
I_d = P_in * Responsivity;
#results
print 'The diode current is',I_d,'nA'