summaryrefslogtreecommitdiff
path: root/sample_notebooks/AkshayPatil/chapter1_1.ipynb
blob: c989cf92b43377a854e04ce0d3536544cbf06c97 (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
{
 "metadata": {
  "name": "chapter1.ipynb"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 1:Introduction and Basic Concepts"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.1-2 Page Number 19"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Declaration\n",
      "UnitCostOfEnergy=0.09 #Unit cost of Energy in $/kWh\n",
      "TimeInterval=2200 # Time Interval in hours\n",
      "EnergyperUnitTime=30 # Rated Power kW\n",
      "\n",
      "#Calculation\n",
      "TotalEnergy=EnergyperUnitTime*TimeInterval # Total Energy in kWh\n",
      " \n",
      "#Money Saved\n",
      "MoneySaved=TotalEnergy*UnitCostOfEnergy # Money Saved in $\n",
      "\n",
      "#Calculations in Joules\n",
      "Tot=EnergyperUnitTime*TimeInterval*(3600) #Total Energy in kJ\n",
      "\n",
      "#Result\n",
      "print\"The Total Energy Generated is\",round(TotalEnergy),\"kWh\"\n",
      "print\"The Total Money Saved is\",round(MoneySaved),\"$\" "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Total Energy Generated is 66000.0 kWh\n",
        "The Total Money Saved is 5940.0 $\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.1-3, Page Number 20"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Decleration\n",
      "rho=850 #density of oil in kg/m^3\n",
      "V=2 #Volume of tank in m^3\n",
      "\n",
      "#Calculations\n",
      "#We intend to find m\n",
      "m=rho*V #mass in the tank in kg\n",
      "\n",
      "#Result\n",
      "print\"The mass in the tank is\", round(m),\"kg\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The mass in the tank is 1700.0 kg\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.1-4, Page Number 21"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Decleration\n",
      "m=1 #mass in lbm\n",
      "g=32.174 #Gravatational Acceleration in ft/s^2\n",
      "\n",
      "#Calculations\n",
      "W=(m*g)*(1/g) #weight in lbf\n",
      "\n",
      "#Result\n",
      "print\"The weight in lbf is \",round(W),\"lbf\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The weight in lbf is  1.0 lbf\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.1-6, Page Number 30"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Decleration\n",
      "V=1.1 #Volume of water collected in gal \n",
      "delt=45.62 # time required in s\n",
      "gal_conv=3.785*10**-3 #Gal conversion constant\n",
      "mi=60 #1 minute equals 60 seconds  \n",
      "\n",
      "#Calculations\n",
      "V_dot=(V/delt)*(gal_conv/1)*(mi/1) #Volume flow rate in m^3/min\n",
      "\n",
      "#Result\n",
      "print\"The volume flow rate is \",round(V_dot,4), \"m^3/min\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The volume flow rate is  0.0055 m^3/min\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}