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
|
{
"metadata": {
"name": "Chapter 2"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": "Laser"
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example number 2.1, Page number 59 "
},
{
"cell_type": "code",
"collapsed": false,
"input": "#To calculate the number of photons emitted by laser\n\n#importing modules\nimport math\n\n#Variable declaration\nh=6.626*10**-34;\nc=3*10**8;\nlamda=632.8*10**-9; #wavelength in m\nP=5*10**-3; #output power in W\n\n#Calculation\nE=(h*c)/lamda; #energy of one photon\nE_eV=E/(1.6*10**-19); #converting J to eV\nE_eV=math.ceil(E_eV*1000)/1000; #rounding off to 3 decimals\nN=P/E; #number of photons emitted\n\n\n#Result\nprint(\"energy of one photon in eV is\",E_eV);\nprint(\"number of photons emitted per second is\",N);\n",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "('energy of one photon in eV is', 1.964)\n('number of photons emitted per second is', 1.5917094275077976e+16)\n"
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example number 2.2, Page number 60"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#To calculate the energy of emitted photons\n\n#importing modules\nimport math\n\n#Variable declaration\nh=6.626*10**-34;\nc=3*10**8;\nlamda=632.8*10**-9; #wavelength in m\n\n#Calculation\nE=(h*c)/lamda; #energy of one photon\nE_eV=E/(1.6*10**-19); #converting J to eV\nE_eV=math.ceil(E_eV*1000)/1000; #rounding off to 3 decimals\n\n#Result\nprint(\"energy of one photon in eV is\",E_eV);\n",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "('energy of one photon in eV is', 1.964)\n"
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example number 2.3, Page number 60"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#To calculate the value of E3\n\n#importing modules\nimport math\n\n#Variable declaration\nE1=0; #value of 1st energy level in eV\nE2=1.4; #value of 2nd energy level in eV\nlamda=1.15*10**-6;\nh=6.626*10**-34;\nc=3*10**8;\n\n#Calculation\nE=(h*c)/lamda; #energy of one photon\nE_eV=E/(1.6*10**-19); #converting J to eV\nE3=E2+E_eV;\nE3=math.ceil(E3*100)/100; #rounding off to 2 decimals\n\n#Result\nprint(\"value of E3 in eV is\",E3);\n\n#answer given in the book for E3 is wrong",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "('value of E3 in eV is', 2.49)\n"
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example number 2.4, Page number 60"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#To calculate the wavelength of laser beam\n\n#Variable declaration\nh=6.626*10**-34;\nc=3*10**8;\nE2=3.2; #value of higher energy level in eV\nE1=1.6; #value of lower energy level in eV\n\n#Calculation\nE=E2-E1; #energy difference in eV\nE_J=E*1.6*10**-19; #converting E from eV to J\nlamda=(h*c)/E_J; #wavelength of photon\n\n#Result\nprint(\"energy difference in eV\",E);\nprint(\"wavelength of photon in m\",lamda);\n",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "('energy difference in eV', 1.6)\n('wavelength of photon in m', 7.76484375e-07)\n"
}
],
"prompt_number": 6
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example number 2.5, Page number 60"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#To calculate the wavelength of laser beam\n\n#Variable declaration\nh=6.626*10**-34;\nc=3*10**8;\nE=1.42*1.6*10**-19; #band gap of GaAs in J\n\n#Calculation\nlamda=(h*c)/E; #wavelength of laser\n\n#Result\nprint(\"wavelength of laser emitted by GaAs in m\",lamda);\n",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "('wavelength of laser emitted by GaAs in m', 8.74911971830986e-07)\n"
}
],
"prompt_number": 8
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example number 2.6, Page number 61"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#To calculate the relative population of energy levels\n\n#importing modules\nimport math\n\n#Variable declaration\nT=300; #temperature in K\nlamda=500*10**-9; #wavelength in m\nh=6.626*10**-34;\nc=3*10**8;\nk=1.38*10**-23;\n\n#Calculation\n#from maxwell and boltzmann law, relative population is given by\n#N1/N2=exp(-E1/kT)/exp(-E2/kT)\n#hence N1/N2=exp(-(E1-E2)/kT)=exp((h*new)/(k*T));\n#new=c/lambda\nR=(h*c)/(lamda*k*T);\nRP=math.exp(R);\n\n#Result\nprint(\"relative population between N1 and N2 is\",RP);\n",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "('relative population between N1 and N2 is', 5.068255595981255e+41)\n"
}
],
"prompt_number": 9
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example number 2.7, Page number 61"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#To examine the possibility of stimulated emission\n\n#importing modules\nimport math\n\n#Variable declaration\nT=300; #temperature in K\nh=6.626*10**-34;\nc=3*10**8;\nk=1.38*10**-23;\nlamda=600*10**-9; #wavelength in m\n\n#Calculation\nR=(h*c)/(lamda*k*T);\nRs=1/(math.exp(R)-1);\n\n#Result\nprint(\"the ratio between stimulated emission to spontaneous emission is\",Rs);\n",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "('the ratio between stimulated emission to spontaneous emission is', 1.7617782449453023e-35)\n"
}
],
"prompt_number": 11
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example number 2.8, Page number 62"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#To calculate the efficiency of a He-Ne laser\n\n#importing modules\nimport math\n\n#Variable declaration\nP=5*10**-3; #output power in W\nI=10*10**-3; #current in A\nV=3*10**3; #voltage in V\n\n#Calculation\ne=(P*100)/(I*V);\ne=math.ceil(e*10**6)/10**6; #rounding off to 6 decimals\n\n#Result\nprint(\"efficiency of laser in % is\",e);\n",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "('efficiency of laser in % is', 0.016667)\n"
}
],
"prompt_number": 14
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example number 2.9, Page number 62"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#To calculate the intensity of laser beam\n\n#importing modules\nimport math\n\n#Variable declaration\nP=1e-03; #output power in W\nd=1e-06; #diameter in m\n\n#Calculation\nr=d/2; #radius in m\nI=P/(math.pi*r**2); #intensity\nI=I/10**9;\nI=math.ceil(I*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint(\"intensity of laser in W/m^2 is\",I,\"*10**9\");",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "('intensity of laser in W/m^2 is', 1.2733, '*10**9')\n"
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example number 2.10, Page number 62"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#To calculate the angular speed and divergence of laser beam\n\n#importing modules\nimport math\n\n#Variable declaration\nlamda=632.8*10**-9; #wavelength in m\nD=5; #distance in m\nd=1*10**-3; #diameter in m\n\n#Calculation\ndeltatheta=lamda/d; #angular speed\ndelta_theta=deltatheta*10**4;\nr=D*deltatheta;\nr1=r*10**3; #converting r from m to mm\nA=math.pi*r**2; #area of the spread\n\n#Result \nprint(\"angular speed in radian is\",delta_theta,\"*10**-4\");\nprint(\"radius of the spread in mm is\",r1);\nprint(\"area of the spread in m^2 is\",A);\n",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "('angular speed in radian is', 6.328, '*10**-4')\n('radius of the spread in mm is', 3.164)\n('area of the spread in m^2 is', 3.1450157329451454e-05)\n"
}
],
"prompt_number": 2
},
{
"cell_type": "code",
"collapsed": false,
"input": "",
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}
|