import math
from __future__ import division
#initialisation of variables
lambda1=850; #operating wavelength in nm
Beta2=-1; #dispersion regime ps^2/Km
Gama=2; #nonlinearity in /W-Km
TFWHM=10; #fundamental soliton width in ps
#CALCULATIONS
To=TFWHM/1.763; #pulse width in ps
Ppeak=1/(Gama*(To**2)); #peak power in W
#RESULTS
print"Peak power required to maintain fundamental soliton=",round(Ppeak*10**3,5),"mW"; #multiplication by 10^3 is to convert the unit from w to mW
import math
from __future__ import division
#initialisation of variables
lambda1=1.55; #operating wavelength in um
Beta2=-1; #dispersion regime ps^2/Km
B=10; #bitrate in Gb/s
two_qo=12; #separation between two neighbouring solitons in normalized units
#CALCULATIONS
LT=3.14*math.exp(two_qo/2)/(8*(two_qo/2)**2*abs(Beta2)*10**-24)/(B**2*(10**18)); #distance transmission limit in Km
#RESULTS
print"For 10Gb/s bit rate , transmission distance is limited to =",round(LT,5),"Km";
print"the answer is different because of rounding off ";
import math
from __future__ import division
#initialisation of variables
alpha=0.2; #fiber loss in dB/Km
LA=50; #Amplifier spacing in Km
#CALCULATIONS
G=(alpha*LA); #gain in fiber
PbyPo=G*math.log(G)/(G-1); #Multiple of power required by single soliton
#RESULTS
print"Multiple of power required by single soliton =",round(PbyPo,5);
print"the answer is slightly varing due to rounding error";
import math
from __future__ import division
#initialisation of variables
lambda1=1.55; #operating wavelength in um
LA=50; #Amplifier spacing in Km
qo=6; #Half of separation between two neighbouring solitons in normalized units
Beta2=-1; #dispersion regime ps^2/Km
#CALCULATIONS
B=1/(4*(qo)**2*abs(Beta2)); #bandwidth in THz
#RESULTS
print"Communication Link bitrate is limited to =",round(B*10**3,5),"GHz"; #Multiplication by 10^3 to convert unit fron THz to GHz
print"he answer is wrong";
import math
from __future__ import division
#initialisation of variables
LT=10000; #Transmission distance in Km
alpha=0.2; #fiber loss in dB/Km
lambda1=1.55*10**-6; #operating wavelength in m
Gama=2; #nonlinearity in /W-Km
LA=50; #Amplifier spacing in Km
D=1; #dispersion parameter ps/(Km-nm)
FG=3.518; #Fiber gain factor
fj=0.1; #timing jitter factor
h=6.62607004 * 10-34; #planck's constant in m2 kg / s
nsp=2; #spontaneous emission factor
qo=6; #Half of separation between two neighbouring solitons in normalized units
#CALCULATIONS
B1=((9*3.14*fj**2*LA)/(nsp*FG*qo*lambda1*h*Gama*D*10**-3)); #variable converting la
B2=B1**(1/3); #variable
B=B2/LT; #bandwidth in THz
#RESULTS
print"Communication Link bitrate is limited to =",round(B*10**3,5),"Gb/s"; #Multiplication by 10^3 to convert unit fron THz to GHz
print"the answer is wrong";