A ball is tossed with speed v_o and launch angle theta with respect to the groun
ID: 3883501 • Letter: A
Question
A ball is tossed with speed v_o and launch angle theta with respect to the ground. The height of the ball with respect to time is given as h(t) = v_o 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_o - 2v_o gt sin(theta) + g^2t^2. Using MATLAB's 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 v_o = 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.Explanation / Answer
The below Matlab code satisfies the given requirement as follows:-
t=0:0.1:3;
theta=40;
vo=20;
g=6.67408 * 10^(-11); %%Gravitational constant
h=vo*t*sind(theta)-(g*(t^2)/2); %%Here sind is sine of argumnets in degrees
yyaxis left %%yyaxis left plot is used for hieght vs time on xaxis
plot(t,h)
xlabel('time')
ylabel('hieght')
v=sqrt((vo^2)-(2*vo*g*t*sind(theta))+((g^2)(t^2))); %%Here sind is sine of argumnets in degrees
yyaxis right %%yyaxis left plot is used for hieght vs time on xaxis
plot(t,v)
ylabel('speed')
t1=find(h<6,v<16) %%find command retuns the indices values as here it returns the time values
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.