Using Matlab:
The range of an object shot at an angle with respect to the
x-axis and an initial velocity vo is given by Range =
(Vo)2* sin(2*θ)/g
for 0<= θ <= π and neglecting air resistance. Use
g = 9.81 m/s2 and an initial velocity Vo of 100 meters
per second.
Use evenly spacing angle of π/40.
a) find the maximum range in meters
b) find the angle at which the maximum range occurs in radians
*Your answer must be based on the increment specified in this problem π/40.
Explain the process and how you obtained the results.
% Matlab script to determine the maximum range (in meters) and
the angle at
% which the maximum range occurs(in radians)
% define the variables
g = 9.81; % m/s^2
Vo = 100; % m/s
max_angle = 0; % radians % initialize max_angle to first value i.e
0
max_range = (Vo^2)*sin(2*max_angle)/g; % meters % calculate and set
max_range to range at max_angle
% loop from 0 to pi in steps of pi/40
for i=0:pi/40:pi
% compute range at angle = i
range = (Vo^2)*sin(2*i)/g;
% if range > max_range, update max_range and max_angle
if(range > max_range)
max_range = range;
max_angle = i;
end
end
% display the maximum range value and the angle at which it
occurs
fprintf('Maximum range: %f meters at angle: %f
radians\n',max_range, max_angle);
%end of script
Output:
Get Answers For Free
Most questions answered within 1 hours.