import math
#given
n2=1.35; #refractive index
n1=1.4; #refractive index
Wo=math.degrees(math.asin(n2/n1)); #in radians
print"Critical Angle,Wo =",round(Wo,4),"degree";
NA=sqrt(n1**2-n2**2);
print"Numerical Aperture,NA =",round(NA,4);
Wa=math.degrees(math.asin(NA)); #in radians
print"Angle of acceptance,Wa =",round(Wa,4),"degree";
import math
#given
Po=8; #in mW
Pi=50.; #in mW
l=15; #in km
TA=-10*math.log10(Po/Pi);
print"Total fibre Attenuation,L =",round(TA,4),"dB/",l,"km";
Alpha=TA/l;
print"Alpha is =",round(Alpha,4),"dB/km";
import math
#given
Po=10.; #in mW
Pi=150; #in mW
Alpha=0.8; #in dB/km
TA=-10*math.log10(Po/Pi);
print" Total fibre Attenuation,L =",round(TA,4),"dB";
l=TA/Alpha;
print" maximum length is,l =",round(l,4),"km";
#Round off Variations appear
import math
#given
B=92*10**-12; #in m**2/N
Tf=1550; #in K
n=1.46; #refractive index
p=0.29;
K=1.38*10**-23; #in J/K
l=1; #in km
L1=630; #in nm
L2=1330; #in nm
L3=1550; #in nm
print"Rayleight scattering coefficient";
Y1=8*math.pi**3*n**8*p**2*B*K*Tf/3/(L1*10**-9)**4;
Y2=8*math.pi**3*n**8*p**2*B*K*Tf/3/(L2*10**-9)**4;
Y3=8*math.pi**3*n**8*p**2*B*K*Tf/3/(L3*10**-9)**4;
print"for L1= 630nm, is","{0:.3e}".format(Y1);
print"for L2= 1330nm, is","{0:.3e}".format(Y2);
print"for L3= 1550nm, is","{0:.3e}".format(Y3);
#Misprinted answer
print"Rayleight scattering attenuation factor";
Fr1=math.e**-(Y1*l*10**3);
Fr2=math.e**-(Y2*l*10**3);
Fr3=math.e**-(Y3*l*10**3);
print"for Y1= 0.00179 is",round(Fr1,4);
print"for Y2= 0.00009 is",round(Fr2,4);
print"for Y3= 0.0000182 is",round(Fr3,4);
print"Rayleight scattering attenuation";
Ar1=10*math.log10(Fr1**-1);
Ar2=10*math.log10(Fr2**-1);
Ar3=10*math.log10(Fr3**-1);
print"for Ar1= 0.17 is",round(Ar1,4),"dB/km";
print"for Ar2= 0.91 is",round(Ar2,4),"dB/km";
print"for Ar3= 0.98 is",round(Ar3,4),"dB/km";
#For L3 answers in book are misprinted
import math
#given
L=850; #in nm
L1=0.850; #converted L in micrometer for using in given formula
A=0.5; #in dB/km
d=5; #in micrometer
Bw=1; #in Gz
Po=4.4*10**-3*A*Bw*L1**2*d**2;
print"Po(Th) =",round(Po,4),"W";
print"Therefore,Po(Th) =",round(Po*1000,4),"mW";
import math
#given
L=1330; #in nm
L1=1.330; #converted L in micrometer for using in given formula
A=0.5; #in dB/km
d=5; #in micrometer
Bw=1; #in Gz
Po=4.4*10**-3*A*Bw*L1**2*d**2;
print"Po(Th) =",round(Po,4),"W";
print"Therefore,Po(Th) =",round(Po*1000,4),"mW";
import math
#given
L=1550; #in nm
L1=1.550; #converted L in micrometer for using in given formula
A=0.5; #in dB/km
d=5; #in micrometer
Bw=1; #in Gz
Po=4.4*10**-3*A*Bw*L1**2*d**2;
print"Po(Th) =",round(Po,4),"W";
print"Therefore,Po(Th) =",round(Po*1000,4),"mW";
import math
#given
L=850; #in nm
L1=0.850; #converted L in micrometer for using in given formula
A=0.5; #in dB/km
d=8; #in micrometer
Bw=1; #in Gz
Po=4.4*10**-3*A*Bw*L1**2*d**2;
print"Po(Th) =",round(Po,4),"W";
print"Therefore,Po(Th) =",round(Po*1000,4),"mW";
import math
#given
L=850; #in nm
L1=0.850; #converted L in micrometer for using in given formula
A=0.5; #in dB/km
d=10; #in micrometer
Bw=1; #in Gz
Po=4.4*10**-3*A*Bw*L1**2*d**2;
print"Po(Th) =",round(Po,4),"W";
print"Therefore,Po(Th) =",round(Po*1000,4),"mW";
import math
#given
L=850.; #in nm
L1=L/1000; #converted L in micrometer for using in given formula
A=0.4; #in dB/km
d=5; #in micrometer
Po=5.9*10**-2*A*L1*d**2;
print"Po(Th) =",round(Po,4),"W";
print"Therefore,Po(Th) =",round(Po*1000,4),"mW";
import math
#given
L=1330.; #in nm
L1=L/1000; #converted L in micrometer for using in given formula
A=0.4; #in dB/km
d=5; #in micrometer
Po=5.9*10**-2*A*L1*d**2;
print"Po(Th) =",round(Po,4),"W";
print"Therefore,Po(Th) =",round(Po*1000,4),"mW"; #unit in book is wrong
import math
#given
L=1550.; #in nm
L1=L/1000; #converted L in micrometer for using in given formula
A=0.4; #in dB/km
d=5; #in micrometer
Po=5.9*10**-2*A*L1*d**2;
print"Po(Th) =",round(Po,4),"W";
print"Therefore,Po(Th) =",round(Po*1000,4),"mW"; #unit in book is wrong
import math
#given
R=25; #in nm
R1=25*10**-6; #in m
L=1000; #in nm
L1=10**-6; #in m
NA=0.2;
V=2*math.pi/L1*R1*NA;
print"Normalised frequency(V) =",round(V,4);
y=2.; #for parabolic
Mmax=y/(y+2)*(V**2)/2;
print"Maximum number of modes is equal to =",round(Mmax,4); #answer mistake in book
import math
#given
Tp=0.25; #in microsec
fB=0.529/Tp/10**-6; #channel bitrate
fBw=fB; #channel bandwidth = channel bitrate when zero ISI and RZ input data is modulated
print"Maximum operating bandwidth =",round(fBw*10**-6,4),"MHz";
L=50; #in km
D=Tp*10**-6/L; #Dispersion
print"Dispersion =",round(D*10**9,4),"ns/km";
fBwL=fBw*10**-6*L; #bandwidth length product
print"Bandwidth length product(fBw*L) =",round(fBwL,4),"MHz/km";
import math
#given
Tp=2; #in microsec
fB=0.529/Tp/10**-6; #channel bit rate
fBw=fB; #channel bandwidth = channel bitrate when zero ISI and RZ input data is modulated
print"Maximum operating bandwidth =",round(fBw*10**-6,4),"MHz";
L=50; #in km
D=Tp*10**-6/L; #Dispersion
print"Dispersion =",round(D*10**9,4),"ns/km"; #unit in book is wrong
fBwL=fBw*10**-6*L; #bandwidth length product
print"Bandwidth length product(fBw*L) =",round(fBwL,4),"MHz/km";
import math
#given
Tp=5; #in microsec
fB=0.529/Tp/10**-6; #channel bitrate
fBw=fB; #channel bandwidth = channel bitrate when zero ISI and RZ input data is modulated
print"Maximum operating bandwidth =",round(fBw*10**-6,4),"MHz";
L=50; #in km
D=Tp*10**-6/L; #Dispersion
print"Dispersion =",round(D*10**6,4),"micro s/km";
fBwL=fBw*10**-6*L; #bandwidth length product
print"Bandwidth length product(fBw*L) =",round(fBwL,4),"MHz/km";
import math
#given
Slw=25; #in nm
L=850; #in nm given
c=3*10**5; #in km/s
ofmd=0.02; #optical fiber material dispersion
Mdp=1./L/c*ofmd; #answer mismatch due to differnt value chosen for calculation
print"Material Dispersion parameter Mdp =",round(Mdp*10**12,4),"ps/nm.km";
l=1; #in km
dmd=Slw*l*Mdp; #pulse chirping
print"pulse chirping dmd =",round(dmd*10**9,4),"ns/km";
import math
#given
Slw=2; #in nm
L=850; #in nm given
c=3*10**5; #in km/s
ofmd=0.02; #optical fiber material dispersion
Mdp=1./L/c*ofmd; #answer mismatch due to differnt value chosen for calculation
print"Material Dispersion parameter Mdp =",round(Mdp*10**12,4),"ps/nm.km";
l=1; #in km
dmd=Slw*l*Mdp; #pulse chirping
print"pulse chirping dmd =",round(dmd*10**9,4),"ns/km";
import math
#given
fb1=2.5; #in Gb/s
D1=20; #in ps/nm.km
D2=5; #in ps/nm.km
fb2=D1/D2*fb1;
print" fb2 =",fb2,"Gb/s";
#Values of D1 and D2 are conflicted in question ,however solution is correct
import math
#given
fb1=2.5; #in Gb/s
DV1=100; #in GHz
DV2=50; #in GHz
fb2=DV1/DV2*fb1;
print" fb2 =",fb2,"Gb/s";
import math
#given
L=400; #in km
dAV=4; #in ps/km
dTL=L*dAV; #total chromatic dispersion
print"dTL =",round(dTL,4),"ps/nm.km";
import math
#given
no=1; #refractive index
n1=1.35; #refractive index
Po=((n1-no)/(n1+no))**2; #fresnal reflection
print" Po(refl)=",round(Po,4);
Lrefl=-10*math.log10(1-Po); #attenuation loss
print"L(refl)=",round(Lrefl,4),"dB";
import math
#given
no=1; #refractive index
n1=1.55; #refractive index
Po=((n1-no)/(n1+no))**2; #fresnal reflection
print"Fresnel reflective coefficient,Po(refl)=",round(Po,4);
Lrefl=-10*log10(1-Po); #attenuation loss
print"Attenuation based on Fresnel reflective coefficient,L(refl)=",round(Lrefl,4),"dB";
Ltot=5*Lrefl;
print"Total link attenuation on Fresnel reflections,Ltotal =",round(Ltot,4),"dB";
import math
#given
n1=1;
n2=1.5;
a=25.; #in micrometer
y=3.; #in micrometer
Csim=16*(n1/n2)**2/math.pi/(1+(n1/n2))**4*(2*math.acos(y/2/a)-(y/a)*(1-(y/2/a)**2)**0.5);
#lateral coupling coefficient
a=2*math.acos(y/2/a)-(y/a)*math.sqrt(1-(y/2./a)**2);
b=16*(n1/n2)**2/math.pi/(1+(n1/n2))**4;
print"Lateral coupling coefficient,Csim=",round(Csim,4);
Lsim=-10*math.log10(1-Csim);
print"Insertion Loss,Lsim=",round(Lsim,4),"dB";
#Answer wrong in book
import math
#given
Alpha=2.;
a=25.; #in micrometer
y=2.; #in micrometer
Cgim=2/math.pi*(y/a)*(Alpha+2)/(Alpha+1); #lateral coupling coefficient
print" Csim=",round(Cgim,4);
Lgim=-10*math.log10(1-Cgim); #insertion loss
print" Insertion Loss,Lgim=",round(Lgim,4),"dB";
import math
#given
n1=1.5; #refractive index
n2=1.5; #refractive index
W=2.5; #in degree
NA1=0.3;
NA2=0.4;
Csim1=16*(n1/n2)**2/(1+(n1/n2)**4)*(1-n2*W/(180*NA1)); #angular coupling coefficient
#Answer wrong in book
print"Csim=",round(Csim1,4);
Lsim1=-10*math.log10(Csim1);
print"Insertion Loss,Lsim=",round(Lsim1,4),"dB";
Csim2=16*(n1/n2)**2/(1+(n1/n2)**4)*(1-n2*W/(180*NA2)); #angular coupling coefficient
#Answer wrong in book
print"Csim=",round(Csim2,4);
Lsim2=-10*math.log10(Csim2);
print"Insertion Loss,Lsim=",round(Lsim2,4),"dB";
import math
#given
a=4; #in micrometer
V=2.4;
aw=1; #in degree
NA1=0.2;
n1=1.45; #refractive index
y=1; #in micrometer
omega=a*(0.65+1.62*V**-1.5+2.88*V**-6)/math.sqrt(2);
print"Normalised spot view (w)=",round(omega,4),"micrometer";
Lsml=2.17*(y/omega)**2;
print"Insertion loss due to lateral,Lsm=",round(Lsml,4),"dB"; #answer is wrong in book
Lsmg=2.17*(aw*math.pi/180*omega*n1*V/a/NA1)**2;
print"Insertion loss due to angular,Lsm=",round(Lsmg,4),"dB";
print"Total Insertion loss,Lsmtotal=",round(Lsml+Lsmg,4),"dB";
import math
#given
a1=4.5; #in micrometer
a2=4; #in micrometer
V=2.1;
aw=1; #in degree
NA=0.2;
n1=1.45;
y=1; #in micrometer
w1=a1*(0.65+1.62*V**-0.5+2.88*V**-6)/math.sqrt(2); #insertion loss
print"Wo1=",round(w1,4);
w2=a2*(0.65+1.62*V**-0.5+2.88*V**-6)/math.sqrt(2); #insertion loss
print"Wo2=",round(w2,4);
Lintr=-10*math.log10(4*((w1/w2+w2/w1)**-2)); #toatl insertion loss at joint
print"Lintr=",round(Lintr,4),"dB"; #Answer wrong in book