import math
#given
Pin=1; #microW
W=15; #in degree
NA=math.sin(W*math.pi/180);
NAA=0.26; #NA=0.2588190 which is rounded off
C_c=(NAA)**2;
print"Coupling coefficient is ",C_c;
Pf=C_c*Pin;
print"Power coupled into fiber ",Pf*1000,"nW\n";
import math
#given
n=0.02; #in percentage
W=20; #in degree
Vf=1.5; #in Volts
If=20; #in mAmps
Pin=If*Vf;
print"Power coupled into fiber ,Pin = ",Pin,"mW";
Po=n*Pin;
print"Output Power of the optical source is ",Po,"mW";
#from nc=20 degree
C_c=(math.sin(W*math.pi/180))**2;
Pf=C_c*Po
print"Optical power coupled into fibre is ,Pf = ",round(Pf*1000,4),"microW";
import math
#given
tr=10; #in nsec
BW=0.35/tr/10**-9;
print" Maximum operating bandwidth is ",BW/10**6,"MHz\n"; #divided by 10**6 to convert answer in MHz
import math
#given
T=1; #Air
NA=0.3;
n0=1;
#x=y;
print"for step index :A=infinite";
#for infinite alpha
#nc=T*(NA/n0)^2*(x/y)^2*(A/(A+2))
nc=T*(NA/n0)**2*(1)**2*1; # A/(A+2)=1 for A=infinite
print"Coupling Coefficient,nc = ",nc*100,"percent";
print"for graded index :A=2";
A=2;
#n_c=(T*(NA/n0)^2*(A+(1-(y/x)^2))/(A+2))
n_c=(T*(NA/n0)**2*(A+(1-(1)**2))/(A+2)) #x/y=1
print"Coupling Coefficient,nc = ",n_c*100,"percent";
import math
#given
T=1; #Air
NA=0.3;
n0=1;
A=2;
#y=0.75x;
print"for step index :";
#for infinite alpha
#nc=T*(NA/n0)^2*(x/y)^2*(A/(A+2))
nc=T*(NA/n0)**2*(1/0.75)**2*A/(A+2); #y/x=0.75
print"Coupling Coefficient,nc = ",nc*100,"percent";
print"for graded index :A=2";
A=2;
#n_c=(T*(NA/n0)^2*(A+(1-(y/x)^2))/(A+2))
n_c=(T*(NA/n0)**2*(A+(1-(0.75)**2))/(A+2)) #y/x=0.75
print"Coupling Coefficient,nc = ",round(n_c*100,4),"percent";
import math
#given
#calculate Tf
If=85; #in mAmps
Vf=2.5; #in Volts
Ta=25; #in deg C
#calculate Tj
W=150; #in C/W for hermetric led
Pd=If*Vf;
Tj=Ta+W*Pd/1000;
print"Value of Tj is ",Tj,"deg C";
TF=8.01*10**12*math.e**-(8111/(Tj+273));
print"Value of TF is ",round(TF,4),"deg C";
#calculate RF
BF=6.5*10**-4; #from table
QF=0.5; #from table
EF=1; #from table
RF=BF*TF*EF*QF*1/10**6;
print"Value of RF","{0:.3e}".format(RF);
print"Value of MTBF is ","{0:.3e}".format(1/RF),"hours";
#Answer in book is misprint in last line
import math
#given
#calculate Tf
If=120; #in mAmps
Vf=1.8; #in Volts
Ta=80; #in deg C
#calculate Tj
W=150; #in C/W for hermetric led
Pd=0.5*If*Vf;
Tj=75+W*Pd/1000;
print"Value of Tj is ",Tj,"degree cel";
TF=8.01*10**12 *math.e**-(8111/(Tj+273));
print"Value of TF is ",round(TF,4);
#calculate RF
BF=6.5*10**-4; #from table
QF=0.2; #from table
EF=0.75; #from table
RF=BF*TF*EF*QF*1/10**6;
print"Value of RF is ","{0:.3e}".format(RF);
print"Value of MTBF is ","{0:.3e}".format(1/RF),"hours";