summaryrefslogtreecommitdiff
path: root/MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter8_Q79Sp1O.ipynb
blob: 1204506adfea62a36a6d885470f187c97c267734 (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
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter8-SIMPLE STRESSES AND STRAINS"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example8.1 Page number243"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "sectional area= 201.06 mm^2\n",
      "stress= 198.94 N/mm^2\n",
      "strain= 0.000994718394324 N/mm^2\n",
      "Elongation= 0.497 mm\n"
     ]
    }
   ],
   "source": [
    "from math import pi\n",
    "\n",
    "#variable declaration\n",
    "\n",
    "P=float(40000)               #Load,N\n",
    "E=float(200000)              #Modulus of elasticity for steel,N/mm^2\n",
    "L=500              #length of circular rod,mm\n",
    "d=float(16)               #diameter of rod,mm\n",
    " \n",
    "A=(pi*(pow(d,2)))/4   #sectional area, mm^2\n",
    "p=P/A                 #stress, N/mm^2\n",
    "e=p/E                 #strain\n",
    "delta=(P*L)/(A*E)     #Elongation,mm\n",
    "\n",
    "print \"sectional area=\",round(A,2),\"mm^2\"\n",
    "print \"stress=\",round(p,2),\"N/mm^2\"\n",
    "print \"strain=\",e,\"N/mm^2\"\n",
    "print \"Elongation=\",round(delta,3),\"mm\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example8.2 Page number243"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "area= 11.25 mm^2\n",
      "Elongation= 1.6 mm\n",
      "Hence, if measured length is 30.0 m.\n",
      "Actual length is 30.0016 m\n",
      "Actual length of line AB= 150.008 m.\n"
     ]
    }
   ],
   "source": [
    "#variable declaration\n",
    "\n",
    "P=float(120)              # force applied during measurement,N\n",
    "E=float(200000)           #Modulus of elasticity for steel,N/mm^2\n",
    "L=float(30)            #length of  Surveyor’s steel tape,mm\n",
    "              \n",
    " \n",
    "A=15*0.75             #area, mm^2\n",
    "delta=((P*L*1000)/(A*E))     #Elongation,mm\n",
    "\n",
    "print \"area=\",round(A,2),\"mm^2\"\n",
    "print \"Elongation=\",round(delta,3),\"mm\"\n",
    "\n",
    "print \"Hence, if measured length is\", L,\"m.\"\n",
    "print \"Actual length is\" ,round((L+(delta/1000)),6),\"m\"\n",
    "\n",
    "print \"Actual length of line AB=\",round((150*(L+(delta/1000))/30),3),\"m.\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 8.3 Page number 244\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Therefore, permissible stress\n",
      "p= 142.857 N/mm^2\n",
      "Load P= 160000.0 N\n",
      "A= 1120.0 mm^2\n",
      "d= 94.32 mm\n",
      "t= 3.64 mm\n",
      "Hence, use of light section is recommended.\n"
     ]
    }
   ],
   "source": [
    "from math import pi,sqrt\n",
    "\n",
    "#variable declaration\n",
    "\n",
    "Y=float(250)                 #Yield stress, N/mm^2\n",
    "FOS=float(1.75)              #Factor of safety\n",
    "P=float(160)                 #Load,KN\n",
    "\n",
    "p=Y/FOS\n",
    "\n",
    "print \"Therefore, permissible stress\"\n",
    "print \"p=\",round(p,3), \"N/mm^2\"\n",
    "print \"Load P=\",P*1000,\"N\"\n",
    "\n",
    "#p=P/A\n",
    "\n",
    "A=P*1000/p           #area,mm^2\n",
    "\n",
    "print \"A=\",round(A),\"mm^2\"\n",
    "\n",
    "#For hollow section of outer diameter ‘D’ and inner diameter ‘d’ A=pi*(D^2-d^2)/4\n",
    "D=float(101.6)        #outer diameter,mm\n",
    "\n",
    "d=sqrt(pow(D,2)-(4*A/pi))\n",
    "\n",
    "print \"d=\",round(d,2),\"mm\"\n",
    "\n",
    "t=(D-d)/2\n",
    "print \"t=\",round(t,2),\"mm\"\n",
    "\n",
    "print \"Hence, use of light section is recommended.\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 8.4 page number 245"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Area= 314.16 mm^2\n",
      "Stress at elastic limit= 324.68 N/mm^2\n",
      "Young's modulus E= 12732.4 N/mm^22\n",
      "Percentage elongation= 28.0 %\n",
      "Percentage reduction in area= 43.75 %\n",
      "Ultimate Tensile Stress= 0.41 N/mm^2\n"
     ]
    }
   ],
   "source": [
    "from math import pi\n",
    "\n",
    "#variable declaration \n",
    "\n",
    "d=float(20)                                       #Diameter ,mm\n",
    "Loadatelasticlimit=float(102)                  #Load at elastic limit,KN\n",
    "P=80                                              #Load for extension of o.25mm , KN\n",
    "delta=float(0.25)                                 #extension in specimen of steel,mm\n",
    "L=200                                             #gauge length of specimen of steel,mm\n",
    "Finalextension=float(56)                         #total extension at fracture,mm\n",
    "\n",
    "\n",
    "A=(pi*pow(d,2))/4                                 #Area,mm^2\n",
    "print \"Area=\", round(A,2),\"mm^2\"\n",
    "\n",
    "Stressatelasticlimit=Loadatelasticlimit*1000/A    #Stress at elastic limit,N/mm^2 \n",
    "print \"Stress at elastic limit=\",round(Stressatelasticlimit,2),\"N/mm^2\"\n",
    "\n",
    "E=(P*1000/A)*(delta*L)                            #Young’s modulus ,N/mm^2\n",
    "print \"Young's modulus E=\", round(E,2),\"N/mm^22\"\n",
    "\n",
    "Percentageelongation=Finalextension*100/L       #percentage elongation,%\n",
    "print \"Percentage elongation=\", round(Percentageelongation,2),\"%\"\n",
    "\n",
    "Initialarea=(pi*pow(d,2))/4\n",
    "Finalarea=(pi*pow(15,2))/4                     # total extension at fracture is 56 mm and diameter at neck is 15 mm.\n",
    "Percentagereductioninarea=(Initialarea-Finalarea)*100/Initialarea\n",
    "\n",
    "print \"Percentage reduction in area=\",round(Percentagereductioninarea,2),\"%\"\n",
    "\n",
    "UltimateLoad=130                               #Maximum Load=130,kN\n",
    "UltimateTensileStress=UltimateLoad/A\n",
    "\n",
    "print\"Ultimate Tensile Stress=\",round(UltimateTensileStress,2),\"N/mm^2\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example8.5 Page number247\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "E= 56277.19 N/mm^2\n"
     ]
    }
   ],
   "source": [
    "from math import pi\n",
    "\n",
    "#variable declaration\n",
    "\n",
    "P=float(40)                     #Load,KN\n",
    "L1=150                          #length of 1st portion,mm\n",
    "A1=pi*pow(25,2)/4               #Area of 1st portion,mm^2\n",
    "L2=250                          #length of 2nd portion,mm\n",
    "A2=pi*pow(20,2)/4               #Area of 2nd portion,mm^2\n",
    "L3=150                          #length of 3rd portion,mm\n",
    "A3=pi*pow(25,2)/4               #Area of 3rd portion,mm^2\n",
    "\n",
    "#E,Young's modulus ,N/mm^2\n",
    "\n",
    "#Total extension= Extension of portion 1+Extension of portion 2+Extension of portion 3\n",
    "\n",
    "#Extension=(P*1000*L)/(A*E)\n",
    "\n",
    "E=(P*1000*L1/A1)+(P*1000*L2/A2)+(P*1000*L3/A3)\n",
    "\n",
    "print \"E=\",round(E,2),\"N/mm^2\"\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example8.6 Page number247"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Total extension of the bar= 0.5125 mm\n"
     ]
    }
   ],
   "source": [
    "from math import pi\n",
    "\n",
    "#variable declaration\n",
    "\n",
    "P=float(30)                     #Load,KN\n",
    "L1=600                          #length of 1st portion,mm\n",
    "A1=40*20                        #Area of 1st portion,mm^2\n",
    "\n",
    "E1=200000          # material 1  Young’s modulus,N/mm^2\n",
    "  \n",
    "E2=100000          # material 2  Young’s modulus,N/mm^2\n",
    " \n",
    "\n",
    "L2=800                          #length of 2nd portion,mm\n",
    "A2=30*20                        #Area of 2nd portion,mm^2\n",
    "\n",
    "Extensionofportion1=(P*1000*L1)/(A1*E1)  #mm\n",
    "Extensionofportion2=(P*1000*L2)/(A2*E2)  #mm\n",
    "\n",
    "Totalextensionofthebar= Extensionofportion1 + Extensionofportion2\n",
    "\n",
    "print\"Total extension of the bar=\",round(Totalextensionofthebar,4),\"mm\"\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example8.7 Page number248\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "E= 200735.96 N/mm^2\n"
     ]
    }
   ],
   "source": [
    "from math import pi\n",
    "\n",
    "#variable declaration\n",
    "\n",
    "P=float(30)                                 #Load,KN\n",
    "L1=600                                      #length of 1st portion,mm\n",
    "A1=pi*pow(30,2)/4                           #Area of 1st portion,mm^2\n",
    "L2=400                                      #length of 2nd portion,mm\n",
    "A2=pi*(pow(30,2)-pow(10,2))/4               #Area of 2nd portion,mm^2\n",
    "\n",
    "#E,Young's modulus ,N/mm^2\n",
    "\n",
    "#Total extension= Extension of portion 1+Extension of portion 2\n",
    "\n",
    "#Extension=(P*1000*L)/(A*E)\n",
    "\n",
    "T=float(0.222)                              #Total extension of the bar,mm\n",
    "\n",
    "E=((P*1000*L1/A1)+(P*1000*L2/A2))/T \n",
    "\n",
    "print \"E=\",round(E,2),\"N/mm^2\"\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 8.10 Page number 251"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "delta1= 0.2113 mm\n",
      "there is calculation mistake in book\n",
      "delta2= 0.48 mm^2\n",
      "Percentage error= 55.977 %\n",
      "there is calculation mistake in book\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "#variable declaration\n",
    "\n",
    "t=10                    #steel flat thickness,mm\n",
    "b1=float(60)                   #tapering from b1 to b2\n",
    "b2=40\n",
    "L=600                   #steel flat length\n",
    "P=float(80)                    #Load,KN\n",
    "E=2*100000              #Young's Modulus,N/mm^2\n",
    "\n",
    "#Extension of the tapering bar of rectangular section\n",
    "\n",
    "delta1=(P*1000*L*math.log((b1/b2),10))/(t*E*(b1-b2))\n",
    "\n",
    "print \"delta1=\",round(delta1,4),\"mm\"\n",
    "print \"there is calculation mistake in book\"\n",
    "\n",
    "#If averages cross-section is considered instead of tapering cross-section, extension is given by \n",
    "\n",
    "Aav=(b1+b2)*t/2                    #mm^2\n",
    "\n",
    "delta2=(P*1000*L)/(Aav*E)                #mm\n",
    "print\"delta2=\",round(delta2,3),\"mm^2\"\n",
    "\n",
    "P= (delta2-delta1)*100/delta2\n",
    "\n",
    "print\"Percentage error=\",round(P,3),\"%\"\n",
    "\n",
    "print \"there is calculation mistake in book\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example8.11 page number251"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "delta1= 1.194 mm\n",
      "delta2= 0.265 mm\n",
      "Total extension 1.459 mm\n"
     ]
    }
   ],
   "source": [
    "from math import pi\n",
    "\n",
    "#variable declaration\n",
    "\n",
    "P=float(200)                     #loading,KN\n",
    "E=200*1000\n",
    "d1=40                #Young's modulus,N/mm^2\n",
    "A= pi*pow(d1,2)/4         #Area of uniform portion,mm^2 \n",
    "L1=1500                    #length of uniform portion,mm \n",
    "d2=60                      #diameter of tapered section,mm\n",
    "L2=500                     #length of tapered section,mm\n",
    "#Extensions of uniform portion and tapering portion are worked out separately and then added to get extension of the given bar. \n",
    "\n",
    "#Extension of uniform portion\n",
    "\n",
    "delta1=(P*1000*L1)/(A*E)\n",
    "\n",
    "print \"delta1=\",round(delta1,3),\"mm\"\n",
    "\n",
    "delta2=(P*1000*4*L2)/(E*pi*d1*d2)\n",
    "\n",
    "print \"delta2=\",round(delta2,3),\"mm\"\n",
    "\n",
    "T=delta1 + delta2 \n",
    "print \"Total extension\",round(T,3),\"mm\"\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 8.13 page number259"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Poisson's ratio= 0.3\n",
      "E= 203718.33 N/mm^2\n",
      "G= 78353.2 N/mm^2\n",
      "K= 169765.27 N/mm^2\n"
     ]
    }
   ],
   "source": [
    "from math import pi\n",
    "\n",
    "#variable declaration\n",
    "\n",
    "P=float(60)               #load,KN\n",
    "d=float(25)               #diameter,mm\n",
    "A=pi*pow(d,2)/4    #Area,mm^2\n",
    "L=float(200)              #gauge length,mm\n",
    "\n",
    "delta=0.12         #extension,mm\n",
    "deltad=0.0045      #contraction in diameter,mm\n",
    "Linearstrain=delta/L\n",
    "Lateralstrain=deltad/d\n",
    "\n",
    "Pr=Lateralstrain/Linearstrain\n",
    "\n",
    "print \"Poisson's ratio=\",round(Pr,1)\n",
    "\n",
    "E=(P*1000*L)/(A*delta)\n",
    "\n",
    "print \"E=\",round(E,2),\"N/mm^2\"\n",
    "\n",
    "G=E/(2*(1+Pr))                      #Rigidity modulus\n",
    "\n",
    "print \"G=\",round(G,1),\"N/mm^2\"\n",
    "\n",
    "K=E/(3*(1-(2*Pr)))                 #bulk modulus\n",
    "\n",
    "print \"K=\",round(K,2),\"N/mm^2\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 8.14 page number 260"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "G= 76923.1 N/mm^2\n",
      "K= 166666.67 N/mm^2\n",
      "change in volume 60.0 mm^3\n"
     ]
    }
   ],
   "source": [
    "from math import pi\n",
    "\n",
    "#variable declaration\n",
    "\n",
    "E=float(2*100000)               #Young's modulus,N/mm^2\n",
    "Pr=float(0.3)                   #poisson's ratio\n",
    "\n",
    "G=E/(2*(1+Pr))           #Rigidity modulus\n",
    "\n",
    "K=E/(3*(1-2*(Pr)))        #Bulk modulus\n",
    "\n",
    "print \"G=\", round(G,1),\"N/mm^2\"\n",
    "\n",
    "print \"K=\", round(K,2), \"N/mm^2\"\n",
    "\n",
    "P=60                           #Load,kN\n",
    "A=pi*pow(25,2)/4               #Area,mm^2\n",
    "\n",
    "Stress=P*1000/A                     #N/mm^2\n",
    "#Linear strain,ex\n",
    "\n",
    "ex=Stress/E\n",
    " \n",
    "#Lateralstrain,ey,ez\n",
    "\n",
    "ey=-1*Pr*ex\n",
    "ez=-1*Pr*ex\n",
    "\n",
    "#volumetric strain,ev=ex+ey+ez\n",
    "\n",
    "ev=ex+ey+ez\n",
    "\n",
    "v=pi*pow(25,2)*500/4\n",
    "Changeinvolume=ev*v\n",
    "\n",
    "print\"change in volume\",round(Changeinvolume,2),\"mm^3\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 8.15 page number261"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Change in volume= 10.8 mm^3\n"
     ]
    }
   ],
   "source": [
    "#variable declaration\n",
    "# Let the x, y, z be the mutually perpendicular directions\n",
    "\n",
    "pr=float(0.3)\n",
    "PX=float(15)                        #Loading in x-direction,KN\n",
    "PY=float(80)                        #Loading in Y-direction(compressive),KN\n",
    "PZ=float(180)                       #Loading in Z-direction,KN\n",
    "\n",
    "#Area in X-,Y-,Z-Direction is AX,AY,AZ respectively,mm^2\n",
    "\n",
    "AX=float(10*30)\n",
    "AY=float(10*400)\n",
    "AZ=float(30*400)\n",
    "\n",
    "#stress devoloped in X-,Y-,Z- direction as px,py,pz respectively,N/mm^2\n",
    "\n",
    "px=PX*1000/AX\n",
    "py=PY*1000/AY\n",
    "pz=PZ*1000/AZ\n",
    "\n",
    "#Noting that a stress produces a strain of p/E in its own direction, the nature being same as that of stress and µ p E in lateral direction of opposite nature, and taking tensile stress as +ve, we can write expression for strains ex, ey, ez.\n",
    "E=2*100000                       #young's modulus,N/mm^2\n",
    "\n",
    "ex=(px/E)+(pr*py/E)-(pr*pz/E)\n",
    "ey=(-pr*px/E)-(py/E)-(pr*pz/E)\n",
    "ez=(-pr*px/E)+(pr*py/E)+(pz/E)\n",
    "\n",
    "ev=ex+ey+ez                 #Volumetric strain\n",
    "\n",
    "volume=10*30*400\n",
    "\n",
    "Changeinvolume=ev*volume\n",
    "\n",
    "print \"Change in volume=\",round(Changeinvolume,2),\"mm^3\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 8.17 page number 263"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "poisson's Ratio= 0.346\n",
      "Bulk modulus= 227500.0 N/mm^2\n"
     ]
    }
   ],
   "source": [
    "#variable declaration\n",
    "\n",
    "E=float(2.1*100000)         #Young’s modulus of the material,N/mm^2\n",
    "G=float(0.78*100000)        #modulus of rigidity,N/mm^2\n",
    "\n",
    "pr=(E/(2*G))-1\n",
    "\n",
    "print \"poisson's Ratio=\",round(pr,3)\n",
    "\n",
    "K=E/(3*(1-2*pr))\n",
    "\n",
    "print \"Bulk modulus=\",round(K,3),\"N/mm^2\" "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 8.18 page number 263"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Young's modulus= 102857.143 N\n",
      "Poisson's Ratio 0.2857\n"
     ]
    }
   ],
   "source": [
    "#variable declaration\n",
    "\n",
    "G=float(0.4*100000)      #modulus of rigidity of material,N/mm^2\n",
    "K=float(0.8*100000)      #bulk modulus,N/mm^2\n",
    "\n",
    "E=(9*G*K)/(3*K+G)\n",
    "\n",
    "\n",
    "print \"Young's modulus=\",round(E,3),\"N\"\n",
    "\n",
    "pr=(E/(2*G))-1\n",
    "\n",
    "print \"Poisson's Ratio\",round(pr,4)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 8.19 page number 264"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Stress in aluminium strip= 23.08 N/mm^2\n",
      "Stress in steel strip= 46.15 N/mm^2\n",
      "Extension of the compound bar= 0.138 mm\n"
     ]
    }
   ],
   "source": [
    "#variable declaration\n",
    "\n",
    "L=float(600)                   #compound bar of length,mm\n",
    "P=float(60)                    #compound bar when axial tensile force ,KN\n",
    "\n",
    "Aa=float(40*20)                #area of aluminium strip,mm^2\n",
    "As=float(60*15)                #area of steel strip,mm^2\n",
    "\n",
    "Ea=1*100000             # elastic modulus of aluminium,N/mm^2\n",
    "Es=2*100000             # elastic modulus of steel,N/mm^2\n",
    "\n",
    "#load shared by aluminium strip be Pa and that shared by steel be Ps. Then from equilibrium condition Pa+Ps=P\n",
    "#From compatibility condition, deltaAL=deltaS\n",
    "Pa=(P*1000)/(1+((As*Es)/(Aa*Ea)))\n",
    "Ps=Pa*((As*Es)/(Aa*Ea))\n",
    "\n",
    "Sias=Pa/Aa\n",
    "print \"Stress in aluminium strip=\",round(Sias,2),\"N/mm^2\"\n",
    "Siss=Ps/As\n",
    "print \"Stress in steel strip=\",round(Siss,2),\"N/mm^2\"\n",
    "\n",
    "L=600\n",
    "#Extension of the compound bar \n",
    "deltal=(Pa*L)/(Aa*Ea)\n",
    "print\"Extension of the compound bar=\",round(deltal,3),\"mm\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 8.20 page number 265"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "stress in Copper= 75.76 N/mm^2\n",
      "stress in Steel= 126.27 N/mm^2\n"
     ]
    }
   ],
   "source": [
    "from math import pi\n",
    "\n",
    "#variable declaration\n",
    "\n",
    "Es=float(2*100000)              #Young's modulus of steel rod ,N/mm^2\n",
    "Ec=float(1.2*100000)            #Young's modulus of copper tube,N/mm^2\n",
    "\n",
    "di=float(25)                           #internal diameter,mm\n",
    "de=float(40)                           #external diameter,mm\n",
    "\n",
    "As=pi*pow(di,2)/4               #Area of steel rod,mm^2\n",
    "Ac=pi*(pow(de,2)-pow(di,2))/4   #Area of copper tube,mm^2\n",
    "P=120                           #load, KN\n",
    "#From equation of equilibrium, Ps+Pc=P,where Ps is the load shared by steel rod and Pc is the load shared by the copper tube.\n",
    "#From compatibility condition,deltaS=deltaC\n",
    "\n",
    "Pc=(P*1000)/(1+((As*Es)/(Ac*Ec)))\n",
    "Ps=Pc*((As*Es)/(Ac*Ec))\n",
    "\n",
    "SIC=Pc/Ac            #stress in copper, N/mm^2\n",
    "SIS=Ps/As            #stress in steel,N/mm^2\n",
    "\n",
    "print \"stress in Copper=\",round(SIC,2),\"N/mm^2\"\n",
    "print \"stress in Steel=\",round(SIS,2),\"N/mm^2\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 8.21 page number 266"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "stress in Concrete= 4.51 N/mm^2\n",
      "stress in Steel= 81.2 N/mm^2\n"
     ]
    }
   ],
   "source": [
    "from math import pi\n",
    "\n",
    "#variable declaration\n",
    "#Es/Ec=18(given)\n",
    "Er=float(18)                #young modulus ratio Er=Es/Ec\n",
    "d=float(16)                           #steel bar diameter,mm\n",
    "#8 steel bars\n",
    "As=8*pi*pow(d,2)/4               #Area of steel bar,mm^2\n",
    "Ac=(300*500)-As                      #Area of concrete,mm^2\n",
    "\n",
    "P=800                           #Compressive force, KN\n",
    "#From equation of equilibrium, Ps+Pc=P,where Ps is the load shared by steel bar and Pc is the load shared by the Concrete\n",
    "#From compatibility condition,deltaS=deltaC\n",
    "\n",
    "Pc=(P*1000)/(1+((As*Er)/(Ac)))\n",
    "Ps=Pc*((As*Er)/(Ac))\n",
    "\n",
    "SIC=Pc/Ac            #stress in Concrete, N/mm^2\n",
    "SIS=Ps/As            #stress in steel,N/mm^2\n",
    "\n",
    "print \"stress in Concrete=\",round(SIC,2),\"N/mm^2\"\n",
    "print \"stress in Steel=\",round(SIS,2),\"N/mm^2\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 8.22 page number 267"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "stress in Aluminium= 66.96 N/mm^2\n",
      "stress in Steel= 89.29 N/mm^2\n"
     ]
    }
   ],
   "source": [
    "#variable declaration\n",
    "\n",
    "Es=float(2*100000)              #Young's modulus of steel  ,N/mm^2\n",
    "Ea=float(1*100000)            #Young's modulus of aluminium,N/mm^2\n",
    "Ls=240                        #length of steel,mm\n",
    "La=160                        #length of aluminium,mm\n",
    "Aa=1200               #Area of aluminium,mm^2\n",
    "As=1000               #Area of steel,mm^2\n",
    "P=250                           #load, KN\n",
    "#From equation of equilibrium, Ps+2Pa=P,et force shared by each aluminium pillar be Pa and that shared by steel pillar be Ps. \n",
    "#From compatibility condition,deltaS=deltaC\n",
    "\n",
    "Pa=(P*1000)/(2+((As*Es*La)/(Aa*Ea*Ls)))\n",
    "Ps=Pa*((As*Es*La)/(Aa*Ea*Ls))\n",
    "\n",
    "SIA=Pa/Aa            #stress in aluminium, N/mm^2\n",
    "SIS=Ps/As            #stress in steel,N/mm^2\n",
    "\n",
    "print \"stress in Aluminium=\",round(SIA,2),\"N/mm^2\"\n",
    "print \"stress in Steel=\",round(SIS,2),\"N/mm^2\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 8.23 page number 268\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "ps= 91.73 N/mm^2\n",
      "pc= 44.96 N/mm^2\n"
     ]
    }
   ],
   "source": [
    "from math import pi\n",
    "\n",
    "#variable declaration\n",
    "\n",
    "# Let the force shared by bolt be Ps and that by tube be Pc. Since there is no external force, static equilibrium condition gives Ps + Pc = 0 or Ps = – Pc i.e., the two forces are equal in magnitude but opposite in nature. Obviously bolt is in tension and tube is in compression.\n",
    "#Let the magnitude of force be P. Due to quarter turn of the nut\n",
    "\n",
    "#[Note. Pitch means advancement of nut in one full turn] \n",
    "\n",
    "Ls=float(600)                      #length of whole assembly,mm\n",
    "Lc=float(600)                      #length of whole assembly,mm\n",
    "delta=float(0.5)\n",
    "ds=float(20)                       #diameter,mm\n",
    "di=float(28)                       #internal diameter,mm\n",
    "de=float(40)                       #external diameter,mm\n",
    "Es=float(2*100000)                 #Young's modulus, N/mm^2\n",
    "Ec=float(1.2*100000)\n",
    "As=pi*pow(ds,2)/4                  #area of steel bolt,mm^2\n",
    "Ac=pi*(pow(de,2)-pow(di,2))/4      #area of copper tube,mm^2\n",
    "\n",
    "P= (delta*(1/Ls))/((1/(As*Es))+(1/(Ac*Ec))) #Load,N\n",
    "\n",
    "ps=P/As                          #stress,N/mm^2\n",
    "pc=P/Ac                          #copper,N/mm^2\n",
    "\n",
    "print \"ps=\",round(ps,2),\"N/mm^2\"\n",
    "print \"pc=\",round(pc,2),\"N/mm^2\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 8.24 page number 271"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(a) p= 52.8 \tN/mm^2\n",
      "(b) p= 27.8 \tN/mm^2\n",
      " (iii) delta= 1.968 mm\n"
     ]
    }
   ],
   "source": [
    "#variable declaration\n",
    "E=float(2*100000)               #Young's modulus,N/mm^2\n",
    "alpha=float(0.000012)       #expansion coeffecient,/°c\n",
    "L=float(12)                     #length,m\n",
    "t=float(40-18)                  #temperature difference,°c\n",
    "\n",
    "delta=alpha*t*L*1000          #free expansion of the rails,mm    \n",
    "# Provide a minimum gap of 3.168 mm between the rails, so that temperature stresses do not develop\n",
    "       \n",
    "# a) If no expansion joint is provided, free expansion prevented is equal to 3.168 mm.\n",
    "\n",
    "#delta=(P*L)/(A*E) & p=P/A where p is stress, P,A is load,area \n",
    "\n",
    "p1=(delta*E)/(L*1000)     #stress developed , N/mm^2\n",
    "\n",
    "print \"(a) p=\", round(p1,1),\"\tN/mm^2\"\n",
    "\n",
    "#(b) If a gap of 1.5 mm is provided, free expansion prevented delta2 = 3.168 – 1.5 = 1.668 mm.\n",
    "\n",
    "delta2=1.668       #mm\n",
    "#delta2=(P*L)/(A*E) & p=P/A where p is stress, P,A is load,area \n",
    "\n",
    "p2=(delta2*E)/(L*1000)     #stress developed , N/mm^2\n",
    "\n",
    "print \"(b) p=\", round(p2,1),\"\tN/mm^2\"\n",
    "\n",
    "# If the stress developed is 20 N/mm2, then p = P/ A\n",
    "p3=20                      #stress developed,N/mm^2\n",
    "delta3=delta-(p3*L*1000/E)\n",
    "\n",
    "print \" (iii) delta=\",round(delta3,3),\"mm\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 8.25 page number 272\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "stress p= 360.0 N/mm^2\n"
     ]
    }
   ],
   "source": [
    "from math import pi\n",
    "\n",
    "#variable declaration\n",
    "\n",
    "# Let D be the diameter of ring after heating and ‘d’ be its diameter before heating\n",
    "D=float(1.2*1000)                #mm\n",
    "\n",
    "#Circumference of ring after heating Ca= pi*D & Circumference of ring before heating Cb= pi*d\n",
    "\n",
    "Ca=pi*D\n",
    "Cb=pi*d\n",
    "alphas=float(0.000012)            #coefficient of expansion,/°C\n",
    "t=150                             #temperature change,°C\n",
    "Es=2*100000                        #young's modulus,N/mm^2\n",
    "d=(Ca-Cb)/(alphas*t*pi)\n",
    "\n",
    "#when it cools expansion prevented\n",
    "#delta=pi*(D-d)\n",
    "delta=alphas*t*pi*d\n",
    "\n",
    "p=(delta*Es)/(pi*d)              #stress,N/mm^2\n",
    "\n",
    "print \"stress p=\",round(p,2),\"N/mm^2\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 8.26 page number 272\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "P= 12907.3 N\n"
     ]
    }
   ],
   "source": [
    "#variable declaration\n",
    "\n",
    "Ea=70*1000              #Young's modulus of aluminium,N/mm^2\n",
    "Es=200*1000             #Young's modulus of steel,N/mm^2\n",
    "\n",
    "alphaa=float(0.000011)  #expansion coefficient,/°C\n",
    "alphas=float(0.000012)  #expansion coefficient,/°C\n",
    "\n",
    "Aa=600                  #Area of aluminium portion,mm^2\n",
    "As=400                  #Area of steel, mm^2\n",
    "La=float(1.5)                  #length of aluminium portion,m\n",
    "Ls=float(3.0)                  #length of steel portion,m\n",
    "t=18                           #temperature,°C\n",
    "\n",
    "delta=(alphaa*t*La*1000)+(alphas*t*Ls*1000)      #mm\n",
    "\n",
    "P=(delta)/(((La*1000)/(Aa*Ea))+((Ls*1000)/(As*Es)))\n",
    "\n",
    "print \"P=\" ,round(P,1),\"N\"\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example8.27 page number 273"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Corresponding maximum stress =  120.0 N/mm^2\n"
     ]
    }
   ],
   "source": [
    "from math import pi\n",
    "\n",
    "#variable declaration\n",
    "\n",
    "d1=float(25)                 # variation linearly in diameter from 25 mm to 50 mm \n",
    "d2=float(50)\n",
    "L=float(500)                 #length,mm\n",
    "alpha=float(0.000012)        #expansion coeffecient,/°C\n",
    "t=25                  #rise in temperture,°C\n",
    "E=2*100000            #Young's modulus,N/mm^2\n",
    "\n",
    "delta=alpha*t*L\n",
    "\n",
    "#If P is the force developed by supports, then it can cause a contraction of 4*P*L/(pi*d1*d2*E)\n",
    "\n",
    "P=(delta*pi*d1*d2*E)/(4*L)\n",
    "Am=pi*pow(d1,2)/4\n",
    "Ms=P/Am\n",
    "\n",
    "print \"Corresponding maximum stress = \",round(Ms,1),\"N/mm^2\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 8.28 page number 275"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "stress in steel= 12.17 N/mm^2\n",
      "Stress in brass= 36.51 N/mm^2\n",
      "Shear stress in pin 18.26 N/mm^2\n"
     ]
    }
   ],
   "source": [
    "from math import pi\n",
    "\n",
    "#variable declaration\n",
    "\n",
    "Db=float(20)                     #diameter of brass rod,mm\n",
    "Dse=float(40)                    #external diameter of steel tube,mm\n",
    "Dsi=float(20)                    #internal diameter of steel tube,mm\n",
    "Es=float(2*100000 )              #Young's modulus steel, N/mm^2\n",
    "Eb=float(1*100000 )              #Young's modulus brass, N/mm^2\n",
    "alphas=float(0.0000116)          #coeffcient of expansion of steel,/°C\n",
    "alphab=float(0.0000187)          #coeffcient of expansion of brass,/°C\n",
    "t=60                             #raise in temperature, °C\n",
    "As=pi*(pow(Dse,2)-pow(Dsi,2))/4  #Area of steel tube, mm^2\n",
    "Ab=pi*(pow(Db,2))/4                #Area of brass rod,mm^2\n",
    "L=1200                           #length,mm\n",
    "#Since free expansion of brass  is more than free expansion of steel , compressive force Pb develops in brass and tensile force Ps develops in steel to keep the final position at CC \n",
    "\n",
    "#Horizontal equilibrium condition gives Pb = Ps, say P. \n",
    "\n",
    "P=((alphab-alphas)*t*L)/((L/(As*Es))+(L/(Ab*Eb)))\n",
    "\n",
    "ps=P/As\n",
    "pb=P/Ab\n",
    "\n",
    "print \"stress in steel=\",round(ps,2),\"N/mm^2\"\n",
    "print \"Stress in brass=\",round(pb,2),\"N/mm^2\"\n",
    "\n",
    "#the pin resist the force P at the two cross- sections at junction of two bars.\n",
    "\n",
    "Shearstress=P/(2*Ab)\n",
    "print \"Shear stress in pin\",round(Shearstress,2),\"N/mm^2\"\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 8.29 page number 276"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Change in length= 1.07 mm\n",
      "Hoop stress f= 83.33 N/mm^2\n"
     ]
    }
   ],
   "source": [
    "#variable declaration\n",
    "\n",
    "L=float(1000)                     #length of the bar at normal temperature,mm\n",
    "As=float(50*10)                   #Area of steel,mm^2\n",
    "Ac=float(40*5)                    #Area of copper,mm^2\n",
    "#Ac = Free expansion of copper  is greater than free expansion of steel  . To bring them to the same position, tensile force Ps acts on steel plate and compressive force Pc acts on each copper plate. \n",
    "alphas=float(0.000012)                   #Expansion of coeffcient of steel,/°C\n",
    "alphac=float(0.000017 )                  #Expansion of coeffcient of copper,/°C\n",
    "t=80                              #raise by temperature, °C\n",
    "Es=2*100000                       #Young's modulus of steel,N/mm^2\n",
    "Ec=1*100000                       #Young's modulus of copper,N/mm^2\n",
    "Pc=((alphac-alphas)*t*L)/((2*L/(As*Es)) +(L/(Ac*Ec)))\n",
    "Ps=2*Pc\n",
    "\n",
    "pc=Pc/Ac                          #Stress in copper,N/mm^2\n",
    "ps=Ps/As                          #Stress in steel, N/mm^2\n",
    "\n",
    "Changeinlength=alphas*t*L+(Ps*L/(As*Es))\n",
    "\n",
    "\n",
    "print\"Change in length=\",round(Changeinlength,2),\"mm\"\n",
    "\n",
    "##example 8.30 page number 278\n",
    "\n",
    "#variable declaration\n",
    "\n",
    "p=float(2)                   #internal pressure, N/mm^2\n",
    "t=12                   #thickness of thin cylinder,mm\n",
    "D=float(1000)                 #internal diameter,mm\n",
    "\n",
    "f=(p*D)/(2*t)          #Hoop stress,N/mm^2\n",
    "\n",
    "print \"Hoop stress f=\",round(f,2),\"N/mm^2\"\n",
    "\n",
    "\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
}