Numerical Methods for Engineers and Scientists 3rd Edition – An Introduction wit
ID: 3893447 • Letter: N
Question
Numerical Methods for Engineers and Scientists 3rd Edition – An Introduction with Applications Using MATLAB - Gilat | Subramaniam Problem 3.29 A quarterback throws a pass to his wide receiver running a route. The quarterback releases the ball at a height of hQ . The wide receiver is supposed to catch the ball straight down the field 60 ft away at a height of hR . The equation that describes the motion of the football is the familiar equation of projectile motion from physics: y = x tan(?) - 1/2[x2 g/v02 cos2(?)] + hQ where x and y are the horizontal and vertical distance, respectively, g = 32.2 ft/s2 is the acceleration due to gravity, v0 is the initial velocity of the football as it leaves the quarterback's hand, and ? is the angle the football makes with the horizontal just as it leaves the quarterback's throwing hand. For g = 32.2 ft/s², v0 = 50 ft/s, x = 60 ft, hQ = 6.5 ft, and hR = 7 ft, find the angle ? at which the quarterback must launch the ball. Solve Problem 3.29 utilizing Regula Falsi method Print table for each method include relative error and real error and how many iterations for convergance. Use MATLAB built-in function fzero to determine the true value and add this result to the data table or list. Provide the graph that shows the solution only.
Explanation / Answer
Solution:
code:
football=@(x) xXtan(theta)-(((0.5)X(x^2)*g)/(v0^2))X(1/(cos(theta))^2)+hq;
v0=50;
g=32.2;
x=60;
hq=6.5;
hR=7;
TolMax=.0001
a=2; b=3; imax=20; TolMax=0.00001;
fa = football(a);
fb = football(b);
n=(log(b-a)-log(TolMax))/log(2)
if fa*fb>0
disp('Error: function has the same sign at points a and b (same side of the solution)')
for i = 1:imax
xNS=(a+b)/2;
toli=(b-a)/2;
FxNS=F(xNS);
fprintf('%3i %11.6f %11.6f %11.6f %11.6f %11.6f ', i, a, b, xNS, FxNS, TolMax)
if FxNS==0
fprintf('An exact solution x=%11.6f was found', xNS)
break
end
if toli<TolMax
break
end
if i==imax
fprintf('solution was not obtained in %i iterations', imax)
break
end
if fa*FxNS<0
b=xNS;
else
a=xNS;
end
end
end
end
function [theta] = football( x, v0, g, hq )
y=x*tan(theta)-(((0.5)*(x^2)*g)/(v0^2))*(1/(cos(theta))^2)+hq;
end
I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.