{
 "metadata": {
  "name": "",
  "signature": "sha256:4099ea94bbb3c9f1b17447df5b8a074a8f60585fc47e2a49454f49261cf5945d"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 4: Illumination"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.1, Page 105"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "F=1000;#intensity in lumens\n",
      "\n",
      "#Calculations\n",
      "MSCP=F/(4*math.pi);# MSCP of the lamps\n",
      "\n",
      "#Result\n",
      "print \"MSCP of the lamp is %.f\"%MSCP"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "MSCP of the lamp is 80\n"
       ]
      }
     ],
     "prompt_number": 32
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.2, Page 105"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "V=250;#in volts\n",
      "I=0.8;#in amperes\n",
      "F=3000;#intensity in lumens\n",
      "\n",
      "#Calculations\n",
      "wl=V*I;#wattage of lapms ins watts\n",
      "lpw=F/wl;# lumens per watts is\n",
      "MSCP=F/(4*math.pi);# MSCP of the lamps\n",
      "MW=MSCP/wl;#MSCP per watts\n",
      "\n",
      "#Results\n",
      "print \"lumens per watt is %.f\"%lpw\n",
      "print \"MSCP per watt of the lamp is %.1f\"%MW"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "lumens per watt is 15\n",
        "MSCP per watt of the lamp is 1.2\n"
       ]
      }
     ],
     "prompt_number": 33
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.3, Page 105"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "d=0.4;#diamter in meter\n",
      "p=0.20;#in percentage absorption\n",
      "F=4850;# lumens\n",
      "\n",
      "#Calculations\n",
      "Fe=(1-p)*F;# flux emitted by the globe in lumens\n",
      "sa=4*math.pi*(d/2)**2;#surface area in m^2\n",
      "als=Fe/sa;#average lumninance of sphere in lumens/m^2\n",
      "\n",
      "#Result\n",
      "print \"average lumninance of sphere in lumens/m^2 = %.f\"%als"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "average lumninance of sphere in lumens/m^2 = 7719\n"
       ]
      }
     ],
     "prompt_number": 34
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.4, Page 105"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "P=20;#filament power in watts\n",
      "h=5;#height in meters\n",
      "d=4;#diamter in meter\n",
      "p=0.50;#in percentage absorption\n",
      "ef=0.89;#efficiency in watts\n",
      "\n",
      "#Calculations\n",
      "cpl=P/ef;#candle power of lamp in CP\n",
      "Lop=4*math.pi*cpl;#lu,inous output in lumens\n",
      "Fe=(1-p)*Lop;# flux emitted by the globe in lumens\n",
      "sa=math.pi*(d/2)**2;#surface area in m^2\n",
      "als=Fe/sa;#average lumninance of sphere in lumens/m^2\n",
      "\n",
      "#Result\n",
      "print \"average lumninance of sphere in lumens/m^2 =%.3f\"%als"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "average lumninance of sphere in lumens/m^2 =11.236\n"
       ]
      }
     ],
     "prompt_number": 35
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.5, Page 106"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "cpl=100.;#\n",
      "h=5;#in meter\n",
      "th=60;#in degree\n",
      "F=1000;#intensity in lumens\n",
      "\n",
      "#Calculations\n",
      "MSCP=F/(4*math.pi);# MSCP of the lamps\n",
      "ai=((cpl/h**2)*math.cos((90-th)*math.pi/180));#average intensity of illumination\n",
      "\n",
      "#Results\n",
      "print \"MSCP of a lamp is= %.f\"%MSCP\n",
      "print \"average intensity of illumination is %.3f lux \"%ai"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "MSCP of a lamp is= 80\n",
        "average intensity of illumination is 3.464 lux \n"
       ]
      }
     ],
     "prompt_number": 43
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.7, Page 106"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "p=500;#lamp power in watts\n",
      "mscp=1250;#\n",
      "h=2.7;#in meters\n",
      "\n",
      "#Calculations\n",
      "ea=(mscp)/(h)**2;#illumination directly below lamp in lux\n",
      "le=(4*math.pi*mscp)/p;#lamp efficiency in lumens/watts\n",
      "h1=3;#meters\n",
      "eb=((mscp)/(h**2)*(2.7**3/(h1**2+h**2)**(3./2)));\n",
      "#illumnination at a point 3 meters away on the horizontal plane vertically below the lamp in lux\n",
      "\n",
      "#Results\n",
      "print \"illumination directly below lamp in lux = %.2f\"%ea\n",
      "print \"lamp efficiency in lumens/W = %.2f\"%le\n",
      "print \"illumnination at a point 3 meters away on the horizontal plane vertically below the lamp in lux = %.2f\"%eb"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "illumination directly below lamp in lux = 171.47\n",
        "lamp efficiency in lumens/W = 31.42\n",
        "illumnination at a point 3 meters away on the horizontal plane vertically below the lamp in lux = 51.33\n"
       ]
      }
     ],
     "prompt_number": 45
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.8, Page 107"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "l=100;#illumination at a point directly below the lamp in lumens/m^3\n",
      "cp=256.;#\n",
      "h1=1.2;#in meters\n",
      "\n",
      "#Calculations\n",
      "h=math.sqrt(cp/l);#height in meters\n",
      "x=math.sqrt(h**2+h1**2);#\n",
      "x1=h/x;#\n",
      "eb=((cp)/(h**2))*(x1)**3;#illumnination at a point 1.2 meters away on the horizontal plane vertically below the lamp in lux\n",
      "\n",
      "#Results\n",
      "print \"height in meters is =%.1f\"%h\n",
      "print \"illumnination at a point 1.2 meters away on the horizontal plane vertically below the lamp in lux =%.1f\"%eb"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "height in meters is =1.6\n",
        "illumnination at a point 1.2 meters away on the horizontal plane vertically below the lamp in lux =51.2\n"
       ]
      }
     ],
     "prompt_number": 47
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.9, Page 107"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "L1=500.;#candle power \n",
      "h1=9.;#in meters\n",
      "d=2;#distance in meters\n",
      "I2=20;#illumination in Lux\n",
      "\n",
      "#Calculations\n",
      "x=math.sqrt(h1**2+d**2);#from pythagoras theoram\n",
      "Cpx=((I2-(L1/h1**2))*h1**2)/((h1/x)**3);#candle power \n",
      "\n",
      "#Result\n",
      "print \"candle power of lamp two in CP =%.f\"%Cpx"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "candle power of lamp two in CP =1204\n"
       ]
      }
     ],
     "prompt_number": 49
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.10, Page 107"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "h1=10;#in meters\n",
      "eL=1;#ASSUME\n",
      "Ea=1./(10)**2;#\n",
      "\n",
      "#Calculations\n",
      "X=(((10**3)*eL)/10**2)*10*(1./Ea);\n",
      "x=(X)**(2./3);#\n",
      "y=math.sqrt(x-100);#\n",
      "\n",
      "#Result\n",
      "print \"distance in meters is %.1f\"%y"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "distance in meters is 19.1\n"
       ]
      }
     ],
     "prompt_number": 50
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.11, Page 108"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "th=15.;#in degree\n",
      "l=400;#candela\n",
      "d=8;# meter\n",
      "p=0.80;#in percentage absorption\n",
      "\n",
      "#Calculations\n",
      "Fe=p*4*math.pi*l;# flux emitted by the globe in lumens\n",
      "dA=d*math.tan((th/2)*math.pi/180);#diameter in degree\n",
      "sa=math.pi*(dA)**2;#surface area in m^2\n",
      "als=Fe/sa;#average lumninance of sphere in lux\n",
      "\n",
      "#Result\n",
      "print \"total flux in lumens = %.f\"%Fe\n",
      "print \"average lumninance of sphere is %.f lux\"%als"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "total flux in lumens = 4021\n",
        "average lumninance of sphere is 1154 lux\n"
       ]
      }
     ],
     "prompt_number": 54
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.12, Page 108"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "CP=1000.;#\n",
      "h=12;#in meter\n",
      "d=24;#diamter in meter\n",
      "\n",
      "#Calculations\n",
      "mil=CP/(h)**2;#maximum illumination in lux\n",
      "mal=mil*(12/math.sqrt(12**2+12**2))**3;#minimum illumination in lux\n",
      "\n",
      "#Results\n",
      "print \"maximum illumination is %.2f lux\"%mil\n",
      "print \"minimum illumination is %.2f lux\"%mal"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "maximum illumination is 6.94 lux\n",
        "minimum illumination is 2.46 lux\n"
       ]
      }
     ],
     "prompt_number": 56
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.13, Page 108"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "p=60.;#\n",
      "CP=200.;#\n",
      "h=6;#in meter\n",
      "d=10;#diamter in meter\n",
      "\n",
      "#Calculations&Results\n",
      "mil=CP/(h)**2;#maximum illumination in lux\n",
      "print \"part (a). \"\n",
      "print \"illumination at the centre of the area without reflector is %.2f lux\"%mil\n",
      "mal=mil*(h/math.sqrt(h**2+(d/2)**2))**3;#minimum illumination in lux\n",
      "tl=4*math.pi*CP;#total lumens \n",
      "ts=(p/100)*tl;#total lumens reaching the surface\n",
      "A=math.pi*(d/2)**2;#total surface area in m**2\n",
      "alf=ts/A;#average illumination with reflector\n",
      "x=math.sqrt(h**2+(d/2)**2);#\n",
      "y=h/x;#\n",
      "om=2*math.pi*(1-y);# in steradians\n",
      "tfr=CP*om;#total flux reaching the surface\n",
      "alwr=tfr/A;#average illumination without reflector\n",
      "print \"\\npart (b). \"\n",
      "print \"illumination at the edge of the area without reflector is %.2f lux\"%mal\n",
      "print \"average illumination with reflector is %.1f lux\"%alf\n",
      "print \"average illumination without reflelctor is %.1f lux\"%alwr\n",
      "#with the reflector the illumintaion at the edge and at the end will be the same since the reflection directs the \n",
      "#light uniformity on the surface"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "part (a). \n",
        "illumination at the centre of the area without reflector is 5.56 lux\n",
        "\n",
        "part (b). \n",
        "illumination at the edge of the area without reflector is 2.52 lux\n",
        "average illumination with reflector is 19.2 lux\n",
        "average illumination without reflelctor is 3.7 lux\n"
       ]
      }
     ],
     "prompt_number": 58
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.14, Page 109"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "CP=100.;#\n",
      "h=6.;#in meter\n",
      "d=16;# meter\n",
      "\n",
      "#Calculations\n",
      "x=math.sqrt(h**2+d**2);#\n",
      "em=2*((CP/h**2)*(h/(d-h))**3);#illumination in the middle in lux\n",
      "ee=((CP/h**2)*(1+(h/x)**3));#illumination iunder each lamp in lux\n",
      "\n",
      "#Results\n",
      "print \"illumination under each lamp is %.1f lux\"%ee\n",
      "print \"illumination in the middle is %.1f lux\"%em"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "illumination under each lamp is 2.9 lux\n",
        "illumination in the middle is 1.2 lux\n"
       ]
      }
     ],
     "prompt_number": 59
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.15, Page 109"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "CP=800;#\n",
      "h=10;#in meter\n",
      "d=12;# meter\n",
      "\n",
      "#Calculations\n",
      "x=math.sqrt(h**2+d**2);#\n",
      "x1=math.sqrt(h**2+(d/2)**2);#\n",
      "em=((CP/h**2)*(1+(h/x)**3+(h/x)**3));#illumination iunder each lamp in lux\n",
      "ee=2*((CP/h**2)*(h/x1)**3);#illumination at the centrelamp in lux\n",
      "\n",
      "#Results\n",
      "print \"illumination under each lamp is %.1f lux\"%em\n",
      "print \"illumination in the middle is %.3f lux\"%ee"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "illumination under each lamp is 12.2 lux\n",
        "illumination in the middle is 10.088 lux\n"
       ]
      }
     ],
     "prompt_number": 60
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.16, Page 110"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "CP=400;#\n",
      "h=10;#in meter\n",
      "d=20;# meter\n",
      "\n",
      "#Calculations\n",
      "x=math.sqrt(d**2-h**2);#\n",
      "ee=4*((CP/h**2)*(h/x)**3);#illumination at the centrelamp in lux\n",
      "\n",
      "#Result\n",
      "print \"illumination in the middle is %.2f lux\"%ee"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "illumination in the middle is 3.08 lux\n"
       ]
      }
     ],
     "prompt_number": 61
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.17, Page 111"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "cp=500.;#cp\n",
      "h=4.;#in meter\n",
      "\n",
      "#Calculations\n",
      "x=((2*cp*h**3)/h**2);#\n",
      "y=((cp*h**3)/h**2);#\n",
      "y1=cp/h**2;#\n",
      "y2=y/2;#\n",
      "y21=y1/2;#\n",
      "d=math.sqrt((((x-y2)/y21)**(2./3))-h**2)*2.29;#\n",
      "\n",
      "#Result\n",
      "print \"distance is,(m)= %.2f\"%d\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "distance is,(m)= 9.52\n"
       ]
      }
     ],
     "prompt_number": 62
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.18, Page 111"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "d=6;#in meter\n",
      "h=4;#in meter\n",
      "ef=20;#lumens per watt\n",
      "uc=0.5;#utilization coefficient\n",
      "il=750;# in lux\n",
      "\n",
      "#Calculations\n",
      "a=(math.pi/4)*(d)**2;#\n",
      "F=a*il;#in lumens \n",
      "tf=F/uc;#total flux emitted by the lamp\n",
      "watt=tf/ef;#wattage of lamp\n",
      "\n",
      "#Result\n",
      "print \"wattage of lamp is %.f watts\"%watt"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "wattage of lamp is 2121 watts\n"
       ]
      }
     ],
     "prompt_number": 63
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.19, Page 130"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "vl=220.;#voltage of lamp\n",
      "wl=60.;#wattage of lamp\n",
      "wl1=75.;#in watts\n",
      "v2=440.;# in volts\n",
      "\n",
      "#Calculations\n",
      "r1=((vl**2)/wl);# in ohms\n",
      "r2=((vl**2)/wl1);# in ohms\n",
      "i=(v2/(r1+r2));#in amperes\n",
      "v1=i*r1;# volts \n",
      "v12=i*r2;#in volts\n",
      "cp6=(math.ceil(v1)/vl)**4 *(100);#candle power \n",
      "cp7=(v12/vl)**4*(100);#candle power\n",
      "\n",
      "#Results\n",
      "print \"potential drop across 60 watt lamps is %.f volts\"%cp6\n",
      "print \"potential drop across 75 watt lamps is %.f volts\"%v12\n",
      "print \"candle power of 60 watts lampe in percentage = %.f\"%cp6\n",
      "print \"candle power of 75 watts lampe in percentage %.f\"%cp7\n",
      "#answer is wrong in the book"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "potential drop across 60 watt lamps is 154 volts\n",
        "potential drop across 75 watt lamps is 196 volts\n",
        "candle power of 60 watts lampe in percentage = 154\n",
        "candle power of 75 watts lampe in percentage 62\n"
       ]
      }
     ],
     "prompt_number": 66
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.20, Page 131"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "w=84;#watts\n",
      "pf=0.7;#power factor\n",
      "v=240;#in volts\n",
      "\n",
      "#Calculations\n",
      "i=(w)/(v*pf);# in amperes\n",
      "rva=v*i*math.sqrt(1-pf**2);#relative volt-amperes \n",
      "cpf=1;#corrected power factor\n",
      "rvas=v*i*math.sqrt(1-cpf**2);#\n",
      "f=50;# in hertz\n",
      "c=((rva)/(2*math.pi*f*(v)**2));#in farads\n",
      "\n",
      "#Result\n",
      "print \"capacitance in (micro-F) is %.2f\"%(c*10**6)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "capacitance in (micro-F) is 4.74\n"
       ]
      }
     ],
     "prompt_number": 67
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.21, Page 131"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "v1=110;#in volts\n",
      "cp1=16.;#in cp\n",
      "cp2=25;#in cp\n",
      "v2=220.;#in volts\n",
      "\n",
      "#Calculations\n",
      "ri=((cp1/cp2)*(v2/v1));#ratio of curents\n",
      "dr=(ri)**(2./3);#ratio of diameters\n",
      "di=(cp1/cp2)*(1./dr);#ratio of lengths\n",
      "\n",
      "#Results\n",
      "print \"ratio of diameter is %.2f\"%dr\n",
      "print \"ratio of length is %.3f\"%di"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "ratio of diameter is 1.18\n",
        "ratio of length is 0.543\n"
       ]
      }
     ],
     "prompt_number": 68
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.22, Page132"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "c1=71.5;#candel power\n",
      "v1=260.;#in volts\n",
      "c2=50.;#candel power\n",
      "v2=240;#in volts\n",
      "\n",
      "#Calculations&Results\n",
      "b=math.log(c1/c2)/(math.log(v1/v2));#\n",
      "a=c2/(v2)**(4.5);#\n",
      "print \"part (a). \"\n",
      "print \"constants are %.2e and %.1f\"%(a,b)\n",
      "v=250;# in volts\n",
      "p=4.;#change in percentage\n",
      "dvc=a*b*((v)**(b-1));#in candle per volts\n",
      "dc=(1+(p/100))**b;#when voltage increase by 4%\n",
      "pcp=((dc-1))*100;#percentage change in candle power\n",
      "dc1=(1-(p/100))**b;#when voltage falls by 4%\n",
      "pcp1=((dc1-1))*100;#percentage change in candle power\n",
      "print \"part (b).\"\n",
      "print \"change of candle power is %.2f per volts\"%dvc\n",
      "\n",
      "#chage in candle power per volt is calculated wrong in the book\n",
      "print \"percentage change in candle power  when voltage increase by 4%% is %.1f\"%pcp\n",
      "print \"percentage change in candle power  when voltage falls by 4%% is %.1f\"%pcp1"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "part (a). \n",
        "constants are 9.73e-10 and 4.5\n",
        "part (b).\n",
        "change of candle power is 0.90 per volts\n",
        "percentage change in candle power  when voltage increase by 4% is 19.2\n",
        "percentage change in candle power  when voltage falls by 4% is -16.7\n"
       ]
      }
     ],
     "prompt_number": 73
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.23, Page 139"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "dp=1.2;#depreciation factor\n",
      "uf=0.6;#utiliazation factor\n",
      "l=15;# in meters\n",
      "b=6;# in meters\n",
      "n=20;# no. of lamps\n",
      "lw=250;# mscp in watts\n",
      "\n",
      "#Calculations\n",
      "a=l*b;#arean in m^2\n",
      "tl=n*lw*4*math.pi;#/total lumens\n",
      "lwp=((tl*uf)/dp);#lumens reaching on the working plane\n",
      "e=lwp/a;#illumination on working plane in lux\n",
      "\n",
      "#Result\n",
      "print \"illumination on working plane is %.f lux\"%e"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "illumination on working plane is 349 lux\n"
       ]
      }
     ],
     "prompt_number": 74
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.24, Page 139"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "ef=40;#efficiency in lumens/watt\n",
      "mil=80;# minimum illumination in lumens/m^2\n",
      "dp=0.8;#depreciation factor\n",
      "uf=0.4;#utiliazation factor\n",
      "l=100;# in meters\n",
      "b=10;# in meters\n",
      "\n",
      "#Calculations\n",
      "a=l*b;#arean in m^2\n",
      "tl=a*mil;#/total lumens\n",
      "glr=tl/(uf*dp);#gross illumination required\n",
      "twr=glr/ef;#total wattage required\n",
      "\n",
      "#Results\n",
      "print \"number of lamps of 150watt rating in 2 rows are 42\" \n",
      "print \"total wattage is %.f watts\"%twr"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "number of lamps of 150watt rating in 2 rows are 42\n",
        "total wattage is 6250 watts\n"
       ]
      }
     ],
     "prompt_number": 75
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.25, Page 140"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "h=4;#in meters\n",
      "wp=75;#in lux\n",
      "ef=14;#efficiency in lumens/watt\n",
      "dp=0.2;#depreciation factor\n",
      "uf=0.5;#utiliazation factor\n",
      "l=72;# in meters\n",
      "b=15;# in meters\n",
      "\n",
      "#Calculations\n",
      "a=l*b;#arean in m^2\n",
      "mf=1-dp;#maintenance factor\n",
      "glr=(a*wp)/(uf*mf);#gross illumination required\n",
      "twr=glr/ef;#total wattage required\n",
      "wec=twr/80;#wattage of each lamps\n",
      "\n",
      "#Results\n",
      "print \"number of lamps of 150watt rating in 2 rows are 80\"\n",
      "print \" wattage of each lamp \",round(wec,1),\" watts equivalent to 200  watts\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "number of lamps of 150watt rating in 2 rows are 80\n",
        " wattage of each lamp  180.8  watts equivalent to 200  watts\n"
       ]
      }
     ],
     "prompt_number": 76
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.26, Page 140"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "a=30*30;#\n",
      "e=75;#\n",
      "uf=0.5;#\n",
      "df=1-0.2;#\n",
      "le=15;#efficiency\n",
      "\n",
      "#Calculations\n",
      "ph=(a*e)/(uf*df);#\n",
      "W=ph/le;#\n",
      "ew=300;#W\n",
      "N=W/ew;#\n",
      "\n",
      "#Results\n",
      "print \"total number of lamps is %.1f (say 42)\"%N\n",
      "print \"wattage of lamps is %.f W\"%W"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "total number of lamps is 37.5 (say 42)\n",
        "wattage of lamps is 11250 W\n"
       ]
      }
     ],
     "prompt_number": 77
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.27, Page 141"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "h=5;# in meters\n",
      "el=100;#in lux\n",
      "ef=16;#efficiency in lumens/watt\n",
      "dp=0.2;#depreciation factor\n",
      "uf=0.4;#utiliazation factor\n",
      "l=60;# in meters\n",
      "b=15;# in meters\n",
      "\n",
      "#Calculations\n",
      "a=l*b;#arean in m^2\n",
      "glr=(a*el)/(uf*(1-dp));#gross illumination required\n",
      "n=12*3;#total no. of \n",
      "twr=glr/ef;#total wattage required\n",
      "wec=twr/n;#wattage of each lamp\n",
      "\n",
      "#Results\n",
      "print \"number of lamps of 150watt rating in 2 rows are %.f\"%n\n",
      "print \"wattage of each lamp \",round(wec,1),\" watts equivalent to 500  watts\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "number of lamps of 150watt rating in 2 rows are 36\n",
        "wattage of each lamp  488.3  watts equivalent to 500  watts\n"
       ]
      }
     ],
     "prompt_number": 78
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.28, Page 141"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "h=5;# in meters\n",
      "el=120;#in lux\n",
      "ef=40;#efficiency in lumens/watt\n",
      "tw=80;#in watts\n",
      "df=1.4;#depreciation factor\n",
      "uf=0.5;#utiliazation factor\n",
      "l=30;# in meters\n",
      "b=15;# in meters\n",
      "\n",
      "#Calculations\n",
      "a=l*b;#arean in m^2\n",
      "glr=(a*el*df)/(uf);#gross lumens required\n",
      "twr=glr/ef;#total wattage required\n",
      "nt=twr/tw;#no. of tubes required\n",
      "\n",
      "#Results\n",
      "print \"total wattage required is %.f watts\"%twr\n",
      "print \" number of tubes required is \",nt,\"  equivalent to 48 tubes\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "total wattage required is 3780 watts\n",
        " number of tubes required is  47.25   equivalent to 48 tubes\n"
       ]
      }
     ],
     "prompt_number": 79
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.29, Page 142"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "el=50;#in lux\n",
      "df=1.3;#depreciation factor\n",
      "uf=0.5;#utiliazation factor\n",
      "l=30;# in meters\n",
      "b=12;# in meters\n",
      "\n",
      "#Calculations\n",
      "a=l*b;#arean in m^2\n",
      "glr=(a*el*df)/(uf);#gross lumens required\n",
      "watt=[100,200,300,500,1000];\n",
      "lum=[1615,3650,4700,9950,21500];#\n",
      "for i in range(0,5):\n",
      "    n=glr/(lum[i]);#\n",
      "    print \"if \",(watt[i]),\" watt lamps are used then number of lamps required is %.f\"%n\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "if  100  watt lamps are used then number of lamps required is 29\n",
        "if  200  watt lamps are used then number of lamps required is 13\n",
        "if  300  watt lamps are used then number of lamps required is 10\n",
        "if  500  watt lamps are used then number of lamps required is 5\n",
        "if  1000  watt lamps are used then number of lamps required is 2\n"
       ]
      }
     ],
     "prompt_number": 88
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.30, Page 146"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "ef=17.4;#in mumens/watt\n",
      "dp=1.2;#depreciation factor\n",
      "wlf=1.3;#waste light factor\n",
      "uf=0.4;#utiliazation factor\n",
      "l=50;# in meters\n",
      "b=16;# in meters\n",
      "n=16;# no. of lamps\n",
      "lw=1000;# mscp in watts\n",
      "\n",
      "#Calculations\n",
      "a=l*b;#arean in m^2\n",
      "tl=n*lw*ef;#/total lumens\n",
      "lwp=((tl*uf)/(wlf*dp));#lumens reaching on the working plane\n",
      "e=lwp/a;#illumination on the surface in lumens/m^2\n",
      "\n",
      "#Result\n",
      "print \"illumination on the surface is %.2f lumens/m^2\"%e"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "illumination on the surface is 89.23 lumens/m^2\n"
       ]
      }
     ],
     "prompt_number": 89
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.31, Page 146"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "watt=[300,500,1000,1500];\n",
      "lum=[5000,9000,18000,27000];#\n",
      "el=50;# in lux\n",
      "dp=0.8;#depreciation factor\n",
      "wlf=0.5;#waste light factor\n",
      "uf=1.2;#utiliazation factor\n",
      "l=60;# in meters\n",
      "b=15;# in meters\n",
      "lw=1000;# mscp in watts\n",
      "\n",
      "#Calculations\n",
      "a=l*b;#area in m^2\n",
      "tl=a*el#total lumens\n",
      "lwp=((tl*uf)/(wlf*dp));#lumens reaching on the working plane\n",
      "n = lwp/lum[1];#number of projector required\n",
      "ang=2*math.degrees(math.atan(4.5/8));#size\n",
      "\n",
      "#Results\n",
      "print \"number of projectors are,= %.f\"%(n+1)\n",
      "print \"wattage is,(W)= %.d\"%watt[1]\n",
      "print \"beam angle is %.f (degree)\"%(ang+1)\n",
      "print (round(n)+1), \" projectors of \",(watt[1]),\" watts each with beam angle of \",(round(ang+1)),\" degree will be required\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "number of projectors are,= 16\n",
        "wattage is,(W)= 500\n",
        "beam angle is 60 (degree)\n",
        "16.0  projectors of  500  watts each with beam angle of  60.0  degree will be required\n"
       ]
      }
     ],
     "prompt_number": 106
    }
   ],
   "metadata": {}
  }
 ]
}