Question

Using MATLAB to solve the problem: The USS Missouri is a battleship with 16-inch guns. A...

Using MATLAB to solve the problem:

The USS Missouri is a battleship with 16-inch guns. A projectile is fired from one of the
guns at an angle of elevation ϴ = 42 degree from the sea-level with a velocity Vo = 820 m/s. Neglecting
air resistance and assuming the projectile is fired across the sea, using Matlab determine:
(a) How much time the projectile will be in flight (tf).
(b) How far away from the battleship the projectile will hit the surface of the sea (xmax).
(c) Plot height vs. distance from the battleship for x = 0 to xmax. Use 100 data points in your
distance vector. Your plot should include title, labels on the x and y axes, and dashed blue
line for the trajectory.
The equations of motion for the projectile are:

x(t) = Vox t
Vox = Vo cosϴ
Y(t) = Voy t – 4.9 t2
Voy = Vo sinϴ

Homework Answers

Answer #1
v0=820;
th=42*pi/180;%angle converted to radian
v0x=v0*cos(th);
v0y=v0*sin(th);
key=0;%key for finding time in while loop
y=0;%initial y 
t=0.01;%starting time is taken just after 0
while(key==0)
    y=v0y*t-4.9*t^2;
    if(y<=0)
        key=1;
    end
    t=t+0.01;
end
fprintf('Flight time(in seconds)=');
t
xmax=v0x*t;
fprintf('Range of the projectile(in meters)=');
xmax
time=linspace(0,t,100);
xdata=v0x*time;
ydata=v0y*time-4.9*time.^2;
plot(xdata,ydata,'.');
xlabel('x (m)');
ylabel('y (m)');
title('Projectile motion in x-y plane');

Output:

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions