summaryrefslogtreecommitdiff
path: root/Engineering_Physics_by_K._Rajagopal/Chapter_7.ipynb
blob: 95dcaf405620b5fe0c1a94cd810e8d9f14463f78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 7: Optical Fibre Communication"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.1, Page 206"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import sqrt\n",
      "\n",
      "#Variable declaration\n",
      "NA = 0.24;#Numerical Aperture\n",
      "delta = 0.014;\n",
      "\n",
      "#Calculations & Results\n",
      "n1 = (NA)/sqrt(2*delta);#Refractive index of first medium \n",
      "print 'Refractive index of first medium is ',round(n1,4)\n",
      "n2 = n1 - (delta*n1);#Refractive index of secong material\n",
      "print 'Refractive index of secong material is ',round(n2,4)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Refractive index of first medium is  1.4343\n",
        "Refractive index of secong material is  1.4142\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.2, Page 207"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import sqrt,asin,degrees\n",
      "\n",
      "#Variable declaration\n",
      "n1 = 1.49; # Refractive index of first medium\n",
      "n2 = 1.44; # Refractive index of second medium\n",
      "\n",
      "#Calculations & Results\n",
      "def deg_to_dms(deg):\n",
      "    d = int(deg)\n",
      "    md = abs(deg - d) * 60\n",
      "    m = int(md)\n",
      "    sd = (md - m) * 60\n",
      "    sd=round(sd,2)\n",
      "    return [d, m, sd]\n",
      "\n",
      "delta = (n1-n2)/n1; # Index difference\n",
      "NA = n1* sqrt(2*delta);\n",
      "print 'Numerical Aperture of fiber is',round(NA,3)\n",
      "theta = degrees(asin(NA));\n",
      "print 'Acceptance angle is ',deg_to_dms(theta),'degrees'\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Numerical Aperture of fiber is 0.386\n",
        "Acceptance angle is  [22, 42, 22.17] degrees\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.3, Page 207"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import sqrt,asin,degrees\n",
      "\n",
      "#Variable declaration\n",
      "NA = 0.15 ; # Numerical Aperture of fiber\n",
      "n2 = 1.55; # Refractive index of cladding\n",
      "n0w = 1.33; # Refractive index of water\n",
      "n0a = 1; # Refractive index of air\n",
      "\n",
      "#Calculations\n",
      "def deg_to_dms(deg):\n",
      "    d = int(deg)\n",
      "    md = abs(deg - d) * 60\n",
      "    m = int(md)\n",
      "    sd = (md - m) * 60\n",
      "    sd=round(sd,2)\n",
      "    return [d, m, sd]\n",
      "\n",
      "n1 = sqrt(NA**2 + n2**2);\n",
      "NAW = (sqrt(n1**2 -n2**2))/n0w;\n",
      "theta = degrees(asin(NAW));#Acceptance angle in water\n",
      "\n",
      "#Result\n",
      "print 'Acceptance angle in water is ',deg_to_dms(theta),'degrees'\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Acceptance angle in water is  [6, 28, 32.55] degrees\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.4, Page 216"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import log10\n",
      "\n",
      "#Variable declaration\n",
      "l = 16; # Length of optical fiber in Km\n",
      "Pi = 240e-6; # Mean optical length launched in optical fiber in Watts\n",
      "Po = 6e-6; # Mean optical power at the output in watts\n",
      "\n",
      "#Calculations&Results\n",
      "alpha = 10*log10(Pi/Po);#Signal attenuation in fiber\n",
      "print 'Signal attenuation in fiber',round(alpha),'dB'\n",
      "alpha1 = alpha/l;#Signal attenuation per km of the fiber\n",
      "print 'Signal attenuation per km of the fiber',round(alpha1),'dB/km'\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Signal attenuation in fiber 16.0 dB\n",
        "Signal attenuation per km of the fiber 1.0 dB/km\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.5, Page 219"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import pi,exp\n",
      "\n",
      "#Variable declaration\n",
      "Tf = 1400; # Fictive temperature of silicon in Kelvin\n",
      "betai = 7e-11; # Isothermal compressibility square meter per newton\n",
      "n = 1.46; # Refractive index of silicon\n",
      "p = 0.286; # Photoelastic constant of silicon\n",
      "lamda = 0.63e-6 # Wavelength in micrometer\n",
      "kb = 1.38e-23 # Boltzmann constant in joule per kelvin\n",
      "L = 1e3;\n",
      "\n",
      "#Calculations\n",
      "alphas = (8 * pi**3 * n**8 * p**2 * kb * Tf * betai)/(3 * lamda**4);#Rayleigh scattering coefficient\n",
      "alphars = exp(-alphas * L);#Loss factor\n",
      "\n",
      "#Results\n",
      "print 'Rayleigh scattering coefficient is ',round(alphas/1e-3,2),'*10^-3 /m'\n",
      "print 'Loss factor is',round(alphars,3)  #Answer varies due to rounding-off values\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Rayleigh scattering coefficient is  1.2 *10^-3 /m\n",
        "Loss factor is 0.302\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.6, Page 222"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "alpha = 0.5; # Attenuation of single mode optical fibre in dB per km\n",
      "lamda = 1.4; # Operating wavelength of optical fiber in micrometer\n",
      "d = 8 # Diameter of fiber in micrometer\n",
      "y = 0.6; # Laser source frequency width\n",
      "\n",
      "#Calculations\n",
      "pb = 4.4e-3 * d**2 * lamda**2 * alpha * y;#Threshold optical power in SBS\n",
      "prs = 5.9e-2 * d**2 * lamda * alpha;#Threshold optical power in SRS\n",
      "\n",
      "#Results\n",
      "print 'Threshold optical power in SBS',pb/1e-3,'mW'\n",
      "print 'Threshold optical power in SRS',prs,'W'\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Threshold optical power in SBS 165.5808 mW\n",
        "Threshold optical power in SRS 2.6432 W\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.7, Page 225"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import sqrt, pi\n",
      "\n",
      "#Variable declaration\n",
      "n1 = 1.50; # Refreactive index of forst medium\n",
      "delta = 0.003; # Index difference\n",
      "lamda = 1.6*1e-6; # Operating wavelength of fober in meter\n",
      "\n",
      "#Calculations&Results\n",
      "n2 = sqrt(n1**2-(2*delta*n1**2));#refractive index of cladding\n",
      "#Substituting n2^2 = n1^2 - 2*delta*n1^2 in euation of Rc,\n",
      "rc = (3*n1**2*lamda)/(4*pi*((2*delta*n1**2)**(3./2)));#The critical radius of curvature for which bending losses occur \n",
      "print 'The critical radius of curvature for which bending losses occur is ',round(rc/1e-6,2),'um'\n",
      "#Incorrect answer in the textbook\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The critical radius of curvature for which bending losses occur is  547.92 um\n"
       ]
      }
     ],
     "prompt_number": 7
    }
   ],
   "metadata": {}
  }
 ]
}