summaryrefslogtreecommitdiff
path: root/sample_notebooks/sai kiranmalepati/Samplenb.ipynb
blob: 1e3cfad61e2f64067071a584b5ee4ebfe4ba33c5 (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
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#Chapter-1, Section-1.22, pg-24, problem 1\n",
    "\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": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Chapter-1, Section-1.23, pg 39, Problem- 4\n",
    "\n",
    "import math                                                                    # Library imported.\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"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Chapter 1, Section 1.22, Problem 6, pg 27.\n",
    "\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",
    "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"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Chapter-2, Section-2.4, Problem 2, Page number 56\n",
    "\n",
    "import math                                                       #Library to be used is imported\n",
    "\n",
    "cd=(15-15*math.cos(3*(math.pi/180)))/10;                         #displacement perpendicular to chain line.\n",
    "\n",
    "print('the required displacement perpendicular to char line is ',cd); #Print cd\n",
    "bc=15*(math.sin(3*(math.pi/180)))/10;                               #displacement parallel to chain line.\n",
    "print('the displacemenet parllel to the chain line is ',bc)         #print bc"
   ]
  }
 ],
 "metadata": {
  "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
}