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

For this question the answer has to be in programming script in mat lab.. Please

ID: 2085825 • Letter: F

Question


For this question the answer has to be in programming script in mat lab.. Please..im using matlab_r2017.

Question 3 (10 Points) A ball is tossed with speed vo and launch angle o with respect to the ground. The height of the ball with respect to time is given as h(t) = vot sin()-22, where g is the gravitational constant. The speed of the ball with respect to time is given as v(t)-Vv2-2Vogtsin() + g2t2 Using MATLAB's vectorizing commands plot the height and speed on the same figure using the commands yyaxis left plot(t,h) and yyaxis right to plot(t,v) between the rime range of 0 and 3 seconds. Assume the speed vo 20 m/s and the launch angle is = 40 deg. Find the times when the height is no less than 6 meters and the speed is no greater than 16 m/s, using MATLAB's find command.

Explanation / Answer

clear
close all
disp('Welcome to the Projectile Motion Plotter');
disp('This projects the motion for a tennis ball with and without air resistance');
Vx = input('Please input the horizontal velocity [m/s]: ');          
Vy = input('Please input the vertical velocity [m/s]: ');            
%Sets up intial conditions
V = sqrt(Vx^2 + Vy^2);   %Determines V by combining v of both axes
G = 9.80665;             %m/s^2 Acceleration due to Gravity     
DC = 0.8;                %Drag coefficient
Area = 0.0033;           %m^2 cross section area of a tennis ball
Mass = 0.057;            %Kg mass of tennis ball
x(1) = 0;                %intial x postion
y(1) = 0;                %inital y postion
xf(1) = 0;               %inital xf postion
yf(1) = 0;               %intial yf postion
AP = 1.2;                %kg/m^3 Air Density @ Sea Level
D = AP*DC*Area/2;        %constant needed for drag calculations created  
t(1) = 0;                %sets intial time
dt = 0.01;               %s set the intervals at which time will be evalutated
i = 1;                   %sets counter/index
%Starts a loop for Projectile Motion with Drag  
    while min(y)> -0.01;                                        
       t = t + dt;                                             
       i = i + 1;                                              
       xf(i) = xf(i-1)+ Vx.*dt;                                
       AxD = - ( D / Mass ) * V * Vx;                          
       AyD = -G - ( D / Mass ) * V * Vy;                       
       Vx = Vx + AxD * dt;                                     
       Vy = Vy + AyD * dt;                                     
       x(i) = x(i-1) + Vx * dt + 0.5 * AxD * dt^2;             
       y(i) = y(i-1) + Vy * dt + 0.5 * AyD * dt^2;             
   end;
plot(x,y,'b'), hold on;               %plots the Projectile Motion with Drag
plot(xf,y,'r'), hold off;             %plots the Projectile Motion without Drag
xlabel('Horizontal Distance (m)');    %labels the x axis "Horizontal Distance (m)"
ylabel('Vertical Distance (m)');      %Labels the y axis "Vertical Distance (m)"
title('Projectile Motion Paths');     %Gives a Title "Projectile Motion Paths"

clear
clc
close all
%Constants for Baseball
m=.145 %kg
A=pi*(.0366*2)^2/4 %m^2
C=.5 %Drag Coefficient of a sphere
rho= 1.2 %kg/m^3 (density of air)
D=rho*C*A/2
g=9.81 %m/s^2 (acceleration due to gravity)
    %Initial Conditions
    delta_t= .001 %s
    x(1)=0
    y(1)=0
    v=50 %m/s
    theta=35 %deg
    vx=v*cosd(theta)
    vy=v*sind(theta)
    t(1)=0
    %Start Loop
    i=1
    while min(y)> -.001
        ax=-(D/m)*v*vx;
        ay=-g-(D/m)*v*vy;
        vx=vx+ax*delta_t;
        vy=vy+ay*delta_t;
        x(i+1)=x(i)+vx*delta_t+.5*ax*delta_t^2;
        y(i+1)=y(i)+vy*delta_t+.5*ay*delta_t^2;
        t(i+1)=t(i)+delta_t;
        i=i+1;
    end
    plot(x,y)
    xlabel('x distance (m)')
    ylabel('y distance (m)')
    title('Projectile Path')

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote