{
 "metadata": {
  "name": "",
  "signature": "sha256:54c30c216e131996bdae1a02fbe32e2e6e143be1feb0a02491a5808c29f1c930"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter2-Solar Radiation and its Measurement"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.4.1-pg 59"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Ex2.4.1.;Detremine local solar time and declination\n",
      "import math\n",
      "##The local solar time=IST-4(standard time longitude-longitude of location)+Equation of time correstion\n",
      "##IST=12h 30min;for the purpose of calculation we are writing it as a=12h,b=29 min 60sec;\n",
      "a=12.;\n",
      "b=29.60;\n",
      "##(standard time longitude-longitude of location)=82 degree 30min - 77 degree 30min;\n",
      "##for the purpose of calculation we are writing it as\n",
      "STL3=82.5-72.5;\n",
      "##Equation of time correstion: 1 min 01 sec\n",
      "##for the purpose of calculation we are writing it as\n",
      "c=1.01;\n",
      "##The local solar time=IST-4(standard time longitude-longitude of location)+Equation of time correstion\n",
      "LST=b-STL3-c;\n",
      "print'%s %.2f %s %.2f %s'%(\" The local solar time=\",a,\"\"and \"\",LST,\" in hr.min.sec\");\n",
      "##Declination delta can be obtain by cooper's eqn : delta=23.45*sin((360/365)*(284+n))\n",
      "n=170.;##(on June 19)\n",
      "##let\n",
      "a=(360./365.)*(284.+n)\n",
      "aa=(a*math.pi)/180.\n",
      "##therefore\n",
      "delta=23.45*math.sin(aa);\n",
      "print'%s %.2f %s'%(\"\\n delta=\",delta,\" degree\");\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The local solar time= 12.00  18.59  in hr.min.sec\n",
        "\n",
        " delta= 23.43  degree\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.4.2-pg 59"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##Ex2.4.2.;Calculate anglr made by beam radiation with the normal to a flat collector.\n",
      "gama=0.;##since collector is pointing due south.\n",
      "##For this case we have equation : cos_(theta_t)=cos(fie-s)*cos(delta)*cos(w)+sin(fie-s)*sin(delta)\n",
      "##with the help of cooper eqn on december 1,\n",
      "n=335.;\n",
      "##let\n",
      "a=(360./365.)*(284.+n);\n",
      "aa=(a*math.pi)/180;\n",
      "##therefore\n",
      "delta=23.45*math.sin(aa);\n",
      "print'%s %.2f %s'%(\" delta=\",delta,\" degree\");\n",
      "##Hour angle w corresponding to 9.00 hour=45 Degreew\n",
      "w=45.;##degree\n",
      "##let\n",
      "a=math.cos(((28.58*math.pi)/180.)-((38.58*math.pi)/180.))*math.cos(delta*math.pi*180**-1)*math.cos(w*math.pi*180**-1);\n",
      "b=math.sin(delta*math.pi*180**-1)*math.sin(((28.58*math.pi)/180.)-((38.58*math.pi)/180.));\n",
      "##therefore\n",
      "cos_of_theta_t=a+b;\n",
      "theta_t=math.acos(cos_of_theta_t)*57.3;\n",
      "print'%s %.2f %s'%(\"\\n theta_t=\",theta_t,\" Degree\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " delta= -22.11  degree\n",
        "\n",
        " theta_t= 44.73  Degree\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.7.1-pg 68"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Ex2.7.1.;Determine the average values of radiation on a horizontal surface\n",
      "import math\n",
      "##Declination delta for June 22=23.5 degree, sunrice hour angle ws\n",
      "delta=(23.5*math.pi)/180;##unit=radians\n",
      "fie=(10*math.pi)/180;##unit=radians\n",
      "##Sunrice hour angle ws=acosd(-tan(fie)*tan(delta))\n",
      "ws=math.acos(-math.tan(fie)*math.tan(delta));\n",
      "print'%s %.2f %s'%(\" Sunrice hour angle ws=\",ws,\" Degree\");\n",
      "n=172.;##=days of the year (for June 22)\n",
      "##We have the relation for Average insolation at the top of the atmosphere\n",
      "##Ho=(24/%pi)*Isc*[{1+0.033*(360*n/365)}*((cos (fie)*cos(delta)*sin(ws))+(2*%pi*ws/360)*sin(fie)*sin(delta))]\n",
      "Isc=1353.;##SI unit=W/m^2\n",
      "ISC=1165.;##MKS unit=kcal/hr m^2\n",
      "##let\n",
      "a=24./math.pi;\n",
      "aa=(360.*172.)/365.;\n",
      "aaa=(aa*math.pi)/180.;\n",
      "b=math.cos(aaa);\n",
      "bb=0.033*b;\n",
      "bbb=1+bb;\n",
      "c=(10*math.pi)/180.;\n",
      "c1=math.cos(c);\n",
      "cc=(23.5*math.pi)/180;\n",
      "cc1=math.cos(cc);\n",
      "ccc=(94.39*math.pi)/180;\n",
      "ccc1=math.sin(ccc);\n",
      "c=c1*cc1*ccc1;\n",
      "d=(2*math.pi*ws)/360.;\n",
      "e=(10*math.pi)/180;\n",
      "e1=math.sin(e);\n",
      "ee=(23.5*math.pi)/180;\n",
      "ee1=math.sin(ee);\n",
      "e=e1*ee1;\n",
      "##therefoe Ho in SI unit\n",
      "Ho=a*Isc*(bbb*(c+(d*e)));\n",
      "print'%s %.2f %s'%(\"\\n SI UNIT->Ho=:\",Ho,\" W/m^2\");\n",
      "Hac=Ho*(0.3+(0.51*0.55))\n",
      "print'%s %.2f %s'%(\"\\n SI UNIT->Hac=\",Hac,\" W/m^2 day\");\n",
      "ho=a*ISC*(bbb*(c+(d*e)));\n",
      "print'%s %.2f %s'%(\"\\n MKS UNIT->Ho=\",ho,\" kcal/m^2\");\n",
      "hac=ho*0.58;\n",
      "print'%s %.2f %s'%(\"\\n MKS UNIT->Hac=\",hac,\" kcal/m^2 day\");\n",
      "\n",
      "##The values are approximately same as in textbook\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Sunrice hour angle ws= 1.65  Degree\n",
        "\n",
        " SI UNIT->Ho=: 9025.25  W/m^2\n",
        "\n",
        " SI UNIT->Hac= 5239.16  W/m^2 day\n",
        "\n",
        " MKS UNIT->Ho= 7771.19  kcal/m^2\n",
        "\n",
        " MKS UNIT->Hac= 4507.29  kcal/m^2 day\n"
       ]
      }
     ],
     "prompt_number": 1
    }
   ],
   "metadata": {}
  }
 ]
}