summaryrefslogtreecommitdiff
path: root/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter11_SOLVgXg.ipynb
blob: 06fa6f21813fe6ed6c30f8c6190a0a8bad752948 (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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter11-PRINCIPAL STRESSES AND STRAINS"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 11.2 page number 352"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(a) P= 14726.22 N\n",
      "(b) P= -44178.65 N compressive\n",
      "Material fails because of maximum shear and not by axial compression.\n",
      "P= 24544.0 N\n",
      "The plane of qmax is at 45° to the plane of px. \n"
     ]
    }
   ],
   "source": [
    "from math import sqrt,pi\n",
    "\n",
    "#A material has strength in tension, compression and shear as 30N/mm2, 90 N/mm2 and 25 N/mm2, respectively. If a specimen of diameter 25 mm is tested in tension and compression identity the failure surfaces and loads. \n",
    "\n",
    "#variable declaration\n",
    "\n",
    "#In tension: Let axial direction be x direction. Since it is uniaxial loading, py  = 0, q = 0 and only px exists.when the material is subjected to full tensile stress, px = 30 N/mm^2.\n",
    "\n",
    "pt=float(30)\n",
    "pc=float(90)\n",
    "ps=float(25)\n",
    "\n",
    "d=float(25)\n",
    "px=float(30)         #N/mm^2\n",
    "py=0\n",
    "q=0\n",
    "p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))\n",
    "\n",
    "p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))\n",
    "\n",
    "qmax=(px-py)/2\n",
    "\n",
    "#Hence failure criteria is normal stress p1\n",
    "\n",
    "A=pi*pow(d,2)/4\n",
    "\n",
    "#Corresponding load P is obtained by\n",
    "p=p1\n",
    "P=p1*A\n",
    "\n",
    "print \"(a) P=\",round(P,2),\"N\"\n",
    "\n",
    "#In case of compression test,\n",
    "\n",
    "px=-pc\n",
    "py=q=0\n",
    "\n",
    "P=-px*A\n",
    "\n",
    "print \"(b) P=\",round((-P),2),\"N compressive\"\n",
    "\n",
    "#at this stage\n",
    "\n",
    "qmax=sqrt((pow((px-py)/2,2))+pow(q,2))\n",
    "\n",
    "print \"Material fails because of maximum shear and not by axial compression.\"\n",
    "qmax=25\n",
    "px=2*qmax\n",
    "\n",
    "P=px*A\n",
    "print\"P=\",round(P),\"N\"\n",
    "print \"The plane of qmax is at 45° to the plane of px. \"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 11.3 page number 354"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "pn= 30.0 N/mm^2\n",
      "pt= 86.6 N/mm^2\n",
      "p= 91.65 N/mm^2\n",
      "alpha= 19.1 °\n"
     ]
    }
   ],
   "source": [
    "#The direct stresses at a point in the strained material are 120 N/mm2 compressive and 80 N/mm2 tensile. There is no shear stress.\n",
    "\n",
    "from math import sqrt,cos,sin,atan,pi\n",
    "#variable declaration\n",
    "\n",
    "#The plane AC makes 30° (anticlockwise) to the plane of px (y-axis). Hence theta= 30°. px = 80 N/mm^2 py = – 120 N/mm^2 ,q = 0\n",
    "\n",
    "px=float(80)\n",
    "py=float(-120)\n",
    "q=float(0)\n",
    "theta=30\n",
    "pn=((px+py)/2)+((px-py)/2)*cos(2*theta*pi/180)+q*sin(2*theta*pi/180)\n",
    "\n",
    "print\"pn=\",round(pn),\"N/mm^2\"\n",
    "\n",
    "pt=((px-py)/2)*sin(2*theta*pi/180)-q*cos(2*theta*pi/180)\n",
    "\n",
    "print\"pt=\",round(pt,1),\"N/mm^2\"\n",
    "p=sqrt(pow(pn,2)+pow(pt,2))\n",
    "\n",
    "print\"p=\",round(p,2),\"N/mm^2\"\n",
    "\n",
    "alpha=atan(pn/pt)*180/pi\n",
    "\n",
    "print \"alpha=\", round(alpha,1),\"°\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 11.4 page number 355"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "theta= 37.98 ° and  127.98 °\n",
      "p1= 278.08 N/mm^2\n",
      "p2= 71.92 N/mm^2\n",
      "qmax= 103.08 N/mm^2\n"
     ]
    }
   ],
   "source": [
    "from math import sqrt,cos,sin,atan,pi\n",
    "#variable declaration\n",
    "#Let the principal plane make anticlockwise angle theta with the plane of px with y-axis. Then\n",
    "\n",
    "px=float(200)                    #N/mm^2\n",
    "py=float(150)                    #N/mm^2\n",
    "q=float(100)                     #N/mm^2\n",
    "\n",
    "theta1=(atan((2*q)/(px-py))*180)/(pi*2)                        \n",
    "theta2=90+theta1\n",
    "print\"theta=\",round(theta1,2),\"°\" \" and \",round(theta2,2),\"°\"\n",
    "\n",
    "p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))\n",
    "\n",
    "print \"p1=\",round(p1,2),\"N/mm^2\"\n",
    "\n",
    "p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))\n",
    "\n",
    "print \"p2=\",round(p2,2),\"N/mm^2\"\n",
    "\n",
    "qmax=sqrt((pow((px-py)/2,2))+pow(q,2))\n",
    "\n",
    "print\"qmax=\",round(qmax,2),\"N/mm^2\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 11.5 page number 356"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "p1= 82.8 N/mm^2\n",
      "p2= -62.8 N/mm^2\n",
      "qmax= 72.8 N/mm^2\n",
      "theta= 7.97 ° and  97.97 °\n",
      "theta'= 37.03 ° and= 52.97 °\n",
      "answer in book is wrong\n"
     ]
    }
   ],
   "source": [
    "\n",
    "from math import sqrt,cos,sin,atan,pi\n",
    "#variable declaration\n",
    "#Let the principal plane make anticlockwise angle theta with the plane of px with y-axis. Then\n",
    "\n",
    "px=float(80)                    #N/mm^2\n",
    "py=float(-60)                    #N/mm^2\n",
    "q=float(20)                     #N/mm^2\n",
    "\n",
    "\n",
    "p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))\n",
    "\n",
    "print \"p1=\",round(p1,2),\"N/mm^2\"\n",
    "\n",
    "p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))\n",
    "\n",
    "print \"p2=\",round(p2,2),\"N/mm^2\"\n",
    "\n",
    "qmax=sqrt((pow((px-py)/2,2))+pow(q,2))\n",
    "\n",
    "print\"qmax=\",round(qmax,2),\"N/mm^2\"\n",
    "\n",
    "#let theta be the inclination of principal stress to the plane of px.\n",
    "\n",
    "\n",
    "theta1=(atan((2*q)/(px-py))*180)/(pi*2)                        \n",
    "theta2=90+theta1\n",
    "print\"theta=\",round(theta1,2),\"°\" \" and \",round(theta2,2),\"°\"\n",
    "\n",
    "#Planes of maximum shear make 45° to the above planes.\n",
    "theta11=45-theta1\n",
    "theta22=theta2-45\n",
    "print\"theta'=\",round(theta11,2),\"°\",\"and=\",round(theta22,2),\"°\"\n",
    "\n",
    "print\"answer in book is wrong\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 11.6 page number 357"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "p1= -35.96 N/mm^2\n",
      "p2= -139.04 N/mm^2\n",
      "qmax= 51.54 N/mm^2\n",
      "theta= 37.98 ° and  127.98 °\n"
     ]
    }
   ],
   "source": [
    "from math import sqrt,cos,sin,atan,pi\n",
    "#variable declaration\n",
    "#Let the principal plane make anticlockwise angle theta with the plane of px with y-axis. Then\n",
    "\n",
    "px=float(-100)                    #N/mm^2\n",
    "py=float(-75)                    #N/mm^2\n",
    "q=float(-50)                     #N/mm^2\n",
    "\n",
    "\n",
    "p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))\n",
    "\n",
    "print \"p1=\",round(p1,2),\"N/mm^2\"\n",
    "\n",
    "p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))\n",
    "\n",
    "print \"p2=\",round(p2,2),\"N/mm^2\"\n",
    "\n",
    "qmax=sqrt((pow((px-py)/2,2))+pow(q,2))\n",
    "\n",
    "print\"qmax=\",round(qmax,2),\"N/mm^2\"\n",
    "\n",
    "#let theta be the inclination of principal stress to the plane of px.\n",
    "\n",
    "\n",
    "theta1=(atan((2*q)/(px-py))*180)/(pi*2)                        \n",
    "theta2=90+theta1\n",
    "print\"theta=\",round(theta1,2),\"°\" \" and \",round(theta2,2),\"°\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 11.7 page number 358"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(i) p1= 131.07 N/mm^2\n",
      "p2= -81.07 N/mm^2\n",
      "(ii) qmax= 106.07 N/mm^2\n",
      "theta= -22.5 ° clockwise\n",
      "theta2= 22.5 °\n",
      "p= 108.97 N/mm^2\n",
      "phi= 13.3 °\n",
      "mitake in book answer is wrong\n"
     ]
    }
   ],
   "source": [
    "from math import sqrt,cos,sin,atan,pi\n",
    "#variable declaration\n",
    "#Let the principal plane make anticlockwise angle theta with the plane of px with y-axis. Then\n",
    "\n",
    "px=float(-50)                    #N/mm^2\n",
    "py=float(100)                    #N/mm^2\n",
    "q=float(75)                     #N/mm^2\n",
    "\n",
    "\n",
    "p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))\n",
    "\n",
    "print \"(i) p1=\",round(p1,2),\"N/mm^2\"\n",
    "\n",
    "p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))\n",
    "\n",
    "print \"p2=\",round(p2,2),\"N/mm^2\"\n",
    "\n",
    "qmax=sqrt((pow((px-py)/2,2))+pow(q,2))\n",
    "\n",
    "print\"(ii) qmax=\",round(qmax,2),\"N/mm^2\"\n",
    "\n",
    "#let theta be the inclination of principal stress to the plane of px.\n",
    "\n",
    "\n",
    "theta1=(atan((2*q)/(px-py))*180)/(pi*2)                        \n",
    "\n",
    "print\"theta=\",round(theta1,2),\"°\" \" clockwise\"\n",
    "\n",
    "#Plane of maximum shear makes 45° to it \n",
    "\n",
    "theta2=theta1+45\n",
    "print\"theta2=\",round(theta2,2),\"°\" \n",
    "\n",
    "#Normal stress on this plane is given by\n",
    "\n",
    "pn=((px+py)/2)+((px-py)/2)*cos(2*theta2*pi/180)+q*sin(2*theta2*pi/180)\n",
    "\n",
    "pt=qmax\n",
    "\n",
    "#Resultant stress\n",
    "p=sqrt(pow(pn,2)+pow(pt,2))\n",
    "\n",
    "print \"p=\",round(p,2),\"N/mm^2\"\n",
    "\n",
    "#Let ‘p’ make angle phi to tangential stress (maximum shear stress plane). \n",
    "\n",
    "phi=atan(pn/pt)*180/pi\n",
    "\n",
    "print \"phi=\",round(phi,1),\"°\"\n",
    "\n",
    "#there is mistake in book\n",
    "print\"mitake in book answer is wrong\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 11.9 page number 361"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " p1= 0.17 N/mm^2\n",
      " p2= -84.17 N/mm^2\n"
     ]
    }
   ],
   "source": [
    "from math import sqrt\n",
    "\n",
    "#variable declaration\n",
    "\n",
    "w=float(100)                   #wide of rectangular beam,mm\n",
    "h=float(200)                   #height or rectangular beam dude,mm\n",
    "\n",
    "I=w*pow(h,3)/12\n",
    "\n",
    "#At point A, which is at 30 mm below top fibre \n",
    "y=100-30\n",
    "M=float(80*1000000)            #sagging moment,KN-m\n",
    "\n",
    "fx=M*y/I\n",
    "\n",
    "px=-fx\n",
    "F=float(100*1000 )            #shear force,N\n",
    "b=float(100)\n",
    "A=b*30\n",
    "y1=100-15\n",
    "\n",
    "q=(F*(A*y1))/(b*I)     #shearing stress,N/mm^2\n",
    "\n",
    "py=0\n",
    "p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))\n",
    "p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))\n",
    "print \" p1=\",round(p1,2),\"N/mm^2\"\n",
    "print \" p2=\",round(p2,2),\"N/mm^2\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 11.10 page number 362\n",
    " "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(i) p1= 0.8333 N/mm^2\n",
      " p2= -0.8333 N/mm^2\n",
      "theta= 45.0 °  and  135.0 °\n",
      "(ii) p1= 0.0122 N/mm^2\n",
      " p2= -32.4196 N/mm^2\n",
      "theta= -1.0 °  and  89.0 °\n",
      "mistake in book\n",
      "(iii) p1= 0.0 N/mm^2\n",
      " p2= -64.8148 N/mm^2\n",
      "theta= -0.0 °  and  90.0 °\n"
     ]
    }
   ],
   "source": [
    "from math import sqrt,atan\n",
    "\n",
    "P1=float(20)                        #vertical loading from A at distance of 1m,KN.\n",
    "P2=float(20)                        #vertical loading from A at distance of 2m,KN.\n",
    "P3=float(20)                        #vertical loading from A at distance of 3m,KN.\n",
    "Ra=(P1+P2+P3)/2              #Due to symmetry\n",
    "\n",
    "Rb=Ra                         \n",
    "#At section 1.5 m from A\n",
    "F=(Ra-P1)*1000\n",
    "M=float((Ra*1.5-P1*0.5)*1000000)\n",
    "b=float(100)\n",
    "h=float(180)\n",
    "\n",
    "I=float((b*pow(h,3))/12)\n",
    "\n",
    "# Bending stress \n",
    "#f=M*y/I\n",
    "y11=0\n",
    "f1=(-1)*M*y11/I\n",
    "y22=45\n",
    "f2=(-1)*M*y22/I\n",
    "y33=90\n",
    "f3=(-1)*M*y33/I\n",
    "#Shearing stress at a fibre ‘y’ above N–A is\n",
    "#q=(F/(b*I))*(A*y1)\n",
    "#at y=0,\n",
    "y1=45\n",
    "A1=b*90\n",
    "q1=(F/(b*I))*(A1*y1)\n",
    "#at y=45\n",
    "y2=float(90-45/2)\n",
    "A2=b*45\n",
    "q2=(F/(b*I))*(A2*y2)\n",
    "#at y=90\n",
    "q3=0\n",
    "\n",
    "#(a) At neutral axis (y = 0) : The element is under pure shear \n",
    "\n",
    "py=0\n",
    "\n",
    "p1=(f1+py)/2+sqrt(pow(((f1-py)/2),2)+pow(q1,2))\n",
    "\n",
    "p2=(f1+py)/2-sqrt(pow(((f1-py)/2),2)+pow(q1,2))\n",
    "print \"(i) p1=\",round(p1,4),\"N/mm^2\"\n",
    "print \" p2=\",round(p2,4),\"N/mm^2\"\n",
    "\n",
    "theta1=45\n",
    "theta2=theta1+90\n",
    "print\"theta=\",round(theta1),\"°\",\" and \",round(theta2),\"°\"\n",
    "\n",
    "#(b) At (y = 45)\n",
    "py=0 \n",
    "\n",
    "p1=(f2+py)/2+sqrt(pow(((f2-py)/2),2)+pow(q2,2))\n",
    "\n",
    "p2=(f2+py)/2-sqrt(pow(((f2-py)/2),2)+pow(q2,2))\n",
    "print \"(ii) p1=\",round(p1,4),\"N/mm^2\"\n",
    "print \" p2=\",round(p2,4),\"N/mm^2\"\n",
    "\n",
    "thetab1=(atan((2*q2)/(f2-py))*180)/(pi*2)\n",
    "thetab2=thetab1+90\n",
    "print\"theta=\",round(thetab1),\"°\",\" and \",round(thetab2),\"°\"\n",
    "#mistake in book\n",
    "print\"mistake in book\"\n",
    "\n",
    "#(c) At Y=90\n",
    "\n",
    "py=0\n",
    "\n",
    "p1=(f3+py)/2+sqrt(pow(((f3-py)/2),2)+pow(q3,2))\n",
    "\n",
    "p2=(f3+py)/2-sqrt(pow(((f3-py)/2),2)+pow(q3,2))\n",
    "print \"(iii) p1=\",round(p1,4),\"N/mm^2\"\n",
    "print \" p2=\",round(p2,4),\"N/mm^2\"\n",
    "\n",
    "thetac1=(atan((2*q3)/(f3-py))*180)/(pi*2)\n",
    "thetac2=thetac1+90\n",
    "print\"theta=\",round(thetac1),\"°\",\" and \",round(thetac2),\"°\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 11.11 page number 364\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " p1= 5.21 N/mm^2\n",
      " p2= -107.56 N/mm^2\n",
      "qmax= 56.38 N/mm^2\n"
     ]
    }
   ],
   "source": [
    "from math import sqrt\n",
    "\n",
    "#variable declaration\n",
    "L=float(6)                     #m\n",
    "w=float(60)                    #uniformly distributed load,KN/m\n",
    "Rs=L*w/2                       #Reaction at support,KN\n",
    "\n",
    "#Moment at 1.5 m from support\n",
    "M =float( Rs*1.5-(w*pow(1.5,2)/2))\n",
    "#Shear force at 1.5 m from support \n",
    "F=Rs-1.5*w\n",
    "\n",
    "B=float(200)                   #width of I-beam,mm\n",
    "H=float(400)                   #height or I-beam,mm\n",
    "b=float(190)\n",
    "h=float(380)\n",
    "I= (B*pow(H,3)/12)-(b*pow(h,3)/12)\n",
    "\n",
    "#Bending stress at 100 mm above N–A\n",
    "y=100\n",
    "\n",
    "f=M*1000000*y/I\n",
    "\n",
    "#Thus the state of stress on an element at y = 100 mm, as px = f,py=0\n",
    "px=-f\n",
    "py=0\n",
    "A=200*10*195+10*90*145\n",
    "q=(F*1000*(A))/(10*I)     #shearing stress,N/mm^2\n",
    "\n",
    "p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))\n",
    "p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))\n",
    "print \" p1=\",round(p1,2),\"N/mm^2\"\n",
    "print \" p2=\",round(p2,2),\"N/mm^2\"\n",
    "\n",
    "\n",
    "qmax=sqrt((pow((px-py)/2,2))+pow(q,2))\n",
    "\n",
    "print\"qmax=\",round(qmax,2),\"N/mm^2\"\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"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}