summaryrefslogtreecommitdiff
path: root/sample_notebooks/AdityaR/Chapter_5-Sample_Notebook.ipynb
blob: a77ec491f76d8579e205db8858e86547946cae3e (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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 5 General Case of Forces in a plane"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "# Example 5.2 Equations of equilibrium"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('The reaction at P is', 5656.85424949238, 'N')\n",
      "('The reaction at Q is ', 4000.0, 'N')\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#Initialization of Variables\n",
    "W=2000 #N\n",
    "Lab=2 #m #length of the member from the vertical to the 1st load of 2000 N\n",
    "Lac=5 #m #length of the member from the vertical to the 2nd load of 2000 N\n",
    "Lpq=3.5 #m\n",
    "\n",
    "#Calculations\n",
    "Rq=((W*Lab)+(W*Lac))/Lpq #N #take moment abt. pt P\n",
    "Xp=Rq #N #sum Fx=0\n",
    "Yp=2*W #N #sum Fy=0\n",
    "Rp=math.sqrt(Xp**2+Yp**2) #N\n",
    "\n",
    "#Resuts\n",
    "print('The reaction at P is' ,Rp ,'N')\n",
    "print('The reaction at Q is ',Rq ,'N')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "# Example 5.3 Equations of equilibrium"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('The reaction at A i.e Ra is ', matrix([[ 120.27406887]]), 'N')\n",
      "('The reaction at B i.e Rb is ', matrix([[ 35.13703443]]), 'N')\n",
      "('The required tension in the string is ', matrix([[ 40.57275258]]), 'N')\n"
     ]
    }
   ],
   "source": [
    "import math,numpy\n",
    "#Initilization of vaiables\n",
    "W=25 #N # self weight of the ladder\n",
    "M=75 #N # weight of the man standing o the ladder\n",
    "theta=63.43 #degree # angle which the ladder makes with the horizontal\n",
    "alpha=30 #degree # angle made by the string with the horizontal\n",
    "Loa=2 #m # spacing between the wall and the ladder\n",
    "Lob=4 #m #length from the horizontal to the top of the ladder touching the wall(vertical)\n",
    "\n",
    "#Calculations\n",
    "#Using matrix to solve the simultaneous eqn's 3 & 4\n",
    "A=numpy.matrix('2 -4; 1 -0.577')\n",
    "B=numpy.matrix('100;100')\n",
    "C=numpy.linalg.inv(A)*B\n",
    "\n",
    "#Results\n",
    "print('The reaction at A i.e Ra is ',C[0] ,'N')\n",
    "print('The reaction at B i.e Rb is ',C[1] ,'N')\n",
    "\n",
    "#Calculations\n",
    "T=C[1]/math.cos(math.radians(alpha)) #N # from (eqn 1)\n",
    "\n",
    "#Results\n",
    "print('The required tension in the string is ',T, 'N')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "# Example 5.4 Equations of Equilibrium"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('The reaction at B i.e Rb is ', 25.0, 'N')\n",
      "('The horizontal reaction at A i.e Xa is ', 21.650635094610966, 'N')\n",
      "('The vertical reaction at A i.e Ya is ', 112.5, 'N')\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "#Initilization of variables\n",
    "W=100 #N\n",
    "theta=60 #degree angle made by the ladder with the horizontal\n",
    "alpha=30 #degree angle made by the ladder with the vertical wall\n",
    "Lob=4 #m  length from the horizontal to the top of the ladder touching the wall(vertical)\n",
    "Lcd=2 #m  length from the horizontal to the centre of the ladder where the man stands\n",
    "\n",
    "#Calculations\n",
    "Lab=Lob*(1/math.cos(math.radians(alpha))) #m length of the ladder\n",
    "Lad=Lcd*math.tan(math.radians(alpha)) #m\n",
    "Rb=(W*Lad)/Lab #N take moment at A\n",
    "Xa=Rb*math.sin(math.radians(theta)) #N  From eq'n 1\n",
    "Ya=W+Rb*math.cos(math.radians(theta)) #N From eq'n 2\n",
    "\n",
    "#Results\n",
    "print('The reaction at B i.e Rb is ',Rb, 'N')\n",
    "print('The horizontal reaction at A i.e Xa is ',Xa, 'N')\n",
    "print('The vertical reaction at A i.e Ya is ',Ya,'N')\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "# Example 5.5 Equations of Equilibrium"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('The horizontal reaction at A i.e Xa is ', 28.867513459481287, 'N')\n",
      "('The vertical reaction at A i.e Ya is ', 100, 'N')\n",
      "('The reaction at B i.e Rb is ', 28.867513459481287, 'N')\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "#Initilization of variables\n",
    "W=100 #N self weight of the man\n",
    "alpha=30 #degree angle made by the ladder with the wall\n",
    "Lob=4 #m  length from the horizontal to the top of the ladder touching the wall(vertical)\n",
    "Lcd=2 #m\n",
    "\n",
    "#Calculations\n",
    "# using the equiblirium equations\n",
    "Ya=W #N  From eq'n 2\n",
    "Lad=Lcd*math.tan(math.radians(alpha)) #m Lad is the distance fom pt A to the point where the line from the cg intersects the horizontal\n",
    "Rb=(W*Lad)/Lob #N  Taking sum of moment abt A\n",
    "Xa=Rb #N From eq'n 1\n",
    "\n",
    "#Results\n",
    "print('The horizontal reaction at A i.e Xa is ',Xa, 'N')\n",
    "print('The vertical reaction at A i.e Ya is ',Ya,'N' )\n",
    "print('The reaction at B i.e Rb is ',Rb ,'N')\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "# Example 5.6 Equations of Equilibrium"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('The horizontal reaction at A i.e Xa is ', 3.84, 'N')\n",
      "('The vertical reaction at A i.e Ya is ', 7.12, 'N')\n",
      "('Therefore the reaction at A i.e Ra is ', 8.089499366462674, 'N')\n",
      "('The reaction at D i.e Rd is ', 4.8, 'N')\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "#Initilization of variables\n",
    "d=0.09 #m diametre of the right circular cylinder\n",
    "h=0.12 #m height of the cyinder\n",
    "W=10 #N  self weight of the bar\n",
    "l=0.24 #m length of the bar\n",
    "\n",
    "#Calculations\n",
    "theta=math.degrees(math.atan(h/d))  #angle which the bar makes with the horizontal\n",
    "Lad=math.sqrt(d**2+h**2) #m Lad is the length of the bar from point A to point B\n",
    "Rd=(W*h*(math.cos(theta*math.pi/180)))/Lad #N  Taking moment at A\n",
    "Xa=Rd*(math.sin(theta*math.pi/180)) #N  sum Fx=0.... From eq'n 1\n",
    "Ya=W-(Rd*(math.cos(theta*math.pi/180))) #N  sum Fy=0..... From eq'n 2\n",
    "Ra=math.sqrt(Xa**2+Ya**2) #resultant of Xa & Ya\n",
    "\n",
    "#Results\n",
    "print('The horizontal reaction at A i.e Xa is ',Xa, 'N')\n",
    "print('The vertical reaction at A i.e Ya is ',Ya, 'N')\n",
    "print('Therefore the reaction at A i.e Ra is ',Ra,'N')\n",
    "print('The reaction at D i.e Rd is ',Rd,'N')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [Root]",
   "language": "python",
   "name": "Python [Root]"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.12"
  },
  "widgets": {
   "state": {},
   "version": "1.1.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}