We have a mail cannon that is designed to deliver a quick airmail message packag
ID: 2086993 • Letter: W
Question
We have a mail cannon that is designed to deliver a quick airmail message package (assume 1 kilogram). It is not as fast as email, but faster than the Post Office for short distances. Again, we are a peaceful people and this is a mail cannon, not a weapon! We are not a pertect people, so with each firing of the cannon, the muzzle angle will vary somewhat, as will the muzzle velocity of the mail pouch projectile; changes in either will influence exactly where the mail pouch lands You are to write a two programs program that predicts where multiple deliveries of mail will land. MATLAB Function: A MATLAB function program with filename of lastnamefirstinitialCANNONFCT.m, it will be provided input of a single cannon angle (degrees) and a single cannon muzzle velocity (m's), and m response it will provide a single range, or distance, to where the mail lands in meters. The cannon is mounted on wheels placing the barrel at a height of +1 meter for launch. You will not need to account for wind resistance MATLAB Program: A MATLAB program with a filename of lastnamefirstinitialCANNONSMPLING.m that will generate a sampling of launch parameters as follows Muzzle Velocity: Mean Velocity: 640 m/s Standard Deviation of Muzzle Velocity: 15 m/s (assume normally distributed) Muzzle Angle: Mean Angle: 35 degrees Standard Deviation of Angle: 2.5 degrees (assume normally distributed) Sample Size: 500 deliveries Your program is to conduct 500 iterations of sampling of muzzle velocity and angle, and forExplanation / Answer
1st Matlab Function:
function range = CANNONFCT(ang,vel)
g=9.81;
h=(vel.^2)/(2*g);
range=h*(1+(1+(1/(h*(sind(ang).^2)))).^0.5)*sind(2*ang); %based on equation from wikipedia
end
2nd Matlab Program:
clc;
a = 30; b = 300; %making random velocities and angles
vel = (b-a).*rand(500,1) + a;
c = 0; d=90;
ang = (d-c).*rand(500,1) + c;
x=[0:1:500]
rang=CANNONFCT(ang,vel); %finding the range
mn=mean(rang);
fprintf('mean of all range is %.2f',mn);
mx=max(rang);
fprintf('max of all range is %.2f',mx);
mi=min(rang);
fprintf('min of all range is %.2f',mi);
nrang=sort(range);
figure(1)
plot(x,nrange,'-')
xlabel('number of cannon'); ylabel('range obtained');
end
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.