summaryrefslogtreecommitdiff
path: root/Engineering_Mechanics/chapter_17.ipynb
blob: 9ec115f21f61428f8fc832d5f63b2ed6f7379e13 (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
{
 "metadata": {
  "name": "chapter_17.ipynb"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 17:Collision of Elastic Bodies"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.1,Page No.650"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Initilization of Variables\n",
      "\n",
      "m1=1 #Kg #MAss of ball A\n",
      "u1=2 #m/s #Initial velocity of ball A\n",
      "v1=0 #Final velocity of ball A\n",
      "\n",
      "#Ball-2\n",
      "m2=2 #kg #mass\n",
      "u2=0 #m/s #Initial velocity\n",
      "\n",
      "#Calculation\n",
      "\n",
      "#Total Initial momentum\n",
      "V1=m1*u1+m2*u2 #kg*m/s\n",
      "\n",
      "#Total Initial momentum\n",
      "#V2=m1*v1+m2*u2 #kg*m/s\n",
      "\n",
      "#Final velocity of ball B\n",
      "v2=V1*2**-1 #m/s\n",
      "\n",
      "#Coefficient of restitution\n",
      "e=(v2-v1)*(u1-u2)**-1 \n",
      "\n",
      "#Result\n",
      "print\"Final velocity of ball B is\",round(v2,2),\"m/s\"\n",
      "print\"Coefficient of restitution is\",round(e,2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Final velocity of ball B is 1.0 m/s\n",
        "Coefficient of restitution is 0.5\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.2,Page No.650"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Initilization of Variables\n",
      "\n",
      "#first body\n",
      "m1=50 #kg #mass\n",
      "u1=6 #m/s #Initial velocity\n",
      "\n",
      "#second body\n",
      "m2=30 #kg #mass\n",
      "u2=0 #m/s #Initial velocity\n",
      "\n",
      "#Calculation\n",
      "\n",
      "#MAss of two bodies\n",
      "M=m1+m2 #kg\n",
      "\n",
      "#Total momentum before impact\n",
      "M2=m1*u1+m2*u2 #kg*m/s\n",
      "\n",
      "#Total momentum after impact\n",
      "#M3=(m1+m2)*V #kg*m/s\n",
      "\n",
      "#Velocitites of two bodies\n",
      "V=M2*80**-1 #m/s\n",
      "\n",
      "#Result\n",
      "print\"Common Velocity is\",round(V,2),\"m/s\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Common Velocity is 3.75 m/s\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.3,Page No.651"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Initilization of Variables\n",
      "\n",
      "#Bullet\n",
      "m1=0.05 #Kg #mass\n",
      "\n",
      "#Target\n",
      "m2=5 #kg #mass\n",
      "u2=0 #m/s #Initital Velocity\n",
      "v=7 #m/s #Final Velocity\n",
      "\n",
      "#Calculation\n",
      "\n",
      "m=m1+m2 #kg #total mass\n",
      "\n",
      "#total Initial  momentum\n",
      "#v1=m1*u1+m2*u2\n",
      "#After sub values and further simplifying we get\n",
      "#v1=0.05*u1\n",
      "\n",
      "#Total Final momentum\n",
      "v2=m*v #kg*m/s\n",
      "\n",
      "#Velocity of bullet\n",
      "u1=v2*0.05**-1 #m/s\n",
      "\n",
      "#Result\n",
      "print\"Velocity of bullet is\",round(u1,2),\"m/s\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Velocity of bullet is 707.0 m/s\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.4,Page No.651"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Initilization of Variables\n",
      "\n",
      "m1=20 #kg #MAss of first ball\n",
      "u1=5 #m/s #Initital velocity of first ball\n",
      "\n",
      "#second ball\n",
      "m2=10 #kg #mass \n",
      "u2=-10 #m/s #Velocity\n",
      "e=5*6**-1 #coefficient of restitution\n",
      "\n",
      "#Calculation\n",
      "\n",
      "#Total momentum before impact\n",
      "v1=m1*u1+m2*u2 #m/s\n",
      "\n",
      "\n",
      "#Total momentum after impact\n",
      "#v2=m1*v1+m2*v2\n",
      "\n",
      "#Velocity of second ball after impact\n",
      "V2=25*3**-1 #m/s \n",
      "\n",
      "#Velocity of first ball after impact\n",
      "V1=-V2*2**-1 #m/s\n",
      "\n",
      "#Result\n",
      "print\"Velocity of first ball after impact is\",round(V1,2),\"m/s\"\n",
      "print\"Velocity of second ball after impact is\",round(V2,2),\"m/s\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Velocity of first ball after impact is -4.17 m/s\n",
        "Velocity of second ball after impact is 8.33 m/s\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.6,Page No.654"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from math import sin, cos, tan, radians, pi\n",
      "import numpy as np\n",
      "\n",
      "#Initilization of Variables\n",
      "\n",
      "m1=1 #kg #mass of first ball\n",
      "m2=2 #kg #mass of second ball\n",
      "u1=6 #m/s #Initial velocity of first ball\n",
      "u2=2 #m/s #Initial velocity of second ball\n",
      "theta1=30 #degrees #angle made by first ball\n",
      "theta2=30 #degrees #angle made by second ball\n",
      "e=0.5 #coefficient of restitutiion\n",
      "\n",
      "#Calculation\n",
      "\n",
      "#for ball A\n",
      "#v1*sin(phi1)=3   .............1\n",
      "\n",
      "#for ball B\n",
      "#v2*sin(phi)=1   .............2\n",
      "\n",
      "#according to lwa of conservation of momentum\n",
      "#v1*cos(ph11)+2*v2*cos(phi2)=8.66   ..............3\n",
      "\n",
      "#coefficient of restitution for this case\n",
      "#v2*cos(ph12)-v1*cos(phi1)=1.732  .........4\n",
      "\n",
      "#Adding equation 3 and 4 we get\n",
      "#v2*cos(ph2)=3.464  ....................5\n",
      " \n",
      "#sub values in equation 3 we get\n",
      "#v1*cos(ph1)=1.732   .................6\n",
      "\n",
      "#dividing equation 1 by equation6\n",
      "phi1=np.arctan(3*1.732**-1)*(180*pi**-1)\n",
      "\n",
      "#dividing equation 2 by 5 we get\n",
      "phi2=np.arctan(1*3.464**-1)*(pi**-1*180)\n",
      "\n",
      "#sub value of phi2 in equation 5\n",
      "v2=3.464*(cos(phi2*pi*180**-1))**-1\n",
      "\n",
      "#sub value in equation 1\n",
      "v1=1.732*(cos(phi1*pi*180**-1))**-1\n",
      "\n",
      "#Result\n",
      "print\"velocity of 1Kg ball is\",round(v1,2),\"m/s\"\n",
      "print\"velocity of 2nd ball is\",round(v2,2),\"m/s\"\n",
      "print\"Direction of 1Kg ball is\",round(phi1,2),\"degrees\"\n",
      "print\"Direction of 2nd ball is\",round(phi2,2),\"Degrees\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "velocity of 1Kg ball is 3.46 m/s\n",
        "velocity of 2nd ball is 3.61 m/s\n",
        "Direction of 1Kg ball is 60.0 degrees\n",
        "Direction of 2nd ball is 16.1 Degrees\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.7,Page No.656"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from math import sin, cos, radians, pi\n",
      "import numpy as np\n",
      "\n",
      "#Initilization of Variables\n",
      "\n",
      "m1=2 #kg #mass of first ball\n",
      "m2=2 #kg #mass of second ball\n",
      "u1=20 #m/s #Initial velocity of first ball\n",
      "u2=30 #m/s #Initial velocity of second ball\n",
      "theta1=30 #degrees #angle made by first ball\n",
      "theta2=60 #degrees #angle made by second ball\n",
      "e=0.9 #coefficient of restitutiion\n",
      "\n",
      "#Calculation\n",
      "\n",
      "#for ball A\n",
      "#v1*sin(phi1)=10   .............1\n",
      "\n",
      "#for ball B\n",
      "#v2*sin(phi)=25.98   .............2\n",
      "\n",
      "#according to lwa of conservation of momentum\n",
      "#v1*cos(ph11)+2*v2*cos(phi2)=2.32   ..............3\n",
      "\n",
      "#coefficient of restitution for this case\n",
      "#v2*cos(ph12)-v1*cos(phi1)=29.08 .........4\n",
      "\n",
      "#Adding equation 3 and 4 we get\n",
      "#v2*cos(ph2)=15.7  ....................5\n",
      " \n",
      "#sub values in equation 3 we get\n",
      "#v1*cos(ph1)=13.38   .................6\n",
      "\n",
      "#dividing equation 1 by equation6\n",
      "phi1=np.arctan(10*13.38**-1)*(180*pi**-1)\n",
      "\n",
      "#dividing equation 2 by 5 we get\n",
      "phi2=np.arctan(25.98*15.7**-1)*(pi**-1*180)\n",
      "\n",
      "#sub value of phi2 in equation 5\n",
      "v2=25.98*(sin(phi2*pi*180**-1))**-1\n",
      "\n",
      "#sub value in equation 1\n",
      "v1=13.38*(cos(phi1*pi*180**-1))**-1\n",
      "\n",
      "#Result\n",
      "print\"velocity of 1Kg ball is\",round(v1,2),\"m/s\"\n",
      "print\"velocity of 2nd ball is\",round(v2,2),\"m/s\"\n",
      "print\"Direction of 1Kg ball is\",round(phi1,2),\"degrees\"\n",
      "print\"Direction of 2nd ball is\",round(phi2,2),\"Degrees\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "velocity of 1Kg ball is 16.7 m/s\n",
        "velocity of 2nd ball is 30.36 m/s\n",
        "Direction of 1Kg ball is 36.77 degrees\n",
        "Direction of 2nd ball is 58.85 Degrees\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.8,Page No.658"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Initilization of Variables\n",
      "\n",
      "#First vechile\n",
      "m1=600 #kg #mass\n",
      "u1=12 #m/s #Initial velocity\n",
      "\n",
      "#Second vechile\n",
      "m2=400 #kg  #mass\n",
      "u2=9 #m/s #initial velocity\n",
      "\n",
      "#Calculation\n",
      "\n",
      "#Total mass\n",
      "M=m1+m2 #kg\n",
      "\n",
      "#Total Momentum before impact\n",
      "v1=m1*u1+m2*u2\n",
      "\n",
      "#Total momentum\n",
      "#v=M*V\n",
      "\n",
      "#By law of conservation of momentum\n",
      "V=v1*1000**-1 #m/s\n",
      "\n",
      "#Kinetic Energy before impact\n",
      "KE1=(m1*u1**2+m2*u2**2)*2**-1 #N*m\n",
      "\n",
      "#Total KE after impact\n",
      "KE2=M*V**2*2**-1 #N*m\n",
      "\n",
      "#Loss of KE\n",
      "KE3=KE1-KE2 #N*m\n",
      "\n",
      "#Result\n",
      "print\"Loss of Kinetic Energy due to impact is\",round(KE3,2),\"N*m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Loss of Kinetic Energy due to impact is 1080.0 N*m\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.9,Page No.659"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Initilization of Variables\n",
      "\n",
      "m1=0.1 #kg #MAss of bullet\n",
      "m2=10 #kg #mass of target\n",
      "u2=0 #Initial velocity of target\n",
      "v=7 #m/s #common velocity\n",
      "\n",
      "#Calculation\n",
      "\n",
      "#Total momentum before impact\n",
      "#v1=0.1*u1\n",
      "\n",
      "#Total momentum after impact\n",
      "v2=(m1+m2)*v\n",
      "\n",
      "#Initial velocity of bullet\n",
      "u1=v2*0.1**-1 #m/s\n",
      "\n",
      "#Total KE before impact\n",
      "KE=(m1*u1**2+m2*u2**2)*2**-1\n",
      "\n",
      "#Total KE after impact\n",
      "KE2=(m1+m2)*v**2*2**-1 #m/s\n",
      "\n",
      "#Loss of KE\n",
      "KE3=KE-KE2 #N*m\n",
      "\n",
      "#Result\n",
      "print\"Loss of Kinetic Energy is\",round(KE3,2),\"N*m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Loss of Kinetic Energy is 24745.0 N*m\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.12,Page No.662"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Initilization of Variables\n",
      "\n",
      "e=0.75 #coefficient of restitution\n",
      "m1=1 #kg #MAss of first sphere\n",
      "m2=5 #kg #mass of second sphere\n",
      "u1=3 #m/s #Initial velocity of 1st sphere\n",
      "u2=0.6 #m/s #Initial velocity of 2nd sphere\n",
      "\n",
      "#Calculation\n",
      "\n",
      "#From law of conservation of momentum equation we get\n",
      "#v1+5*v2=6    ..................1\n",
      "\n",
      "#Form coefficient of restitution formula we get\n",
      "#v2-v1=1.8    ........................2\n",
      "\n",
      "#Adding equations 1 and 2 we get\n",
      "v2=7.8*6**-1 #m/s\n",
      "\n",
      "#sub in equation 2 we get\n",
      "v1=1.8-v2 #m/s\n",
      "\n",
      "#Loss of KE during impact\n",
      "KE=((m1*u1**2+m2*u2**2)-(m1*v1**2+m2*v2**2))*2**-1\n",
      "\n",
      "#Result\n",
      "print\"Loss of Kinetic Energy during impact is\",round(KE,2),\"N*m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Loss of Kinetic Energy during impact is 1.05 N*m\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.13,Page No.664"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Initilization of Variables\n",
      "\n",
      "m=0.5 #kg #mass of ball\n",
      "H=18 #m #Height from which the ball is dropped\n",
      "h=8 # #Height to which ball rebounds\n",
      "g=9.81 #m/s**2 \n",
      "\n",
      "\n",
      "#Calculation\n",
      "\n",
      "#Velocity with which ball strikes the floor\n",
      "u=(2*g*H)**0.5 #m/s\n",
      "\n",
      "#Velocty of ball after impact\n",
      "v=(2*g*h)**0.5 #m/s\n",
      "\n",
      "#Coefficient of restitution\n",
      "e=v*u**-1\n",
      "\n",
      "#Result\n",
      "print\"coefficient of restitution between floor and ball\",round(e,2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "coefficient of restitution between floor and ball 0.67\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.13(A),Page No.664"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Initilization of Variables\n",
      "\n",
      "H1=1.6 #m #Initial Height\n",
      "H2=0.9 #m #Height after rebound\n",
      "g=9.81 #m/s**2\n",
      "\n",
      "#Calculation\n",
      "\n",
      "#Consider motion of ball from height H1, wwe get\n",
      "v1=(2*g*H1)**0.5 #m/s   ................................1\n",
      "\n",
      "#Consider motion of ball from floor to a height H2\n",
      "u2=(2*g*H2)**0.5 #m/s   .........................2\n",
      "\n",
      "#Dividing equation 2 by 1 we get\n",
      "e=u2*v1**-1 \n",
      "\n",
      "#Result\n",
      "print\"Coefficient of restitution is\",round(e,2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Coefficient of restitution is 0.75\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.14,Page No.665"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Initilization of Variables\n",
      "\n",
      "h=16 #m #Height after impact\n",
      "e=0.8 #coeficient of restitution\n",
      "g=9.81 #m/s**2\n",
      "\n",
      "#Calculation\n",
      "\n",
      "#Velocity with which ball strikes the floor\n",
      "u=(2*g*h)**0.5 #m/s \n",
      "\n",
      "#Height from which ball is dropped\n",
      "H=2*g*h*(e**2*2*g)**-1 #m\n",
      "\n",
      "#Result\n",
      "print\"Height from which the ball is dropped is\",round(H,2),\"m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Height from which the ball is dropped is 25.0 m\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.15,Page No.665"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Initilization of Variables\n",
      "\n",
      "H=13.5 #Height from which ball is dropped\n",
      "h=9 #m #Height to which ball rebounds\n",
      "g=9.81 #m/s**2\n",
      "\n",
      "#Calculation\n",
      "\n",
      "#velocity with which ball stirkes the floor\n",
      "u=(2*g*H)**0.5 #m/s\n",
      "\n",
      "#velocity of ball after impact\n",
      "v=(2*g*h)**0.5 #m/s\n",
      "\n",
      "#Coefficient of restitution \n",
      "e=(v*u**-1)\n",
      "\n",
      "#Height of second rebound\n",
      "\n",
      "#velocity with which ball stirkes the floor second time\n",
      "u1=(2*g*h) #m/s   ..............1\n",
      "\n",
      "#velocity of ball after impact rebounds second time\n",
      "#v1=(2*g*h2)    ....................2\n",
      " \n",
      "#After simplifying equation 1 and 2 we get\n",
      "h2=e**2*u1*(2*g)**-1 #m\n",
      "\n",
      "#Result\n",
      "print\"Height of second rebound is\",round(h2,2),\"m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Height of second rebound is 6.0 m\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.16,Page No.667"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from math import sin, cos, radians, pi\n",
      "import numpy as np\n",
      "\n",
      "#Initilization of Variables\n",
      "\n",
      "u=10 #m/s #Initial velocity of ball\n",
      "alpha=30 #degrees #angle made by intial velocity\n",
      "theta=60 #degrees\n",
      "e=0.5 #coefficient of restitution\n",
      "\n",
      "#Calculation\n",
      "\n",
      "#As components of intial velocity and final velocity with line of impact is same at right angles\n",
      "#v*sin(phi)=8.66  ........1\n",
      "\n",
      "#v*cos(phi)=2.5   ................2\n",
      "\n",
      "#Dividing equation 1 by 2\n",
      "phi=np.arctan(8.66*2.5**-1)*(180*pi**-1)\n",
      "\n",
      "#Sub value in equation 1 we get\n",
      "v=8.66*(sin(phi*pi*180**-1))**-1 #m/s\n",
      "\n",
      "#Result\n",
      "print\"Direction of ball after impact is\",round(phi,2),\"Degrees\"\n",
      "print\"Velocity of ball after impact\",round(v,2),\"m/s\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Direction of ball after impact is 73.9 Degrees\n",
        "Velocity of ball after impact 9.01 m/s\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17.17,Page No.667"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Initilization of Variables\n",
      "\n",
      "u=5 #m/s #Initial velocity of body\n",
      "alpha=30 #Degrees #Angle made by initial velocity with fixed plane\n",
      "theta=60 #degrees\n",
      "phi=45 #degrees #angle made by final velocity\n",
      "beta=45 #degrees #Angle made by final velocity with line of impact\n",
      "\n",
      "#Calculation\n",
      "\n",
      "#Components of final velocity and initial velocity at right angles to line of impact\n",
      "v=u*sin(alpha*pi*180**-1)*(sin(phi*pi*180**-1))**-1 #m/s\n",
      "\n",
      "#For indirect impacton a fixed plane\n",
      "e=v*cos(phi*pi*180**-1)*(u*cos(theta*pi*180**-1))**-1\n",
      "\n",
      "#Result\n",
      "print\"coefficient of restitution between ball and fixed plane is\",round(e,2)\n",
      "print\"velocity of body after impact is\",round(v,2),\"m/s\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "coefficient of restitution between ball and fixed plane is 1.0\n",
        "velocity of body after impact is 3.54 m/s\n"
       ]
      }
     ],
     "prompt_number": 15
    }
   ],
   "metadata": {}
  }
 ]
}