summaryrefslogtreecommitdiff
path: root/sample_notebooks/AkshayPatil/Chapter01.ipynb
blob: 8594491e00a5e9e79c50bf3187d92fd206d2f91a (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:055c326b63bc3f150b8a5e433c724771cc1733887ec2b1e223ccf712fcd80848"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 01:Stress"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.1.1, Page No:9"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#NOTE:The notation has been changed to simplify the coding process\n",
      "\n",
      "#Variable Decleration\n",
      "P_AB=4000 #Axial Force at section 1 in lb\n",
      "P_BC=5000 #Axial Force at section 2 in lb\n",
      "P_CD=7000 #Axial Force at section 3 in lb\n",
      "A_1=1.2 #Area at section 1 in in^2\n",
      "A_2=1.8 #Area at section 2 in in^2\n",
      "A_3=1.6 #Area at section 3 in in^2\n",
      "\n",
      "#Calculation\n",
      "#S indicates sigma here\n",
      "S_AB=P_AB/A_1 #Stress at section 1 in psi (T)\n",
      "S_BC=P_BC/A_2 #Stress at section 2 in psi (C)\n",
      "S_CD=P_CD/A_3 #Stress at section 3 in psi (C)\n",
      "\n",
      "#Result\n",
      "print \"The stress at the three sections is given as\"\n",
      "print \"Stress at section 1=\",round(S_AB),\"section 2=\",round(S_BC),\"section 3=\",S_CD\n",
      "\n",
      "#NOTE:The answer for the following example for section 1 and section 2\n",
      "#are incorrect due to rounding in the textbook\n",
      "#Computed values are correct"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The stress at the three sections is given as\n",
        "Stress at section 1= 3333.0 section 2= 2778.0 section 3= 4375.0\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.1.2, Page No:10"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Decleration\n",
      "Ay=40 #Vertical Reaction at A in kN\n",
      "Hy=60 #Vertical Reaction at H in kN\n",
      "Hx=0 #Horizontal Reaction at H in kN\n",
      "y=3 #Height in m\n",
      "x=5 #Distance in m\n",
      "p=4 #Panel distance in m\n",
      "A=900 #Area of the member in mm^2\n",
      "P_C=30 #Force at point C in kN\n",
      "\n",
      "#Calculation\n",
      "#Part 1\n",
      "#Applying summation of forces in the x and y direction and equating to zero\n",
      "P_AB=(-Ay)*(x*y**-1) #Force in member AB in kN\n",
      "P_AC=-(p*x**-1*P_AB) #Force in member AC in kN\n",
      "#Using stress=force/area\n",
      "S_AC=(P_AC/A)*10**3 #Stress in member AC in MPa (T)\n",
      "\n",
      "#Part 2\n",
      "#Sum of moments about point E to zero\n",
      "P_BD=(Ay*p*2-(P_C*p))*y**-1 #Force in memeber AB in kN (C)\n",
      "S_BD=(P_BD/A)*10**3 #Stress in member in MPa (C)\n",
      "\n",
      "#Result\n",
      "print \"The Stress in member AC is\",round(S_AC,1),\"MPa (T)\"\n",
      "print \"The Stress in member BD is\",round(S_BD,1),\"MPa (C)\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Stress in member AC is 59.3 MPa (T)\n",
        "The Stress in member BD is 74.1 MPa (C)\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.1.3, Page No:11"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "import numpy as num\n",
      "\n",
      "#Variable Decleration\n",
      "A_AB=800 #Area of member AB in m^2\n",
      "A_AC=400 #Area of member AC in m^2\n",
      "W_AB=110 #Safe value of stress in Pa for AB\n",
      "W_AC=120 #Safe value of stress in Pa for AC\n",
      "theta1=60*3.14*180**-1 #Angle in radians\n",
      "theta2=40*3.14*180**-1 #Angle in radians \n",
      "\n",
      "#Calculations\n",
      "#Applying sum of forces \n",
      "#Solving by matrix method putting W as 1\n",
      "A=num.array([[-cos(theta1),cos(theta2)],[sin(theta1),sin(theta2)]])\n",
      "B=num.array([[1],[1]])\n",
      "C=inv(A)\n",
      "D=C*B\n",
      "\n",
      "#Using newtons third law\n",
      "#Two values of W hence the change in the notation\n",
      "W1=(W_AB*A_AB)*(D[1,1])**-1 #Weight W in N\n",
      "W2=(W_AC*A_AC)*(D[0,1])**-1 #Weight W in N\n",
      "\n",
      "#Result\n",
      "print \"The maximum value of W allowable is\",round(W2*1000**-1,1),\"kN\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The maximum value of W allowable is 61.7 kN\n"
       ]
      }
     ],
     "prompt_number": 48
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.1.4, Page No:19"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Decleration\n",
      "d=3*4**-1 #Rivet diameter in inches\n",
      "t=7*8**-1 #Thickness of the plate in inches\n",
      "tau=14000 #Shear stress limit in psi\n",
      "sigma_b=18000 #Normal stress limit in psi\n",
      "\n",
      "#Calculations\n",
      "#Design Shear Stress in Rivets\n",
      "V=tau*(d**2*(pi/4))*4 #Shear force maximum allowable in lb\n",
      "#Design for bearing stress in plate\n",
      "Pb=sigma_b*t*d*4 #lb\n",
      "\n",
      "#Result\n",
      "print \"The maximum load that the joint can carry is\",round(V),\"lb\"\n",
      "\n",
      "#NOTE:The answer in the textbook is off by 40lb"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The maximum load that the joint can carry is 24740.0 lb\n"
       ]
      }
     ],
     "prompt_number": 55
    }
   ],
   "metadata": {}
  }
 ]
}