Hello. I need help on part c of this problem. We are using matlab and are expect
ID: 3687317 • Letter: H
Question
Hello. I need help on part c of this problem.
We are using matlab and are expected to use the find function.
For instance, for part b, I wrote something like
heightA= find(h>=15 & v<=36);
heightA_start=t(heightA(1));
heightA_end=t(heightA(end));
fprintf('The times when height >=15 and speed<=36 are from %6.2f to %6.2f', heightA_start, heightA_end);
For part c though, the times are from in two blocks like 0 sec to 1 sec and 3 sec to 5sec (Just made them up.)
How do I code for this?? Thank you
12. The height and speed of a projectile (such as aown bal) launched with a speed of vo at an angle A to the horizontal are given by h(t) uo t sin A-0.5g12 where g is the acceleration due to gravity. The projectile wil strike the ground when h(t) = 0, which gives the time to hit hit-2(vo/g) sin A. Suppose that A= 30°, vo 40 m/s, and g 9.81m/s2. Use the MATLAB relational and logical operators to find the times when a. The height is no less than 15 m. b. The heig ht is no less than 15 m and the speed is simultaneously no greater than 36 m/s c. T he height is less than 5 m or the speed is greater than 35 m/sExplanation / Answer
if we need to solve this problem with relational and logical operatorsthan firstly we need to find the
commands to determine the time at which the logical expression (h <5) & (v > 35) is true or is correct .
t_hit will be around 8.6 so we can check time t in range from 0 to 9
we must subtract 1 from u (1) and from length (u) because the first element in the array t corresponds to 1 = 0 (that is, t (1) is 0).
Set the values for initial speed/”gravity, and angle. ,
i)vO = 40;
ii)g = 9.81;
iii)A =30*pi/180;
Compute the time to hit. t_hit = 2*vO*sin(A)/9=2*40/9.8*1/2
Compute the arrays containing time, height, and speed.
t [0 :t_hi t/100 :t_hi t1 ; h = vO*t*sin(A) – 0.5*g*t.A2; v = sqrt (vOA2 – 2*vO*g*sin(A)*t +’g A 2*t.A 2); % Determine when the height is no less than 5, and the speed is no greater than 35.
u = find h>5&v<=35); % Compute the corresponding times.
t_l= (u(1)-1)*(t_hit/100)
t_2 = u(length(u)-1)*(t_hit/100)
Hope it will help you
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.