Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Matlab From elementary physics and Homework #1, we know that the distance a proj

ID: 3919830 • Letter: M

Question

Matlab

From elementary physics and Homework #1, we know that the distance a projectile travels when fired from a cannon depends on both the initial velocity v and the launch angle 0: x(t)- v tcos (e) y(t)-u tsin (?)--gt2 2 where x(t) and y(t) are the distances traveled in x and y, respectively, after time t has passed (g is gravity, g 9.8 meters/second2). Assume an initial velocity of 13.5 meters per second and an angle of 89 degrees above the ground. Use fzero to find the time and x location where the projectile hits the ground. Print the time and location to 4 decimal places. Self-check: It lands really, really, close to the cannon after x.7xx7 seconds

Explanation / Answer


Given below is the code for the question.
Please do rate the answer if it was helpful. Thank you

v = 13.5;
g = 9.8;
theta = 89 * pi / 180; %convert degrees to radians
x = @(t) v .* t .* cos(theta);
y = @(t) v .* t .* sin(theta) - 1/2 .* g .* t .^2;

t = fzero(y, 2); %initial value of t is 2 , find the of t, when y is zero
location = x(t); %find the horizontal distance x at time t

%display the results
fprintf("time when it hits the ground, t = %.4f sec ", t);
fprintf("horizontal distance , x = %.4f meters ", x1);


output
-----
time when it hits the ground, t = 2.7547 sec
horizontal distance , x = 0.6490 meters