summaryrefslogtreecommitdiff
path: root/sample_notebooks/sai kiranmalepati/Untitled.ipynb
blob: 9f9ee1a51ae8c599267cbf9eff5ab6b2dd1beead (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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# CHAPTER 1: INTRODUCTION"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##  Section-1.22,  Problem 1, pg24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " the length of the chain is  20 meters\n",
      " the error in the chain is   0.03\n",
      " the measured length  327 meters\n",
      " the ture length of the chain is  327.4905 meters\n"
     ]
    }
   ],
   "source": [
    "#Variable Declaration\n",
    "L=20;                                                          # True length of the chain is defined as L\n",
    "print(' the length of the chain is ',L,'meters');              # Print L\n",
    "\n",
    "E=0.03;                                                        #Error in chain\n",
    "print(' the error in the chain is  ',E);                       #Print E\n",
    "\n",
    "ML=327;                                                        #Measured length is defined as ML\n",
    "print(' the measured length ',ML,'meters');                    #print ML\n",
    "\n",
    "tlength=((L+E)/L)*ML;                                           #True length of L calculated\n",
    "print(' the ture length of the chain is ',tlength,'meters');    #Print true length.\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "\n",
    "\n",
    "## Section 1.22, Problem 6, pg 27."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " for n=1\n",
      "the temperature correction is 0.00396 meters\n",
      "the pull corretion is  0.002380952380952381  meters\n",
      "the sag correction is   -0.0026680499999999995 meters\n",
      "the total correction is  0.0036729023809523816 meters\n",
      "the true length  is  780.0954954619046\n",
      " for n=2\n",
      "the temperature correction is 0.00396 meters\n",
      "the pull corretion is  0.002380952380952381  meters\n",
      "the sag correction is   -0.0006670124999999999 meters\n",
      "the total correction is  0.005673939880952382 meters\n",
      "the true length  is  780.1475224369049\n"
     ]
    }
   ],
   "source": [
    "#Variable declaration\n",
    "L=30;                                                  #Length of tape\n",
    "t0=20;                                                 #Temperature of tape\n",
    "p0=10;                                                 #Pull under which tape is present\n",
    "pm=15;                                                #Measured line pull\n",
    "tm=32;                                                #Mean temperature.\n",
    "a=0.03;                                              #Cross-sectional area\n",
    "al=11/(1000000);                                     #Temperature correction co-efficient\n",
    "E=2.1*(1000000);                                     #E for steel\n",
    "w=0.693;                                             #Total weight\n",
    "ml=780;                                              #measured length\n",
    "n=1;                                                 #n defined\n",
    "print(' for n=1');                                   #print n value\n",
    "ct=al*L*(tm-t0);                                     #temperature correction calculated\n",
    "print('the temperature correction is',ct,'meters'); #print temperature correction\n",
    "\n",
    "cp=(pm-p0)*L/(a*E);                                   #pull correction calculated\n",
    "print('the pull corretion is ',cp,' meters');         #print pull correction\n",
    "\n",
    "cs=-L*w*w/(24*pm*pm*n*n);                             #sag correction calculated\n",
    "print('the sag correction is  ',cs,'meters');          #print sag correction\n",
    "\n",
    "e=ct+cp+cs;                                           #total correction calculated\n",
    "print('the total correction is ',e,'meters');         #total correction printed\n",
    "\n",
    "l1=L+e;                                              #correction in length =sum of correction and measured length \n",
    "\n",
    "truelength=(l1/L)*ml;                                #true length calculated\n",
    "print('the true length  is ',truelength);            #true length printed\n",
    "\n",
    "n=2;                                                 #new n defined\n",
    "\n",
    "print(' for n=2');                                  #print n value\n",
    "ct=al*L*(tm-t0);                                    #temperature correction calculated\n",
    "print('the temperature correction is',ct,'meters'); #print temperature correction\n",
    "\n",
    "\n",
    "cp=(pm-p0)*L/(a*E);                                 #pull correction calculated\n",
    "print('the pull corretion is ',cp,' meters');       #print pull correction\n",
    "\n",
    "cs=-L*w*w/(24*pm*pm*n*n);                           #sag correction calculated\n",
    "print('the sag correction is  ',cs,'meters');       #print sag correction\n",
    "\n",
    "e=ct+cp+cs;                                        #total correction calculated\n",
    "print('the total correction is ',e,'meters');      #total correction printed\n",
    "\n",
    "l1=L+e;                                            #correction in length =sum of correction and measured length \n",
    "\n",
    "truelength=(l1/L)*ml;                              #true length calculated\n",
    "print('the true length  is ',truelength);          #true length printed\n",
    "\n",
    "\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Section-1.23, Problem 4, pg39"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " the value of ab is  28.590787835233098 meters\n",
      " the value of b1c is  23.22557994840693 meters\n",
      " the value of c1d is  20.582482037955145 meters\n",
      " the value of d1e is  28.95316898172065 meters\n",
      "the total distance is  101.35201880331583 meters\n"
     ]
    }
   ],
   "source": [
    "#Library imported\n",
    "import math \n",
    "\n",
    "\n",
    "ab=28.7*math.cos(5*(math.pi/180));                          #AB calculated using trigonometry\n",
    "b1c=23.4*math.cos(7*(math.pi/180));                         #B'C calculated\n",
    "c1d=20.9*math.cos(10*(math.pi/180));                        # C'D calculated\n",
    "d1e=29.6*math.cos(12*(math.pi/180));                        # D'E calculated\n",
    "print(' the value of ab is ',ab,'meters');                 #AB printed\n",
    "\n",
    "print(' the value of b1c is ',b1c,'meters');                # B'C printed\n",
    "\n",
    "print(' the value of c1d is ',c1d,'meters');                  # C'D printed\n",
    "\n",
    "print(' the value of d1e is ',d1e,'meters');                #D'E printed\n",
    "\n",
    "\n",
    "total=ab+b1c+c1d+d1e;                                       #total calculated\n",
    "print('the total distance is ',total,'meters');              #total printed\n"
   ]
  }
 ],
 "metadata": {
  "celltoolbar": "Raw Cell Format",
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}