summaryrefslogtreecommitdiff
path: root/Engineering_Physics_by_Shyam_Rajeev/Chapter6.ipynb
blob: 8645ed7b7994028234c1f833f011effb49fb8283 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:9517150eeae7e7bf9389a01495b7c5d59b808d0c5432252a5c80e780ef687d70"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "6: Fiber Optics"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 6.1, Page number 160"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "n1 = 1.5;      #refractive index of core\n",
      "n2 = 1.0;      #refractive index of cladding\n",
      "\n",
      "#Calculation\n",
      "thetac = math.asin(n2/n1);      #critical angle(radian)\n",
      "thetac = thetac*180/math.pi;        #critical angle(degrees)\n",
      "thetac = math.ceil(thetac*10**2)/10**2;   #rounding off to 2 decimals\n",
      "\n",
      "#Result\n",
      "print \"critical angle is\",thetac,\"degrees\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "critical angle is 41.82 degrees\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 6.2, Page number 160"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "n1 = 1.5;         #refractive index of core\n",
      "n2 = 1.47;      #refractive index of cladding\n",
      "\n",
      "#Calculation\n",
      "thetac = math.asin(n2/n1);      #critical angle(radian)\n",
      "thetac = thetac*180/math.pi;        #critical angle(degrees)\n",
      "thetac = math.ceil(thetac*10**2)/10**2;   #rounding off to 2 decimals\n",
      "NA = math.sqrt(n1**2-n2**2);           #numerical aperture of fiber\n",
      "NA = math.ceil(NA*10)/10;   #rounding off to 1 decimal\n",
      "thetaa = math.asin(NA);        #acceptance angle(radian)\n",
      "thetaa = thetaa*180/math.pi;        #acceptance angle(degrees)\n",
      "thetaa = math.ceil(thetaa*10**2)/10**2;   #rounding off to 2 decimals\n",
      "\n",
      "#Result\n",
      "print \"critical angle is\",thetac,\"degrees\"\n",
      "print \"numerical aperture of fiber is\",NA\n",
      "print \"acceptance angle is\",thetaa,\"degrees\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "critical angle is 78.53 degrees\n",
        "numerical aperture of fiber is 0.3\n",
        "acceptance angle is 17.46 degrees\n"
       ]
      }
     ],
     "prompt_number": 8
    }
   ],
   "metadata": {}
  }
 ]
}