Question & Answer: A ball is tossed with speed v_0 and launch angle theta with respect to the ground. The height of the ball with respect to time is g…..

Please follow and satisfy ALL instructions. Please only write the program for MATLAB.

A ball is tossed with speed Vo and launch angle θ with respect to the ground. The height of the ball with respect to time is given as h(t)-votsin(e)-where g is the gravitational constant. The speed of the ball with respect to time is given as u(t)-Vuo-2Vogtsin(8) + gzt2. is given as h(t)-v,t sin(θ)--, where g is the g Using MATLABs vectorizing commands plot the height and speed on the same figure using the commands yyaxis left to plot(t,h) and yyaxis right to plot(t,v) between the rime range of 0 and 3 seconds. Assume the speed vo-20 m/s and the launch angle is θ = 40 deg. Find the times when the height is no less than 6 meters and the speed is no greater than 16 m/s, using MATLABs find command.

A ball is tossed with speed v_0 and launch angle theta with respect to the ground. The height of the ball with respect to time is given as h(t) = v_0 t sin(theta) – gt^2/2, where g is the gravitational constant. The speed of the ball with respect to time is given as v(t) = squareroot v^2_0 – 2v gt sin (theta) + g^2 t^2. Using MATLAB’s vectorizing commands plot the height and speed on the same figure using the commands y y axis left to plot(t, h) and y y axis right to plot(t, v) between the rime range of 0 and 3 seconds. Assume the speed v_0 = 20 m/s and the launch angle is theta = 40 deg. Find the times when the height is no less than 6 meters and the speed is no greater than 16 m/s, using MATLAB’s find command.

Expert Answer

 

Matlab Code
clc
clear vars
close all

g = 9.8; % Declaring gravitational constant
t = [0:3]; % declaring time interval
v0 = 20; % Decalring initial velocity
theta = deg2rad(40); % Calculating theta in radian
h_t = ( v0 * t*sin(theta) ) – ((g*t.^2)/2); % calculating height
v_t = sqrt( (v0^2) – (2*v0*g.*t.*sin(theta)) + (g^2*t.^2) ); % Calculating velocity

% plotting
plot(t, h_t, ‘k’, ‘LineWidth’, 1.5) % plotting the height points
yyaxis left

hold on
plot(t, v_t, ‘b’, ‘LineWidth’, 1.5) % Plotting the speed points
yyaxis right
hold off
l = legend(‘Ball Height’, ‘Ball Speed’);
set(l, ‘Location’, ‘best’);
title(‘Ball height vs Speed’)
xlabel(‘Time (s) ->’)

% Calculating the time for height > 6 meters
time1 = t(find(h_t > 6));
htime = sprintf(‘%ds, ‘, time1);
fprintf(‘Times when height greater than 6 meters = %sn’, htime);

% Calculating time for speed < 16 m/s
time2 = t(find(v_t < 16));
stime = sprintf(‘%ds’, time2);
fprintf(‘Time when speed is less than 16 m/s = %sn’, stime);

Command Window Output

Output Plot

Still stressed from student homework?
Get quality assistance from academic writers!