summaryrefslogtreecommitdiff
path: root/Advanced_Strength_and_Applied_Elasticity/Chapter5.ipynb
blob: 0c66212bc60d0e0644abaf0ed1738c2f6ac3ece5 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:4defd5409de6787753d9afa80f45fd44de9564eee21481b5ef4ed48087f19bda"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter5-Bending of Beams"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1-pg128"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate meter and sigma \n",
      "Mz=11000. ##Nm\n",
      "A1=0.13*0.02 ##m\n",
      "A2=0.15*0.02 ##m\n",
      "z1=0.01 ##m\n",
      "z2=0.075 ##m\n",
      "yA=0.043 ##m\n",
      "zA=-0.106 ##m\n",
      "yB=-0.063 ##m\n",
      "zB=0.\n",
      "\n",
      "##location of the centroid\n",
      "z=(A1*z1+A2*z2)/(A1+A2)\n",
      "print'%s %.2f %s'%(\"in meter is= \",z,\"\")\n",
      "\n",
      "Iz=(0.02*(0.13)**3)/12.+ (0.13*0.02*(0.04)**2)+(0.15*(0.02)**3.)/12.+ (0.15*0.02*(0.035)**2.)\n",
      "print'%s %.5f %s'%(\"Iz in meter^4 is= \",Iz,\"\")\n",
      "Iy=(0.02*(0.13)**3)/12.+ (0.13*0.02*(0.04)**2)+(0.15*(0.02)**3)/.12+ (0.15*0.02*(0.035)**2.)\n",
      "print'%s %.5f %s'%(\"Iy in meter^4 is= \",Iy,\"\")\n",
      "Iyz=0+A1*0.04*(-0.035)+0+A2*(-0.035)*0.03\n",
      "print'%s %.2f %s'%(\"Iyz in meter^4 is= \",Iyz,\"\")\n",
      "##thetap=(atand((-2*Iyz)/(Iz-Iy)))/2\n",
      "##print'%s %.2f %s'%(thetap)\n",
      "I1=(Iz+math.sqrt(0.+(6.79*10**-6)**2.))\n",
      "print'%s %.5f %s'%(\"I1 in meter^4 is= \",I1,\"\")\n",
      "I2=(Iz-math.sqrt(0+(6.79*10**-6)**2))\n",
      "print'%s %.6f %s'%(\"I2 in meter^4 is= \",I2,\"\")\n",
      "My1=11000.*math.sin(45/57.3)\n",
      "print'%s %.2f %s'%(\"My1 in Nm is\",My1,\"\")\n",
      "Mz1=11000*math.sin(45/57.3)\n",
      "print'%s %.2f %s'%(\"Mz1 in Nm is\",Mz1,\"\")\n",
      "\n",
      "sigmaxA=((My1*(zA))/I1)-((Mz1*yA)/I2)\n",
      "print'%s %.2f %s'%(\"sigmaxA in MPa is\",sigmaxA,\"\")\n",
      "sigmaxB=0-((My1*yB)/I2)\n",
      "print'%s %.2f %s'%(\"sigmaxB in MPa is\",sigmaxB,\"\")\n",
      "\n",
      "My=0.\n",
      "y=((Mz*Iyz)*z)/(Mz*Iy) ##.......equal to z=-1.71y\n",
      "print'%s %.3f %s'%(\"y\",y,\"\")\n",
      "\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "in meter is=  0.04 \n",
        "Iz in meter^4 is=  0.00001 \n",
        "Iy in meter^4 is=  0.00002 \n",
        "Iyz in meter^4 is=  -0.00 \n",
        "I1 in meter^4 is=  0.00002 \n",
        "I2 in meter^4 is=  0.000005 \n",
        "My1 in Nm is 7777.72 \n",
        "Mz1 in Nm is 7777.72 \n",
        "sigmaxA in MPa is -114417761.50 \n",
        "sigmaxB in MPa is 101941050.82 \n",
        "y -0.014 \n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex4-144"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate the distance \n",
      "import scipy\n",
      "from scipy import integrate\n",
      "t=1.25 ##mm\n",
      "y=15.87 ##mm\n",
      "z=5.28 ##mm\n",
      "Iy=4765.62 ##mm**4\n",
      "Iz=21054.69 ##mm**4\n",
      "Iyz=3984.37 ##mm**4\n",
      "thetap=13.05 ##degree\n",
      "Iy1=3828.12 ##mm**4\n",
      "Iz1=21953.12##mm**4\n",
      "s=12.5\n",
      "\n",
      "##tau=(Vy/Iz1*t)*s*t(19.55+s*asind(13.05)/2)....equation 1\n",
      "##F1=integrate((tau*t)ds)\n",
      "def fun(s):\n",
      "\ty=(0)\n",
      "\treturn y\n",
      "x=scipy.integrate.quad(fun,0,1)\n",
      "x=x[0]\n",
      "##F1=0.0912*Vy1                   substituting the value of tau we get F1\n",
      "##Vy1*ez1=37.5*F1                 substituting the value of F1 we get ez1\n",
      "ez1=37.5*0.0912\n",
      "print'%s %.2f %s'%(\"the distance in mm is= \",ez1,\"\")\n",
      "\n",
      "##tau=(Vz1/Iy1*t)*s*t(12.05-s*asind(13.05)/2)....equation 2\n",
      "##F1=integrate((tau*t)ds)\n",
      "def fun(s):\n",
      "\ty=(0)\n",
      "\treturn y\n",
      "x=scipy.integrate.quad(fun,0,1)\n",
      "x=x[0]\n",
      "\n",
      "##F1=0.204*Vz1                   substituting the value of tau we get F1\n",
      "##Vz1*ey1=37.5*F1                 substituting the value of F1 we get ez1\n",
      "ey1=37.5*0.204\n",
      "print'%s %.2f %s'%(\"the distance in mm is= \",ey1,\"\")\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the distance in mm is=  3.42 \n",
        "the distance in mm is=  7.65 \n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex5-pg154"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate stress and meter\n",
      "import scipy\n",
      "from scipy import integrate\n",
      "P=70. ##kN\n",
      "c=0.05##m\n",
      "c1=c\n",
      "c2=c\n",
      "R=0.1+0.05\n",
      "A=0.005\n",
      "\n",
      "##m=(-1/(2*c))*integrate((y/R+y)dy)\n",
      "def fun(c):\n",
      "\ty=(-c)\n",
      "\treturn y\n",
      "\n",
      "x=scipy.integrate.quad(fun,0,1)\n",
      "m=-1.+(R/2.*c)*math.log((R+c)/(R-c))\n",
      "print'%s %.2f %s'%(\"m\",m,\"\")\n",
      "##m=(-1/(2*c))*integrate((y/R)-(y**2/R**2)+(y**3/R**3)-(y**4/R**4)+.....)dy)\n",
      "m=-1+(3/2.)*math.log(2.)\n",
      "print'%s %.3f %s'%(\"m\",m,\"\")\n",
      "\n",
      "M=P*R\n",
      "print'%s %.2f %s'%(\"M\",M,\"\")\n",
      "sigmatheta1=(-P*c2)/(m*A*(R-c1))\n",
      "print'%s %.2f %s'%(\"stress in Pa is= \",sigmatheta1,\"\")\n",
      "sigmatheta2=(P*c2)/(m*A*(R+c2))\n",
      "print'%s %.2f %s'%(\"stress in Pa is= \",sigmatheta2,\"\")\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "m -1.00 \n",
        "m 0.040 \n",
        "M 10.50 \n",
        "stress in Pa is=  -176230.22 \n",
        "stress in Pa is=  88115.11 \n"
       ]
      }
     ],
     "prompt_number": 1
    }
   ],
   "metadata": {}
  }
 ]
}