Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

**Using Matlab** For this problem, submit the simulated density plots for: a. Th

ID: 2249368 • Letter: #

Question

**Using Matlab**

For this problem, submit the simulated density plots for:

a. The random variable

b. The function of the random variable Display the values of the mean and standard deviation with appropriate labels

1? PROBLEM 1. The range, r, of a cannon projectile under the influence of gravity, g-9.81 m/s, and fired with muzzle velocity vo 10 m/s is determined by the angle its barrel makes with the ground From your Physics classes you will recall that the range is calculated as: r(8)= 2 sin(e) coss?( variable uniformly distributed between 0 and n/2, generate the probability density of the range f(), through stochastic modeling , y / g). Assuming that is a ra ndom se the resulting histogram to calculate the mean range of the projectile. Verify your computation of the mean using Taylor series ex NOTE 1 A random variable uniformly distributed between 0 ad /2) ca n be generated using the "rand" function in MATLAB as following: = /2)* rand The mea n and variance of are given by: E[]- / 4 : V[0] = ( / 2)2 / 12 . These values will be needed when using the Taylor series approximation

Explanation / Answer

clc;

clear all

workspace;

format compact;

format long g;

angle = [0.4, 0.6, pi/4, 1.0, 1.2];

V0 = 120;

g = -9.8;

t = 0 : .01 : 500;

Ax = 0;

Ay= g;

numberOfAngles = length(angle);

for k = 1 : numberOfAngles

thisAngle = angle(k);

xVelocity = V0 * cos(thisAngle);

yVelocity = V0 * sin(thisAngle);

x = xVelocity .* t + (1/2) * Ax .* t.^2;

y = yVelocity .* t + (1/2) * Ay .* t.^2;

subplot(2, 3, k);

plot(x, y, 'b-', 'LIneWidth', 3);

caption = sprintf('Angle = %.3f radians = %.2f degrees ', ...

thisAngle, thisAngle*180/pi);

title(caption, 'FontSize', 15);

grid on;

xlim([0 6e4]);

end

% Enlarge figure to full screen.

set(gcf, 'units','normalized','outerposition',[0 0 1 1]);