import math
#Initilization of Variables
m1=1 #Kg #MAss of ball A
u1=2 #m/s #Initial velocity of ball A
v1=0 #Final velocity of ball A
#Ball-2
m2=2 #kg #mass
u2=0 #m/s #Initial velocity
#Calculation
#Total Initial momentum
V1=m1*u1+m2*u2 #kg*m/s
#Total Initial momentum
#V2=m1*v1+m2*u2 #kg*m/s
#Final velocity of ball B
v2=V1*2**-1 #m/s
#Coefficient of restitution
e=(v2-v1)*(u1-u2)**-1
#Result
print"Final velocity of ball B is",round(v2,2),"m/s"
print"Coefficient of restitution is",round(e,2)
import math
#Initilization of Variables
#first body
m1=50 #kg #mass
u1=6 #m/s #Initial velocity
#second body
m2=30 #kg #mass
u2=0 #m/s #Initial velocity
#Calculation
#MAss of two bodies
M=m1+m2 #kg
#Total momentum before impact
M2=m1*u1+m2*u2 #kg*m/s
#Total momentum after impact
#M3=(m1+m2)*V #kg*m/s
#Velocitites of two bodies
V=M2*80**-1 #m/s
#Result
print"Common Velocity is",round(V,2),"m/s"
import math
#Initilization of Variables
#Bullet
m1=0.05 #Kg #mass
#Target
m2=5 #kg #mass
u2=0 #m/s #Initital Velocity
v=7 #m/s #Final Velocity
#Calculation
m=m1+m2 #kg #total mass
#total Initial momentum
#v1=m1*u1+m2*u2
#After sub values and further simplifying we get
#v1=0.05*u1
#Total Final momentum
v2=m*v #kg*m/s
#Velocity of bullet
u1=v2*0.05**-1 #m/s
#Result
print"Velocity of bullet is",round(u1,2),"m/s"
import math
#Initilization of Variables
m1=20 #kg #MAss of first ball
u1=5 #m/s #Initital velocity of first ball
#second ball
m2=10 #kg #mass
u2=-10 #m/s #Velocity
e=5*6**-1 #coefficient of restitution
#Calculation
#Total momentum before impact
v1=m1*u1+m2*u2 #m/s
#Total momentum after impact
#v2=m1*v1+m2*v2
#Velocity of second ball after impact
V2=25*3**-1 #m/s
#Velocity of first ball after impact
V1=-V2*2**-1 #m/s
#Result
print"Velocity of first ball after impact is",round(V1,2),"m/s"
print"Velocity of second ball after impact is",round(V2,2),"m/s"
import math
from math import sin, cos, tan, radians, pi
import numpy as np
#Initilization of Variables
m1=1 #kg #mass of first ball
m2=2 #kg #mass of second ball
u1=6 #m/s #Initial velocity of first ball
u2=2 #m/s #Initial velocity of second ball
theta1=30 #degrees #angle made by first ball
theta2=30 #degrees #angle made by second ball
e=0.5 #coefficient of restitutiion
#Calculation
#for ball A
#v1*sin(phi1)=3 .............1
#for ball B
#v2*sin(phi)=1 .............2
#according to lwa of conservation of momentum
#v1*cos(ph11)+2*v2*cos(phi2)=8.66 ..............3
#coefficient of restitution for this case
#v2*cos(ph12)-v1*cos(phi1)=1.732 .........4
#Adding equation 3 and 4 we get
#v2*cos(ph2)=3.464 ....................5
#sub values in equation 3 we get
#v1*cos(ph1)=1.732 .................6
#dividing equation 1 by equation6
phi1=np.arctan(3*1.732**-1)*(180*pi**-1)
#dividing equation 2 by 5 we get
phi2=np.arctan(1*3.464**-1)*(pi**-1*180)
#sub value of phi2 in equation 5
v2=3.464*(cos(phi2*pi*180**-1))**-1
#sub value in equation 1
v1=1.732*(cos(phi1*pi*180**-1))**-1
#Result
print"velocity of 1Kg ball is",round(v1,2),"m/s"
print"velocity of 2nd ball is",round(v2,2),"m/s"
print"Direction of 1Kg ball is",round(phi1,2),"degrees"
print"Direction of 2nd ball is",round(phi2,2),"Degrees"
import math
from math import sin, cos, radians, pi
import numpy as np
#Initilization of Variables
m1=2 #kg #mass of first ball
m2=2 #kg #mass of second ball
u1=20 #m/s #Initial velocity of first ball
u2=30 #m/s #Initial velocity of second ball
theta1=30 #degrees #angle made by first ball
theta2=60 #degrees #angle made by second ball
e=0.9 #coefficient of restitutiion
#Calculation
#for ball A
#v1*sin(phi1)=10 .............1
#for ball B
#v2*sin(phi)=25.98 .............2
#according to lwa of conservation of momentum
#v1*cos(ph11)+2*v2*cos(phi2)=2.32 ..............3
#coefficient of restitution for this case
#v2*cos(ph12)-v1*cos(phi1)=29.08 .........4
#Adding equation 3 and 4 we get
#v2*cos(ph2)=15.7 ....................5
#sub values in equation 3 we get
#v1*cos(ph1)=13.38 .................6
#dividing equation 1 by equation6
phi1=np.arctan(10*13.38**-1)*(180*pi**-1)
#dividing equation 2 by 5 we get
phi2=np.arctan(25.98*15.7**-1)*(pi**-1*180)
#sub value of phi2 in equation 5
v2=25.98*(sin(phi2*pi*180**-1))**-1
#sub value in equation 1
v1=13.38*(cos(phi1*pi*180**-1))**-1
#Result
print"velocity of 1Kg ball is",round(v1,2),"m/s"
print"velocity of 2nd ball is",round(v2,2),"m/s"
print"Direction of 1Kg ball is",round(phi1,2),"degrees"
print"Direction of 2nd ball is",round(phi2,2),"Degrees"
import math
#Initilization of Variables
#First vechile
m1=600 #kg #mass
u1=12 #m/s #Initial velocity
#Second vechile
m2=400 #kg #mass
u2=9 #m/s #initial velocity
#Calculation
#Total mass
M=m1+m2 #kg
#Total Momentum before impact
v1=m1*u1+m2*u2
#Total momentum
#v=M*V
#By law of conservation of momentum
V=v1*1000**-1 #m/s
#Kinetic Energy before impact
KE1=(m1*u1**2+m2*u2**2)*2**-1 #N*m
#Total KE after impact
KE2=M*V**2*2**-1 #N*m
#Loss of KE
KE3=KE1-KE2 #N*m
#Result
print"Loss of Kinetic Energy due to impact is",round(KE3,2),"N*m"
import math
#Initilization of Variables
m1=0.1 #kg #MAss of bullet
m2=10 #kg #mass of target
u2=0 #Initial velocity of target
v=7 #m/s #common velocity
#Calculation
#Total momentum before impact
#v1=0.1*u1
#Total momentum after impact
v2=(m1+m2)*v
#Initial velocity of bullet
u1=v2*0.1**-1 #m/s
#Total KE before impact
KE=(m1*u1**2+m2*u2**2)*2**-1
#Total KE after impact
KE2=(m1+m2)*v**2*2**-1 #m/s
#Loss of KE
KE3=KE-KE2 #N*m
#Result
print"Loss of Kinetic Energy is",round(KE3,2),"N*m"
import math
#Initilization of Variables
e=0.75 #coefficient of restitution
m1=1 #kg #MAss of first sphere
m2=5 #kg #mass of second sphere
u1=3 #m/s #Initial velocity of 1st sphere
u2=0.6 #m/s #Initial velocity of 2nd sphere
#Calculation
#From law of conservation of momentum equation we get
#v1+5*v2=6 ..................1
#Form coefficient of restitution formula we get
#v2-v1=1.8 ........................2
#Adding equations 1 and 2 we get
v2=7.8*6**-1 #m/s
#sub in equation 2 we get
v1=1.8-v2 #m/s
#Loss of KE during impact
KE=((m1*u1**2+m2*u2**2)-(m1*v1**2+m2*v2**2))*2**-1
#Result
print"Loss of Kinetic Energy during impact is",round(KE,2),"N*m"
import math
#Initilization of Variables
m=0.5 #kg #mass of ball
H=18 #m #Height from which the ball is dropped
h=8 # #Height to which ball rebounds
g=9.81 #m/s**2
#Calculation
#Velocity with which ball strikes the floor
u=(2*g*H)**0.5 #m/s
#Velocty of ball after impact
v=(2*g*h)**0.5 #m/s
#Coefficient of restitution
e=v*u**-1
#Result
print"coefficient of restitution between floor and ball",round(e,2)
import math
#Initilization of Variables
H1=1.6 #m #Initial Height
H2=0.9 #m #Height after rebound
g=9.81 #m/s**2
#Calculation
#Consider motion of ball from height H1, wwe get
v1=(2*g*H1)**0.5 #m/s ................................1
#Consider motion of ball from floor to a height H2
u2=(2*g*H2)**0.5 #m/s .........................2
#Dividing equation 2 by 1 we get
e=u2*v1**-1
#Result
print"Coefficient of restitution is",round(e,2)
import math
#Initilization of Variables
h=16 #m #Height after impact
e=0.8 #coeficient of restitution
g=9.81 #m/s**2
#Calculation
#Velocity with which ball strikes the floor
u=(2*g*h)**0.5 #m/s
#Height from which ball is dropped
H=2*g*h*(e**2*2*g)**-1 #m
#Result
print"Height from which the ball is dropped is",round(H,2),"m"
import math
#Initilization of Variables
H=13.5 #Height from which ball is dropped
h=9 #m #Height to which ball rebounds
g=9.81 #m/s**2
#Calculation
#velocity with which ball stirkes the floor
u=(2*g*H)**0.5 #m/s
#velocity of ball after impact
v=(2*g*h)**0.5 #m/s
#Coefficient of restitution
e=(v*u**-1)
#Height of second rebound
#velocity with which ball stirkes the floor second time
u1=(2*g*h) #m/s ..............1
#velocity of ball after impact rebounds second time
#v1=(2*g*h2) ....................2
#After simplifying equation 1 and 2 we get
h2=e**2*u1*(2*g)**-1 #m
#Result
print"Height of second rebound is",round(h2,2),"m"
import math
from math import sin, cos, radians, pi
import numpy as np
#Initilization of Variables
u=10 #m/s #Initial velocity of ball
alpha=30 #degrees #angle made by intial velocity
theta=60 #degrees
e=0.5 #coefficient of restitution
#Calculation
#As components of intial velocity and final velocity with line of impact is same at right angles
#v*sin(phi)=8.66 ........1
#v*cos(phi)=2.5 ................2
#Dividing equation 1 by 2
phi=np.arctan(8.66*2.5**-1)*(180*pi**-1)
#Sub value in equation 1 we get
v=8.66*(sin(phi*pi*180**-1))**-1 #m/s
#Result
print"Direction of ball after impact is",round(phi,2),"Degrees"
print"Velocity of ball after impact",round(v,2),"m/s"
import math
#Initilization of Variables
u=5 #m/s #Initial velocity of body
alpha=30 #Degrees #Angle made by initial velocity with fixed plane
theta=60 #degrees
phi=45 #degrees #angle made by final velocity
beta=45 #degrees #Angle made by final velocity with line of impact
#Calculation
#Components of final velocity and initial velocity at right angles to line of impact
v=u*sin(alpha*pi*180**-1)*(sin(phi*pi*180**-1))**-1 #m/s
#For indirect impacton a fixed plane
e=v*cos(phi*pi*180**-1)*(u*cos(theta*pi*180**-1))**-1
#Result
print"coefficient of restitution between ball and fixed plane is",round(e,2)
print"velocity of body after impact is",round(v,2),"m/s"