{
 "metadata": {
  "name": "",
  "signature": "sha256:b663d37f11172deb3563f162b70ebad3fa6ba55d33d2460355cbcd711fb7c2ba"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 7 Thin Lens, Coaxial Systems and Aberrations "
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.1 Page no 114"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#given\n",
      "f1=-12.0                                                        #Focal length of a converging lens in cm\n",
      "f2=25.0                                                         #Focal length of a diverging lens in cm\n",
      "d=8                                                           #Distance between the lens in cm\n",
      "\n",
      "#Calculations\n",
      "C=(1/f1)+(1/f2)+(d/(f1*f2))\n",
      "D=(d/f2)+1\n",
      "A=(d/f1)+1\n",
      "O1F1=(-D/C)\n",
      "O2F2=(A/C)\n",
      "O1H1=(1-D)/C\n",
      "O2H2=(A-1)/C\n",
      "\n",
      "#Output\n",
      "print\"Position of cardinal points are O1F1 = \",round(O1F1,3),\"cm, O2F2 = \",round(O2F2,3),\"cm, O1H1 = \",round(O1H1,3),\"cm, O2H2 = \",round(O2H2,3),\"cm\"\n",
      "print\"The system is in air, therfore, nodal points coincide with unit points\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Position of cardinal points are O1F1 =  18.857 cm, O2F2 =  -4.762 cm, O1H1 =  4.571 cm, O2H2 =  9.524 cm\n",
        "The system is in air, therfore, nodal points coincide with unit points\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.2 Page no 115"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#given\n",
      "f=15.0                                 #Focal length of achromatic doublet made up of crown and flint glasses in cm\n",
      "fl=(0.01506,0.02427)                 #Dispersive power of crown and flint glasses respectively \n",
      "\n",
      "#Calculations\n",
      "#Solving two equations\n",
      "#(1/f)=(1/f1)+(1/f2)\n",
      "#(f1/f2)=(-0.01506/0.02427)\n",
      "fx=(fl[0]/fl[1])\n",
      "f2=(-(1/fx)+1)/(1/f)\n",
      "f1=(-fx*f2)\n",
      "\n",
      "#Output\n",
      "print\"Focal length of converging lens is \",round(f2,1),\"cm\" \n",
      "print\"Focal length of diverging lens is \",round(f1,1),\"cm\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Focal length of converging lens is  -9.2 cm\n",
        "Focal length of diverging lens is  5.7 cm\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.3 Page no 115"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#given\n",
      "f=20.0                                                  #Focal length in cm\n",
      "fl=(0.015,0.019)                                        #Dispersive powers of crown and flint glasses respectively\n",
      "r=(1.495,1.53)                                          #Refractive indices respectively\n",
      "\n",
      "#Calculations\n",
      "fx=-(fl[0]/fl[1])\n",
      "#Solving two equations\n",
      "#(1/f)=(1/f1)+(1/f2)\n",
      "#(f1/f2)=(-0.015/0.019)\n",
      "f2=((1/fx)+1)/(1.0/f)\n",
      "f1=(fx*f2)\n",
      "r2=(r[1]-1)*f2\n",
      "r1=1/(((1/f1)/(r[0]-1))+(1/r2))\n",
      "\n",
      "#Output\n",
      "print\"Radius of curvature of converging lens is \",round(r2,1),\"cm\" \n",
      "print\"Radius of curvature of diverging lens is \",round(r1,1),\"cm\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Radius of curvature of converging lens is  -2.8 cm\n",
        "Radius of curvature of diverging lens is  7.9 cm\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.4 Page no 116"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#given\n",
      "r=1.5                                                       #Refractive index of the material of a thin lens\n",
      "f=-20.0                                                     #Focal length of the lens in cm\n",
      "rx=-6.0                                                     #Ratio of radii of curvature of lens\n",
      "\n",
      "#Calculations\n",
      "r1=1/((1/f)/((r-1)*(1-(1/rx))))\n",
      "r2=(rx*r1)\n",
      "\n",
      "#Output\n",
      "print\"Radii of curvature of lens are \",round(r1,2),\"cm and\",r2,\"cm\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Radii of curvature of lens are  -11.67 cm and 70.0 cm\n"
       ]
      }
     ],
     "prompt_number": 8
    }
   ],
   "metadata": {}
  }
 ]
}