summaryrefslogtreecommitdiff
path: root/Applied_Physics_by_P._K._Palanisamy/Chapter10_1.ipynb
blob: 4ad21f3bca5138ff9c837467004b2e6a68f2a492 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:04df0fd624434d43d67fac6cabd770a44e2109835e3a6832f168a8a4e92f27c9"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "10: Lasers"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 10.1, Page number 10.6"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "c = 3*10**8    #speed of light(m/sec)\n",
      "h = 6.6*10**-34    #planck's constant\n",
      "e = 1.6*10**-19\n",
      "T = 300    #temperature(K)\n",
      "K = 8.61*10**-5\n",
      "lamda = 6943    #wavelength, angstrom\n",
      "\n",
      "#Calculation\n",
      "lamda = lamda*10**-10     #wavelength(m)\n",
      "#let E2 - E1 be E\n",
      "E = h*c/lamda      #energy(J)\n",
      "E = E/e       #energy(eV)\n",
      "#let population ratio N2/N1 be N\n",
      "N = math.exp(-E/(K*T));\n",
      "\n",
      "#Result\n",
      "print \"relative population of 2 states is\",round(N/1e-30,3),\"*10^-30\"\n",
      "print \"answer given in the book is wrong\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "relative population of 2 states is 1.076 *10^-30\n",
        "answer given in the book is wrong\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 10.2, Page number 10.14"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "a2 = 6     #spot diameter(mm)\n",
      "a1 = 4     #spot diameter(mm)\n",
      "d2 = 2    #distance from laser(m)\n",
      "d1 = 1    #distance from laser(m)\n",
      "\n",
      "#Calculation\n",
      "a2 = a2*10**-3    #spot diameter(m)\n",
      "a1 = a1*10**-3     #spot diameter(m)\n",
      "theta = (a2-a1)/(2*(d2-d1))     #divergence(radian)\n",
      "theta = theta*10**3      #divergence(milli radian)\n",
      "\n",
      "#Result\n",
      "print \"divergence is\",theta,\"milli radian\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "divergence is 1.0 milli radian\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 10.3, Page number 10.46"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "n = 1     #for air\n",
      "lamda = 650     #wavelength(nm)\n",
      "bs = 1     #beam size(mm)\n",
      "fl = 1    #focal length of lens(mm)\n",
      "\n",
      "#Calculation\n",
      "lamda = lamda*10**-9    #wavelength(m)\n",
      "bs = bs*10**-3    #beam size(m)\n",
      "fl = fl*10**-3     #focal length of lens(m)\n",
      "tan_theta = fl/(2*bs)     #value of tan_theta\n",
      "theta = math.atan(tan_theta)\n",
      "NA = n*math.sin(theta)\n",
      "NA = math.ceil(NA*10**2)/10**2;   #rounding off to 2 decimals\n",
      "ss = 0.6*lamda/NA       #spot size(m)\n",
      "ss = ss*10**6;       #spot size(micro metre)\n",
      "ss = math.ceil(ss*10**3)/10**3;   #rounding off to 4 decimals\n",
      "\n",
      "#Result\n",
      "print \"spot size is\",ss,\"micro metre\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "spot size is 0.867 micro metre\n"
       ]
      }
     ],
     "prompt_number": 6
    }
   ],
   "metadata": {}
  }
 ]
}