summaryrefslogtreecommitdiff
path: root/Engineering_Physics/Chapter2_1.ipynb
blob: fff10b22bae4308e94d0f8ccbd6bf383298617ef (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
{
 "metadata": {
  "name": "Chapter2",
  "signature": "sha256:ac80f9dfe1725f11a5d4ce0fbda5ffed825d99c680f116629e5e3fcb8b69c198"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": "2: Lasers"
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example number 2.1, Page number 52"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "#importing modules\nimport math\n\n#Variable declaration\nlamda = 590;        #wavelength(nm)\nh = 6.625*10**-34;       #planck's constant\nc = 3*10**8;            #velocity of light(m/s)\nk = 1.38*10**-23;       #boltzmann's constant\nT = 523;                #temperature(Kelvin)\n\n#Calculation\nlamda = lamda*10**-9;      #wavelength(m)      \n#n1byn2 = math.exp(-(E2-E1)/(k*T))\n#but E2-E1 = h*new and new = c/lamda\n#therefore n1byn2 = math.exp(-h*c/(lamda*k*T))\nn1byn2 = math.exp(-h*c/(lamda*k*T));\n\n#Result\nprint \"relative population of Na atoms is\",n1byn2",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "relative population of Na atoms is 5.36748316686e-21\n"
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example number 2.2, Page number 53"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "#importing modules\nimport math\n\n#Variable declaration\nlamda = 590;        #wavelength(nm)\nh = 6.625*10**-34;       #planck's constant\nc = 3*10**8;            #velocity of light(m/s)\nk = 1.38*10**-23;       #boltzmann's constant\nT = 523;                #temperature(Kelvin)\n\n#Calculation\nlamda = lamda*10**-9;      #wavelength(m)      \n#n21dashbyn21 = 1/(math.exp(h*new/(k*T))-1)\n#but new = c/lamda\n#therefore n21dashbyn21 = 1/(math.exp(h*c/(lamda*k*T))-1)\nA = math.exp(h*c/(lamda*k*T))-1;\nn21dashbyn21 = 1/A;    \n\n#Result\nprint \"ratio of stimulated to spontaneous emission is\",n21dashbyn21\nprint \"answer given in the book is wrong\"",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "ratio of stimulated to spontaneous emission is 5.36748316686e-21\nanswer given in the book is wrong\n"
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example number 2.3, Page number 53"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "#importing modules\nimport math\n\n#Variable declaration\nlamda = 632.8;        #wavelength of laser(nm)\nh = 6.625*10**-34;       #planck's constant\nc = 3*10**8;            #velocity of light(m/s)\np = 3.147;              #output power(mW)\n\n#Calculation\np = p*10**-3;          #output power(W)\nlamda = lamda*10**-9;      #wavelength(m)      \nnew = c/lamda;             #frequency(Hz)\nE = h*new;                 #energy of each photon(J)\nEm = p*60;                 #energy emitted per minute(J/min)\nN = Em/E;                  #number of photons emitted per second\n\n#Result\nprint \"number of photons emitted per second is\",N",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "number of photons emitted per second is 6.01183879245e+17\n"
      }
     ],
     "prompt_number": 3
    }
   ],
   "metadata": {}
  }
 ]
}