summaryrefslogtreecommitdiff
path: root/sample_notebooks/amit kumarsaini/Chapter2.ipynb
blob: 9a5cce62605f099e29d4dfa12fc416534ed46f06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
{
 "metadata": {
  "name": "",
  "signature": "sha256:ddaa68fa50b83699f8a6f35deb059bff01c78a46802bd57850513a730bade48f"
 },
 "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 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 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 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": {}
  }
 ]
}