Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

Carson Witt

2061 views
d = 50 v_0 = 25 theta = pi/3 p1 = parametric_plot([v_0*cos(theta)*t, -4.9*(t^2) + (v_0*sin(theta)*t)], (t,0,25)) no_wall = p1 show(no_wall, xmin=0, xmax=54.2, ymin=0, ymax=24) no_wall.save('with_gravity_no_wall.pdf')
d = 50 v_0 = 25 theta = pi/3 t = var('t') x_t(t) = v_0*cos(theta)*t y_t(t) = v_0*sin(theta)*t - (9.8/2)*t^2 t_wall = d / (v_0*cos(theta)) delta_t = 0.000001 t_before_wall = t_wall - delta_t position_at_wall = (x_t(t_wall), y_t(t_wall)) position_before_the_wall = (x_t(t_before_wall), y_t(t_before_wall)) height_of_impact = y_t(t_wall) print "Position at wall is: " + str(position_at_wall) print "Position before wall: " + str(position_before_the_wall) print "Hits wall at: " + str(N(t_wall,digits=7)) + " seconds." print "Hits wall at: " + str(height_of_impact) + " meters above the ground." slope = (position_before_the_wall[1]-position_at_wall[1])/(position_before_the_wall[0]-position_at_wall[0]) angle_impact = arctan(slope) dif_x = (position_at_wall[0]-position_before_the_wall[0])^2 dif_y = (position_at_wall[1]-position_before_the_wall[1])^2 distance_between_points = sqrt(dif_x + dif_y) velocity_impact = distance_between_points/delta_t #parametric equations for the bounce x_t_b(t) = d-velocity_impact*cos(-angle_impact)*t y_t_b(t) = y_t(t_wall)-velocity_impact*sin(-angle_impact)*t-9.8/2*t^2 t_ground = find_root(y_t_b == 0, 0, d) container = Graphics() container += parametric_plot ( (x_t(t), y_t(t)), (t,0,t_wall) ) container += parametric_plot( (d, t), (t,0,position_at_wall[1]+5), color='green', thickness=5) container += parametric_plot( (x_t_b(t), y_t_b(t)), (t,0,t_ground)) show(container) container.save('with_gravity_with_wall.pdf')
Position at wall is: (50, 50*sqrt(3) - 78.4000000000000) Position before wall: (49.9999875000000, 49.9999875000000*sqrt(3) - 78.3999608000049) Hits wall at: 4.000000 seconds. Hits wall at: 50*sqrt(3) - 78.4000000000000 meters above the ground.
v_0 = 25 theta = pi/3 t = var('t') x_t(t) = v_0*cos(theta)*t y_t(t) = v_0*sin(theta)*t container = Graphics() container += parametric_plot ( (x_t(t),y_t(t)), (t,0,20) ) show(container) container.save('no_gravity_no_wall.pdf')
d = 50 v_0 = 25 theta = pi/3 p1 = parametric_plot([v_0*cos(theta)*t, 4.9*(t^2) + (v_0*sin(theta)*t)], (t,0,25)) no_wall = p1 show(no_wall, xmin=0, xmax=54.2, ymin=0, ymax=24)
d = 50 v_0 = 25 theta = pi/3 t = var('t') x_t(t) = v_0*cos(theta)*t y_t(t) = v_0*sin(theta)*t - (9.8/2)*t^2 t_wall = d / (v_0*cos(theta)) delta_t = 0.000001 t_before_wall = t_wall - delta_t position_at_wall = (x_t(t_wall), y_t(t_wall)) position_before_the_wall = (x_t(t_before_wall), y_t(t_before_wall)) height_of_impact = y_t(t_wall) print "Position at wall is: " + str(position_at_wall) print "Position before wall: " + str(position_before_the_wall) print "Hits wall at: " + str(N(t_wall,digits=7)) + " seconds." print "Hits wall at: " + str(height_of_impact) + " meters above the ground." slope = (position_before_the_wall[1]-position_at_wall[1])/(position_before_the_wall[0]-position_at_wall[0]) angle_impact = arctan(slope) dif_x = (position_at_wall[0]-position_before_the_wall[0])^2 dif_y = (position_at_wall[1]-position_before_the_wall[1])^2 distance_between_points = sqrt(dif_x + dif_y) velocity_impact = distance_between_points/delta_t #parametric equations for the bounce x_t_b(t) = d-velocity_impact*cos(-angle_impact)*t y_t_b(t) = y_t(t_wall)-velocity_impact*sin(-angle_impact)*t-9.8/2*t^2 t_ground = find_root(y_t_b == 0, 0, d) container = Graphics() container += parametric_plot ( (x_t(t), y_t(t)), (t,0,t_wall) ) container += parametric_plot( (d, t), (t,0,position_at_wall[1]+5), color='green', thickness=5) container += parametric_plot( (x_t_b(t), -y_t_b(t)+16.3), (t,0,2)) show(container) container.save('wall_gravity.pdf')
Position at wall is: (50, 50*sqrt(3) - 78.4000000000000) Position before wall: (49.9999875000000, 49.9999875000000*sqrt(3) - 78.3999608000049) Hits wall at: 4.000000 seconds. Hits wall at: 50*sqrt(3) - 78.4000000000000 meters above the ground.