In: Physics
a 2d collision
Perform a linear fit, of the form x = A*t + B, to each graph and determine the initial velocity v1 and the final velocities v′1x, v′1y, v′2x, and v′2y. How do I find the v′1y
if: time (sec)= 0.400, 0.460, 0.500, 0.530, 0.560, 0.600, 0.630, 0.670, 0.700, 0.730, 0.700,0.800, 0.830, 0.867, 0.900
position (m) in y dxn= 85, 100, 120, 140, 160, 180, 190, 210, 230, 240, 260, 270, 290, 300, 320
position (m) in x dxn= 800, 850, 920, 980, 1000, 1080, 1140, 1190, 1230, 1280, 1300, 1400, 1440, 1490, 1500
from scipy.optimize import curve_fit
import numpy as np
import matplotlib.pyplot as plt
t1 = [.400, .460, .500, .530, .560, .600, .630, .670, .700,
.730]
t2 = [ .700, .800, .830, .867, .900]
x1 = [800, 850, 920, 980, 1000, 1080, 1140, 1190, 1230,
1280]
x2 = [ 1300, 1400, 1440, 1490, 1500]
y1 = [85, 100, 120, 140, 160, 180, 190, 210, 230, 240]
y2 = [260, 270, 290, 300, 320]
u1 = np.linspace(.400,.730,10)
u2 = np.linspace(0.7,0.9,5)
def linear(x, a0, a1):
return a0*x + a1
popt1, pcov1 = curve_fit(linear, t1, x1)
popt2, pcov1 = curve_fit(linear, t2, x2)
plt.plot(t1,x1, label = 'x vs t before collision', linewidth =
2)
plt.plot(t2,x2, label = 'x vs t after collision', linewidth =
2)
plt.plot(u1, linear(u1, *popt1), label = 'linear fit before
collision')
plt.plot(u2, linear(u2, *popt2), label = 'linear fit after
colision')
plt.legend()
plt.show()
popt1, pcov1 = curve_fit(linear, t1, y1)
popt2, pcov1 = curve_fit(linear, t2, y2)
plt.plot(t1,y1, label = 'y vs t before collision', linewidth =
2)
plt.plot(t2,y2, label = 'y vs t after collision', linewidth =
2)
plt.plot(u1, linear(u1, *popt1), label = 'linear fit before
collision')
plt.plot(u2, linear(u2, *popt2), label = 'linear fit after
colision')
plt.legend()
plt.show()
Take the slope between any two points in the x vs t and y vs t graph to get vx and vy respectively.
v′1y = (100-85)/(0.460-0.400) - 250 m/s
v′2y = (270-260)/(0.800-0.700) = 99.99 m/s