PHYSICS 321 – INTERMEDIATE MECHANICS – FALL 2005


Supplemental Problems “B”



M2-1

Write a script called elastic.m with functionality defined as follows:


function [ v_final ] = elastic( m, v_initial )

%ELASTIC A function to calculate the final velocity of two

%objects that collide in a 1-Dimensional elastic collision

%

%Inputs:

% m is a 2x1 vector such that

% m(1) is the mass of the first object

% m(2) is the mass of the 2nd object

% v_initial(1) is the velocity of the first object

% v_initial(2) is the velocity of the 2nd object

%

%Outputs:

% v_final is a 2x1 vector such that

% v_final(1) is the final velocity of the first object

% v_final(2) is the final velocity of the second object


Here is the physics you will need.



Also


Create and debug the function elastic, then call it from the command line with the following



Print your results and include them with your script file.