{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 11:Lasers"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.1, Page number 11.6"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "lamda = 6943.*10**-10  #wavelength(m)\n",
      "T = 300.               #temperature(K)\n",
      "h = 6.626*10**-34      #Planck's constant\n",
      "c = 3*10**8            #velocity of light(m/s)\n",
      "K = 8.61*10**-5\n",
      "\n",
      "#Calculations\n",
      "E2_E1 = (h*c)/(lamda*1.6*10**-19) #in eV\n",
      "N2_N1 = math.exp(-E2_E1/(K*T))\n",
      "\n",
      "#Result\n",
      "print \"The relative population of two states in a ruby laser is\",round((N2_N1/1E-31),2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The relative population of two states in a ruby laser is 8.2\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.2, Page number 11.14"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Variable declaration\n",
      "a1 = 4.   #diameter of laser beam for distance first(m)\n",
      "a2 = 6.   # diameter of laser beam from second distance(m)\n",
      "d1 = 1.   #First distance from laser to output beam spot(m)\n",
      "d2 = 2.   #Second distance from laser to output beam spot(m)\n",
      "\n",
      "#Calculation\n",
      "D = (a2-a1)/(2*(d2-d1))\n",
      "\n",
      "#Result\n",
      "print \"Divergence =\",D,\"milliradian\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Divergence = 1.0 milliradian\n"
       ]
      }
     ],
     "prompt_number": 14
    }
   ],
   "metadata": {}
  }
 ]
}