summaryrefslogtreecommitdiff
path: root/Strength_of_Materials_by_Dr.R.K.Bansal/chapter1.ipynb
blob: 1fc731a995ee588d86a43a823c595e774a8ed619 (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
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
{
 "metadata": {
  "name": "",
  "signature": "sha256:abce654f2dcdd836a8080165fb072744ef2446714ffd5c0acdbf346c961eccf3"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 1 :Simple Stresses and Strains"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 1.1,page no.9"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#Given\n",
      "#Variable declaration\n",
      "L=150           #Length of the rod in cm\n",
      "D=20            #Diameter of the rod in mm\n",
      "P=20*10**3      #Axial pull in N\n",
      "E=2.0e5         #Modulus of elasticity in N/sq.mm\n",
      "\n",
      "#Calculation\n",
      "A=(math.pi/4)*(D**2)    #Area in sq.mm\n",
      " #case (i):stress\n",
      "sigma=P/A               #Stress in N/sq.mm\n",
      " #case (ii):strain\n",
      "e=sigma/E               #Strain\n",
      " #case (iii):elongation of the rod\n",
      "dL=e*L                  #Elongation of the rod in cm\n",
      "\n",
      "#Result\n",
      "print \"Stress =\",round(sigma,3),\"N/mm^2\"\n",
      "print \"Strain =\",round(e,6)\n",
      "print \"Elongation =\",round(dL,4),\"cm\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Stress = 63.662 N/mm^2\n",
        "Strain = 0.000318\n",
        "Elongation = 0.0477 cm\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 1.2,page no.10"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Given\n",
      "#variable declaration\n",
      "P=4000         #Load in N\n",
      "sigma=95       #Stress in N/sq.mm\n",
      "\n",
      "#Calculation\n",
      "D=round(math.sqrt(P/((math.pi/4)*(sigma))),2)  #Diameter of steel wire in mm\n",
      "\n",
      "#Result\n",
      "print \"Diameter of a steel wire =\",D,\"mm\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Diameter of a steel wire = 7.32 mm\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 1.3,page no.10"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Given\n",
      "#Variable declaration\n",
      "D=25        #Diameter of brass rod in mm\n",
      "P=50*10**3  #Tensile load in N\n",
      "L=250       #Length of rod in mm\n",
      "dL=0.3      #Extension of rod in mm\n",
      "\n",
      "#Calculation\n",
      "A=(math.pi/4)*(D**2)    #Area of rod in sq.mm\n",
      "sigma=round(P/A,2)      #Stress in N/sq.mm\n",
      "e=dL/L                  #Strain\n",
      "E=(sigma/e)             #Young's Modulus in N/sq.m\n",
      "\n",
      "#Result\n",
      "print \"Young's Modulus of a rod,E =\",round(E*(10**-3),3),\"GN/m^2\"    #Young's Modulus in GN/sq.m\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Young's Modulus of a rod,E = 84.883 GN/m^2\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 1.4,page no.11"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Given\n",
      "#Variable Declaration\n",
      "D=3          #Diameter of the steel bar in cm    \n",
      "L=20         #Gauge length of the bar in cm\n",
      "P=250        #Load at elastic limit in kN \n",
      "dL=0.21      #Extension at a load of 150kN in mm\n",
      "Tot_ext=60   #Total extension in mm\n",
      "Df=2.25      #Diameter of the rod at the failure in cm\n",
      "\n",
      "#Calculation\n",
      "A=round((math.pi/4)*(D**2),5)    #Area of the rod in sq.m\n",
      "\n",
      "#case (i):Young's modulus\n",
      "e=round((150*1000)/(7.0685),1)   #stress in N/sq.m\n",
      "sigma=dL/(L*10)                  #strain \n",
      "E=round((e/sigma)*(10**-5),3)    #Young's modulus in GN/sq.m\n",
      "\n",
      "#case (ii):stress at elastic limit\n",
      "stress=int(round((P*1000)/A,0))*1e-2   #stress at elastic limit in MN/sq.m\n",
      "\n",
      "#case (iii):percentage elongation\n",
      "Pe=(Tot_ext*1e2)/(L*10)\n",
      "\n",
      "#case (iv):percentage decrease in area\n",
      "Pd=(D**2-Df**2)/D**2*1e2\n",
      "\n",
      "\n",
      "#Result\n",
      "print \"NOTE:The Young's Modulus found in the book is incorrect.The correct answer is,\"\n",
      "print \"Young's modulus,E =\",E,\"GN/m^2\"\n",
      "print \"Stress at the elastic limit,Stress =\",stress,\"MN/m^2\"\n",
      "print \"Percentage elongation = %d%%\"%Pe\n",
      "print \"Percentage decrease in area = %.2f%%\"%Pd\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "NOTE:The Young's Modulus found in the book is incorrect.The correct answer is,\n",
        "Young's modulus,E = 202.104 GN/m^2\n",
        "Stress at the elastic limit,Stress = 353.68 MN/m^2\n",
        "Percentage elongation = 30%\n",
        "Percentage decrease in area = 43.75%\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 1.5,page no.12"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Given\n",
      "#Variable declaration\n",
      "sigma=125*10**6    #Safe stress in N/sq.m\n",
      "P=2.1*10**6        #Axial load in N\n",
      "D=0.30             #External diameter in m\n",
      "\n",
      "#Calculation\n",
      "    \n",
      "d=round(math.sqrt((D**2)-P*4/(math.pi*sigma)),4)*1e2  #internal diameter in cm\n",
      "\n",
      "#Result\n",
      "print \"internal diameter =\",d,\"cm\"      \n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "internal diameter = 26.19 cm\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 1.6,page no.13"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Given\n",
      "#Variable declaration\n",
      "stress=480      #ultimate stress in N/sq.mm\n",
      "P=1.9*10**6     #Axial load in N\n",
      "D=200           #External diameter in mm\n",
      "f=4             #Factor of safety\n",
      "\n",
      "#Calculation\n",
      "sigma=stress/f                                        #Working stress or Permissable stress in N/sq.mm\n",
      "d=str(math.sqrt((D**2)-((P*4)/(math.pi*sigma))))[:6]  #internal diameter in mm\n",
      "\n",
      "#Result\n",
      "print \"internal diameter =\",d,\"mm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "internal diameter = 140.85 mm\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 1.15,page no.26"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Given\n",
      "#Variable declaration\n",
      "D1=40      #Larger diameter in mm\n",
      "D2=20      #Smaller diameter in mm\n",
      "L=400      #Length of rod in mm\n",
      "P=5000     #Axial load in N\n",
      "E=2.1e5    #Young's modulus in N/sq.mm\n",
      "\n",
      "#Calculation\n",
      "dL=float(str((4*P*L)/(math.pi*E*D1*D2))[:7])   #extension of rod in mm\n",
      "\n",
      "#Result\n",
      "print \"Extension of the rod =\",dL,\"mm\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Extension of the rod = 0.01515 mm\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 1.16,page no.27"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Given\n",
      "#Variable declaration\n",
      "D1=30          #Larger diameter in mm\n",
      "D2=15          #Smaller diameter in mm\n",
      "L=350          #Length of rod in mm\n",
      "P=5.5*10**3    #Axial load in N\n",
      "dL=0.025       #Extension in mm\n",
      "\n",
      "#Calculation\n",
      "E=int((4*P*L)/(math.pi*D1*D2*dL))   #Modulus of elasticity in N/sq.mm\n",
      "\n",
      "#Result\n",
      "print \"Modulus of elasticity,E = %.5e\"%E,\"N/mm^2\" "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Modulus of elasticity,E = 2.17865e+05 N/mm^2\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 1.17,page no.29"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Given\n",
      "#Variable declaration\n",
      "L=2.8*10**3      #Length in mm\n",
      "t=15             #Thickness in mm\n",
      "P=40*10**3       #Axial load in N\n",
      "a=75             #Width at bigger end in mm\n",
      "b=30             #Width at smaller end in mm\n",
      "E=2e5            #Young's Modulus in N/sq.mm\n",
      "\n",
      "#Calculation\n",
      "dL=round((round((P*L)/(E*t*(a-b)),4)*(round(math.log(a)-math.log(b),4))),2)    #extension of rod in mm\n",
      "\n",
      "#Result\n",
      "print \"Extension of the rod,dL =\",dL,\"mm\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Extension of the rod,dL = 0.76 mm\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 1.18,page no.29"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Given\n",
      "#Variable declaration\n",
      "dL=0.21          #Extension in mm\n",
      "L=400            #Length in mm\n",
      "t=10             #Thickness in mm\n",
      "a=100            #Width at bigger end in mm\n",
      "b=50             #Width at smaller end in mm\n",
      "E=2e5            #Young's Modulus in N/sq.mm\n",
      "\n",
      "#Calculation\n",
      "P=int(dL/(round((L)/(E*t*(a-b)),6)*(round(math.log(a)-math.log(b),4))))*1e-3    #Axial load in kN\n",
      "\n",
      "#Result\n",
      "print \"Axial load =\",P,\"kN\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Axial load = 75.746 kN\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 1.20,page no.32"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Given\n",
      "#Variable declaration\n",
      "Di_s=140     #Internal diameter of steel tube in mm \n",
      "De_s=160     #External diameter of steel tube in mm\n",
      "Di_b=160     #Internal diameter of brass tube in mm    \n",
      "De_b=180     #External diameter of brass tube in mm\n",
      "P=900e3      #Axial load in N\n",
      "L=140        #Length of each tube in mm\n",
      "Es=2e5       #Young's modulus for steel in N/sq.mm\n",
      "Eb=1e5       #Young's modulus for brass in N/sq.mm\n",
      "\n",
      "#Calculation\n",
      "As=round(math.pi/4*(De_s**2-Di_s**2),1)     #Area of steel tube in sq.mm\n",
      "Ab=round(math.pi/4*(De_b**2-Di_b**2),1)     #Area of brass tube in sq.mm\n",
      "sigmab=round(P/(2*As+Ab),2)                 #Stress in steel in N/sq.mm\n",
      "sigmas=2*sigmab                             #Stress in brass in N/sq.mm\n",
      "Pb=int(sigmab*Ab)*1e-3                      #Load carried by brass tube in kN\n",
      "Ps=(P*1e-3)-(Pb)                            #Load carried by steel tube in kN\n",
      "dL=round(sigmab/Eb*(L),4)                   #Decrease in length in mm\n",
      "\n",
      "#Result\n",
      "print \"Stress in brass =\",sigmab,\"N/mm^2\"\n",
      "print \"Stress in steel =\",sigmas,\"N/mm^2\"\n",
      "print \"Load carried by brass tube =\",Pb,\"kN\"\n",
      "print \"Load carried by stress tube =\",Ps,\"kN\"\n",
      "print \"Decrease in the length of the compound tube=\",dL,\"mm\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Stress in brass = 60.95 N/mm^2\n",
        "Stress in steel = 121.9 N/mm^2\n",
        "Load carried by brass tube = 325.515 kN\n",
        "Load carried by stress tube = 574.485 kN\n",
        "Decrease in the length of the compound tube= 0.0853 mm\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 1.28,page no.43"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "#Variable declaration\n",
      "L=2*10**2        #Length of rod in cm\n",
      "T1=10            #Initial temperature in degree celsius\n",
      "T2=80            #Final temperature in degree celsius\n",
      "E=1e5*10**6      #Young's Modulus in N/sq.m\n",
      "alpha=0.000012   #Co-efficient of linear expansion \n",
      "\n",
      "#Calculation\n",
      "T=T2-T1                          #Rise in temperature in degree celsius\n",
      "dL=alpha*T*L                     #Expansion of the rod in cm\n",
      "sigma=int((alpha*T*E)*1e-6)      #Thermal stress in N/sq.mm\n",
      "\n",
      "#Result\n",
      "print \"Expansion of the rod =\",dL,\"cm\"\n",
      "print \"Thermal stress =\",sigma,\"N/mm^2\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Expansion of the rod = 0.168 cm\n",
        "Thermal stress = 84 N/mm^2\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 1.29,page no.43"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Given\n",
      "#Variable declaration\n",
      "d=3*10           #Diameter of the rod in mm\n",
      "L=5*10**3        #Area of the rod in sq.mm\n",
      "T1=95            #Initial temperature in degree celsius\n",
      "T2=30            #Final temperature in degree celsius\n",
      "E=2e5*10**6      #Young's Modulus in N/sq.m\n",
      "alpha=12e-6      #Co-efficient of linear expansion in per degree celsius\n",
      "\n",
      "#Calculation\n",
      "A=math.pi/4*(d**2)        #Area of the rod\n",
      "T=T1-T2                   #Fall in temperature in degree celsius\n",
      "\n",
      "#case(i) When the ends do not yield \n",
      "stress1=int(alpha*T*E*1e-6)     #Stress in N/sq.mm\n",
      "Pull1=round(stress1*A,1)        #Pull in the rod in N\n",
      "\n",
      "#case(ii) When the ends yield by 0.12cm\n",
      "delL=0.12*10\n",
      "stress2=int((alpha*T*L-delL)*E/L*1e-6)      #Stress in N/sq.mm\n",
      "Pull2=round(stress2*A,1)                    #Pull in the rod in N\n",
      "\n",
      "#Result\n",
      "print \"Stress when the ends do not yield =\",stress1,\"N/mm^2\"\n",
      "print \"Pull in the rod when the ends do not yield =\",Pull1,\"N\"\n",
      "print \"Stress when the ends yield =\",stress2,\"N/mm^2\"\n",
      "print \"Pull in the rod when the ends yield =\",Pull2,\"N\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Stress when the ends do not yield = 156 N/mm^2\n",
        "Pull in the rod when the ends do not yield = 110269.9 N\n",
        "Stress when the ends yield = 108 N/mm^2\n",
        "Pull in the rod when the ends yield = 76340.7 N\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 1.30,page no.45"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "#Given\n",
      "#Variable declaration\n",
      "Ds=20               #Diameter of steel rod in mm\n",
      "Di_c=40             #Internal diameter of copper tube in mm\n",
      "De_c=50             #External diameter of copper tube in mm\n",
      "Es=200*10**3        #Young's modulus of steel in N/sq.mm\n",
      "Ec=100*10**3        #Young's modulus of copper in N/sq.mm\n",
      "alpha_s=12e-6       #Co-efficient of linear expansion of steel in per degree celsius\n",
      "alpha_c=18e-6       #Co-efficient of linear expansion of copper in per degree celsius\n",
      "T=50                #Rise of temperature in degree celsius\n",
      "\n",
      "#Calculation\n",
      "As=(math.pi/4)*(Ds**2)                                             #Area of steel rod in sq.mm\n",
      "Ac=(math.pi/4)*(De_c**2-Di_c**2)                                   #Area of copper tube in sq.mm\n",
      "sigmac=float(str(((alpha_c-alpha_s)*T)/(((Ac/As)/Es)+(1/Ec)))[:6]) #Compressive stress in copper  \n",
      "sigmas=round(sigmac*(Ac/As),2)                                     #Tensile stress in steel \n",
      "\n",
      "#Result\n",
      "print \"Stress in copper =\",sigmac,\"N/mm^2\"\n",
      "print \"Stress in steel =\",sigmas,\"N/mm^2\"\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Stress in copper = 14.117 N/mm^2\n",
        "Stress in steel = 31.76 N/mm^2\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 1.31,page no.47"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Given\n",
      "#Variable declaration\n",
      "Dc=15             #Diameter of copper rod in mm\n",
      "Di_s=20           #Internal diameter of steel in mm\n",
      "De_s=30           #External diameter of steel in mm\n",
      "T1=10             #Initial temperature in degree celsius\n",
      "T2=200            #Raised temperature in degree celsius\n",
      "Es=2.1e5          #Young's modulus of steel in N/sq.mm\n",
      "Ec=1e5            #Young's modulus of copper in N/sq.mm\n",
      "alpha_s=11e-6     #Co-efficient of linear expansion of steel in per degree celsius\n",
      "alpha_c=18e-6     #Co-efficient of linear expansion of copper in per degree celsius\n",
      "\n",
      "#Calculation\n",
      "Ac=(math.pi/4)*Dc**2                #Area of copper tube in sq.mm\n",
      "As=(math.pi/4)*(De_s**2-Di_s**2)    #Area of steel rod in sq.mm\n",
      "T=T2-T1                             #Rise of temperature in degree celsius\n",
      "sigmas=round(((alpha_c-alpha_s)*T)/((round(As/Ac,2)/Ec)+(1/Es)),3)\n",
      "sigmac=round(sigmas*round(As/Ac,2),2)\n",
      "\n",
      "#Result\n",
      "print \"NOTE: The answers in the book for stresses are wrong.The correct answers are,\"\n",
      "print \"Stress in steel =\",sigmas,\"N/mm^2\"\n",
      "print \"Stress in copper =\",sigmac,\"N/mm^2\"\n",
      "\n",
      "\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "NOTE: The answers in the book for stresses are wrong.The correct answers are,\n",
        "Stress in steel = 49.329 N/mm^2\n",
        "Stress in copper = 109.51 N/mm^2\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 1.32,page no.48"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#Given\n",
      "#Variable declaration\n",
      "Dg=20           #Diameter of gun metal rod in mm\n",
      "Di_s=25         #Internal diameter of steel in mm\n",
      "De_s=30         #External diameter of steel in mm\n",
      "T1=30           #Temperature in degree celsius\n",
      "T2=140          #Temperature in degree celsius\n",
      "Es=2.1e5        #Young's modulus of steel in N/sq.mm\n",
      "Eg=1e5          #Young's modulus of gun metal in N/sq.mm\n",
      "alpha_s=12e-6   #Co-efficient of linear expansion of steel in per degree celsius\n",
      "alpha_g=20e-6   #Co-efficient of linear expansion of gun metal in per degree celsius\n",
      "\n",
      "#Calculation\n",
      "Ag=(math.pi/4)*Dg**2              #Area of gun metal in sq.mm\n",
      "As=(math.pi/4)*(De_s**2-Di_s**2)  #Area of steel in sq.mm\n",
      "T=T2-T1                           #Fall in temperature in degree celsius\n",
      "sigmag=round(((alpha_g-alpha_s)*T)/(((Ag/As)/Es)+(1/Eg)),2)\n",
      "sigmas=round(sigmag*(Ag/As),2)\n",
      "\n",
      "#Result\n",
      "print \"Stress in gun metal rod =\",sigmag,\"N/mm^2\"\n",
      "print \"Stress in steel =\",sigmas,\"N/mm^2\"\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Stress in gun metal rod = 51.99 N/mm^2\n",
        "Stress in steel = 75.62 N/mm^2\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 1.33,page no.52"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Given\n",
      "#Variable declaration\n",
      "P=600e3         #Axial load in N\n",
      "L=20e3          #Length in mm\n",
      "w=0.00008       #Weight per unit volume in N/sq.mm\n",
      "A2=400          #Area of bar at lower end in sq.mm\n",
      "\n",
      "#Calculation\n",
      "sigma=int(P/A2)           #Uniform stress on the bar in N/sq.mm\n",
      "A1=round(A2*round(math.exp(round(w*L/sigma,7)),5),3)\n",
      "\n",
      "#Result\n",
      "print \"Area of the bar at the upper end =\",A1,\"mm^2\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Area of the bar at the upper end = 400.428 mm^2\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}