You are on page 1of 7

Lab 6: Elastic and Inelastic Collisions (1-d)

The diagram below shows two objects. Object 1 has a mass, m1 (kg) and an initial velocity, v1
(m/s) and Object 2 has a mass, m2 (kg) and an initial velocity, v2 (m/s). The diagram also shows
the direction the two objects will move depending on the sign of the velocity. So, a positive v1
indicates object 1 is moving to the right while a positive v2 indicates object 2 is moving to the
left. Assume that Object 2 is to the right of Object 1 and the objects can only move along the
path indicated by the dashed line. Also, assume that the velocity of each object will not change
unless the objects collide with one another.

Object 1 Object 2
Mass = m1 (kg) Mass = m2 (kg)
Velocity = v1 (m/s) Velocity = v2 (m/s)

v1 > 0 v2 > 0

v1 < 0 v2 < 0

1. Create a new script file. Add the following command to your script file (and all future script
files):
clear; close all; clc; commandwindow

2. Add input statements to your script file to prompt the user for the mass and velocity of each
object.

3. Within your script, calculate the kinetic energy of each object and the total kinetic energy in
Joules, J. The formula for kinetic energy is:

Add fprintf statements to output these values using three places behind the decimal point.
Make sure your output statements include units for kinetic energy.

4. Add a conditional statement to your script to determine whether or not a collision will occur
based on the velocities entered by the user. Within your conditional statement, add fprintf
statements to tell the user whether or not the objects will collide.

5. Within the conditional statement you just created, add a menu statement to prompt the user to
select the type of collision in the case where a collision does occur.
6. Following your menu statement, add a switch statement based on the user’s choice for type
of collision. Your switch statement should have two cases: case 1 and case 2. One of these
will be inelastic and one will be elastic – which is which depends on how you set up your
menu statement. Add a comment to each case to indicate which one is inelastic and which
one is elastic.

7. Start with the inelastic collision case. We will assume a perfectly inelastic collision; that is,
after colliding, the two objects will stick together and move as one. So, within the inelastic
case, do the following:

 Calculate the final velocity of the objects using the formula

 Add an fprintf statement to output the final velocity of the objects. Use three places
behind the decimal point and include units for velocity in your fprintf statement.

 Calculate the kinetic energy of each object after the collision and the total kinetic energy
after the collision.

 Add fprintf statements to output the kinetic energy of each object and the total kinetic
energy after the collision. Use three places behind the decimal point and include the
units for kinetic energy in your fprintf statements.

 Add code to determine whether the two objects are moving together to the right, moving
together to the left, or come to a complete stop after colliding. Output this information
(fprintf or disp) to the user. Note: positive VF would indicate that the objects are
moving together to the right.

8. Run the test cases listed below for an inelastic collision. Paste the resulting output from your
fprintf statements where indicated. Check your results with your T.A.

TEST CASE 1: m1 = 1; v1 = 1; m2 = 2; v2 = 2

PASTE RESULTS:
The kinetic energy of Object 1 is 0.500 J.
The kinetic energy of Object 2 is 4.000 J.
The total kinetic energy of the objects is 4.500 J.
The collision will occur.
The final velocity of the objects is -1.000.
The kinetic energy of the first object after the collision is 0.500.
The kinetic energy of the second object after the collision is 1.000.
The total kinetic energy after the collision is 1.500.
The two objects are going to the left.

TEST CASE 2: m1 = 1; v1 = 1; m2 = 2; v2 = -2
PASTE RESULTS:
The kinetic energy of Object 1 is 0.500 J.
The kinetic energy of Object 2 is 4.000 J.
The total kinetic energy of the objects is 4.500 J.
The collision will not occur.

TEST CASE 3: m1 = 1; v1 = 3; m2 = 2; v2 = 3

PASTE RESULTS:
The kinetic energy of Object 1 is 4.500 J.
The kinetic energy of Object 2 is 9.000 J.
The total kinetic energy of the objects is 13.500 J.
The collision will occur.
The final velocity of the objects is -1.000.
The kinetic energy of the first object after the collision is 0.500.
The kinetic energy of the second object after the collision is 1.000.
The total kinetic energy after the collision is 1.500.
The two objects are going to the left.

TEST CASE 4: m1 = 10; v1 = 2; m2 = 2; v2 = 1

PASTE RESULTS:
The kinetic energy of Object 1 is 20.000 J.
The kinetic energy of Object 2 is 1.000 J.
The total kinetic energy of the objects is 21.000 J.
The collision will occur.
The final velocity of the objects is 1.500.
The kinetic energy of the first object after the collision is 11.250.
The kinetic energy of the second object after the collision is 2.250.
The total kinetic energy after the collision is 13.500.
The two objects are going to the right.

9. Now work on the elastic collision case. We will assume a perfectly elastic collision. So,
within the elastic case, do the following:

 Calculate the final velocities for each object using the formulas
 Add fprintf statements to output the final velocity of each object. Use three places
behind the decimal point and include units in your output.

 Calculate the kinetic energy of each object after the collision and the total kinetic
energy after the collision

 Add fprintf statements to output the kinetic energy of each object and the total kinetic
energy (all after collision). Use three places behind the decimal point and include the
units for kinetic energy in your fprintf statements.

 Add code to determine whether Object 1 is moving to the left, moving to the right, or
stopped after the collision. Output this information to the user.

 Add code to determine whether Object 2 is moving to the left, moving to the right, or
stopped after the collision. Output this information to the user.

10. Run each of the test cases listed below for an elastic collision. Paste the resulting output
(located in the command window) where indicated. Check your results with your T.A.

TEST CASE 1: m1 = 1; v1 = 1; m2 = 2; v2 = 2

