{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 5 - Polarisation"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4 - pg 134"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Angle (degrees) =  36.9\n"
     ]
    }
   ],
   "source": [
    "#pg 134\n",
    "#calculate the angle required\n",
    "#Given:\n",
    "import math\n",
    "mu = 1.33; #Refractive index of water\n",
    "#Brewster's angle, theta_p = atand(mu) ;\n",
    "#calculations\n",
    "theta_p = math.atan(mu)*57.3; # in degrees\n",
    "theta_s = 90-theta_p ; # in degrees\n",
    "#results\n",
    "print \"Angle (degrees) = \",round(theta_s,1)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 5 - pg 136"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Critical angle (degrees) =  69.0\n"
     ]
    }
   ],
   "source": [
    "#pg 136\n",
    "#calculate the Critical angle\n",
    "import math\n",
    "#Given:\n",
    "r = 90.; # in degrees\n",
    "mu_o= 1.658 ;# Refractive index for ordinary array\n",
    "mu =1.55; # Refractive index for a canada balsam material\n",
    "#calculations\n",
    "#Snell's Law,mu1*sin(i) = mu2*sin(r), we have :\n",
    "i = math.asin((mu*math.sin(r/57.3))/mu_o)*57.3; # angle in degrees\n",
    "#results\n",
    "print \"Critical angle (degrees) = \",round(i,0)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 6 - pg 147"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Minimum thickness :\n",
      "(a)Plane polarised light : 3.27  x 10**-3 cm \n",
      "(b)Circularly polarised light : 1.64 x 10**-3 cm \n"
     ]
    }
   ],
   "source": [
    "#pg 147\n",
    "#calculate the Minimum thickness of Plane and Circularly polarised light\n",
    "#Given :\n",
    "mu_o = 1.544; #Refractive index for ordinary ray\n",
    "mu_e = 1.553;#Refractive index for extraordinary ray\n",
    "lambd = 5890.;#Wavelength in A\n",
    "#calculations\n",
    "#(a)Plane polarised light :\n",
    "#lambd is converted from A to cm , 1 A = 1.0*10**-8 cm\n",
    "t1 = (lambd*10**-8)/(2*(mu_e-mu_o));#Minimum thickness in cm\n",
    "#(b)Circularly polarised light :\n",
    "t2 = (lambd*10**-8)/(4*(mu_e-mu_o));# Minimum thickness in cm\n",
    "#results\n",
    "print\"Minimum thickness :\"\n",
    "print\"(a)Plane polarised light :\",round(t1*1000.,2),\" x 10**-3 cm \"\n",
    "print\"(b)Circularly polarised light :\",round(t2*1000.,2),\"x 10**-3 cm \""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 7 - pg 150"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(a)Calcite crystal : \n",
      "  Phase difference is (radians) =  9.541\n",
      "(a)Quartz crystal : \n",
      "  Phase difference is (radians) =  2.247\n"
     ]
    }
   ],
   "source": [
    "#pg 150\n",
    "#calculate the phase difference\n",
    "#Given :\n",
    "import math\n",
    "lambd = 5890.; #Wavelength in A\n",
    "#(a)Calcite crystal\n",
    "mu1_o = 1.658;#refractive index for ordinary ray\n",
    "mu1_e = 1.486;#refractive index for extraordinary ray\n",
    "t1 = 0.0052 ; #thickness in mm\n",
    "# 1 A = 1.0*10**-7 mm\n",
    "alpha1 = ((2*math.pi*(mu1_o-mu1_e)*t1)/(lambd*10**-7)); # phase difference in radians\n",
    "#(b) Quartz crystal\n",
    "mu2_o = 1.544; #refractive index for ordinary ray\n",
    "mu2_e = 1.553; #refractive index for extraordinary ray\n",
    "t2 = 0.0234;#thickness in mm\n",
    "alpha2 = ((2*math.pi*(mu2_e-mu2_o)*t2)/(lambd*10**-7)); # phase difference in radians\n",
    "print\"(a)Calcite crystal : \\n  Phase difference is (radians) = \",round(alpha1,3)\n",
    "print\"(a)Quartz crystal : \\n  Phase difference is (radians) = \",round(alpha2,3)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 9 - pg 159"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Change in theta (degrees) =  0.132\n",
      "The concentration of 1 mg/cm^3 will be detected by the given urinalysis tube.\n"
     ]
    }
   ],
   "source": [
    "#pg 159\n",
    "#calculate the concentration and Change in angle\n",
    "#Given :\n",
    "rho = 6.6; # Specific rotation of sugar in degrees g^-1 cm^2\n",
    "l = 20; #length in cm\n",
    "deltad = 1*10**-3;#difference in sugar concentration in g/cm^3\n",
    "lc = 0.1; # least count in degrees\n",
    "#Rotation due to optical activity  = rho*l*d\n",
    "#calculations\n",
    "deltatheta = rho*l*deltad; # in degrees\n",
    "#results\n",
    "print\"Change in theta (degrees) = \",deltatheta\n",
    "\n",
    "if(deltatheta > lc):\n",
    "    print\"The concentration of 1 mg/cm^3 will be detected by the given urinalysis tube.\"\n",
    "else:\n",
    "    print\"The concentration of 1 mg/cm^3 will not be detected.\"     "
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