PASTE RESULTS:
The kinetic energy of Object 1 is 0.500 J.
The kinetic energy of Object 2 is 4.000 J.
The total kinetic energy of the objects is 4.500 J.
The collision will occur.
The final velocity of the first object is -3.000 m/s.
The final velocity of the second object is 0.000 m/s.
The kinetic energy of first object after the collision is 4.500 J.
The kinetic energy of second object after the collision is 0.000 J.
The total kinetic energy after the collision is 4.500 J.
Object 1 is moving to the left.
Object 2 came to a complete stop after colliding.

TEST CASE 2: m1 = 1; v1 = 1; m2 = 2; v2 = -2

PASTE RESULTS:
The kinetic energy of Object 1 is 0.500 J.
The kinetic energy of Object 2 is 4.000 J.
The total kinetic energy of the objects is 4.500 J.
The collision will not occur.
TEST CASE 3: m1 = 1; v1 = 3; m2 = 2; v2 = 3

PASTE RESULTS:
The kinetic energy of Object 1 is 4.500 J.
The kinetic energy of Object 2 is 9.000 J.
The total kinetic energy of the objects is 13.500 J.
The collision will occur.
The final velocity of the first object is -5.000 m/s.
The final velocity of the second object is -1.000 m/s.
The kinetic energy of first object after the collision is 12.500 J.
The kinetic energy of second object after the collision is 1.000 J.
The total kinetic energy after the collision is 13.500 J.
Object 1 is moving to the left.
Object 2 is moving to the left.

TEST CASE 4: m1 = 10; v1 = 2; m2 = 2; v2 = 1

PASTE RESULTS:
The kinetic energy of Object 1 is 20.000 J.
The kinetic energy of Object 2 is 1.000 J.
The total kinetic energy of the objects is 21.000 J.
The collision will occur.
The final velocity of the first object is 1.000 m/s.
The final velocity of the second object is -4.000 m/s.
The kinetic energy of first object after the collision is 5.000 J.
The kinetic energy of second object after the collision is 16.000 J.
The total kinetic energy after the collision is 21.000 J.
Object 1 is moving to the right.
Object 2 is moving to the left.

11. Paste your final script below.

FINAL SCRIPT:
clear; close all; clc; commandwindow
m1 = input('Choose mass of Object 1: ');
v1 = input('Choose velocity of Object 1: ');
m2 = input('Choose mass of Object 2: ');
v2 = input('Choose velocity of Object 2: ');
KE1 = 0.5*m1*(v1^2);
KE2 = 0.5*m2*(v2^2);
TKE = KE1 + KE2;
fprintf('The kinetic energy of Object 1 is %.3f J.\n',KE1)
fprintf('The kinetic energy of Object 2 is %.3f J.\n',KE2)
fprintf('The total kinetic energy of the objects is %.3f
J.\n',TKE)
if (v1+v2 > 0)
fprintf('The collision will occur.\n')
ToC = menu('Enter the type of collision:
','Inelastic','Elastic');
switch ToC
case 1 %Inelastic%
VF = ((m1*v1)-(m2*v2)) / (m1+m2);
fprintf('The final velocity of the objects is
%.3f.\n', VF);
KE1A = 0.5*m1*VF^2;
KE2A = 0.5*m2*VF^2;
fprintf('The kinetic energy of the first object
after the collision is %.3f.\n', KE1A);
fprintf('The kinetic energy of the second object
after the collision is %.3f.\n', KE2A);
TKEA = (KE1A + KE2A);
fprintf('The total kinetic energy after the
collision is %.3f.\n',TKEA)
if VF>0
fprintf('The two objects are going to the
right.\n')
elseif VF<0
fprintf('The two objects are going to the
left.\n')
else
fprintf('The two objects came to a stop after
the collision.\n')
end
case 2 %Elastic%
VF1 = ((m1-m2)/(m1+m2))*v1-(((2*m2)/(m1+m2))*v2);
VF2 = -1*(((2*m1)/(m1+m2))*v1)+(((m2-
m1)/(m1+m2))*v2);
fprintf('The final velocity of the first object is
%.3f m/s.\n', VF1)
fprintf('The final velocity of the second object is
%.3f m/s.\n', VF2)
KE1F = 0.5*m1*VF1^2;
KE2F = 0.5*m2*VF2^2;
TKE = KE1F+KE2F;
fprintf('The kinetic energy of first object after
the collision is %.3f J.\n', KE1F)
fprintf('The kinetic energy of second object after
the collision is %.3f J.\n', KE2F)
fprintf('The total kinetic energy after the
collision is %.3f J.\n', TKE)
if VF1>0
fprintf('Object 1 is moving to the right.\n')
elseif VF1<0
fprintf('Object 1 is moving to the left.\n')
else
fprintf('Object 1 came to a complete stop after
colliding.\n')
end
if VF2>0
fprintf('Object 2 is moving to the right.\n')
elseif VF2<0
fprintf('Object 2 is moving to the left.\n')
else
fprintf('Object 2 came to a complete stop after
colliding.\n')
end
end
else
fprintf('The collision will not occur.\n')

end

12. Answer the following questions (run more test cases if necessary):

 For a perfectly inelastic collision, does the kinetic energy of each object and the total
kinetic energy change after the collision? If so, describe the changes.

Yes, due to the fact the velocities and masses change.

 For a perfectly elastic collision, does the kinetic energy of each object and the total
kinetic energy change after the collision? If so, describe the changes.

Yes, because each of the objects have a change in velocity.

Submit this completed document to your section site on Blackboard.


Remember, it must be either a Word doc or a pdf document.

You might also like