Jensen_Grant_Project2.docx

To the initial position as a function of time is x t

Info icon This preview shows pages 6–9. Sign up to view the full content.

View Full Document Right Arrow Icon
to the initial position as a function of time is x ( t ) = U k ( 1 e kt ) (6) The velocity of the projectile in the horizontal direction is u ( t ) = U e kt (7) and in the vertical direction v ( t ) = V e kt + g k ( e kt 1 ) (8)
Image of page 6

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Flight Path of a Projectile 7 Solution Input: main_flightpaths.m clear, clc %Grant Jensen, AER E 161, Project #2, main_flightpaths %Uses the functions flightpath.m to calculate t, u, v, v_t, x, y v_0 = 600;  %Launch velocity in m/s l_ang = 60;  %Launch angle in degrees above the horizontal k = [0 0.005 0.01 0.02 0.04 0.08];  %Coefficent of friction in s^-1 for  i = 1:length(k)  %Loops the next two statements 6 times      %Calls the flightpath function which creates vectors of t, u, v, v_t, x, y for each of the k values given     [ t , u , v , v_t , x , y ] = flightpath( v_0 , l_ang , k(i) );      %Converts the x and y values from meters to kilometers     x = x/1000;     y = y/1000;      %Calls the plot_flightpaths function and graphs y vs x, y vs t, u vs t,  and v vs t by using the vectors calculated above, adding each of those  seperate plots to one graph     [ yx , yt , ut , vt ] = plot_flightpaths( t , u , v , x , y );  end flightpath.m function  [ t , u , v , v_t , x , y ] = flightpath( v_0 , l_ang , k ) %Grant Jensen, AER E 161, Project #2 %flightpath calculates the characteristics of a flightpath %   Format of call: flightpath(v_0,l_ang,k) %   Inputs: Initial Speed in m/s -> v_0 %           Angle of departure relative to the horizontal as degrees-> l_ang %           Coefficient of air resistance -> k %   Uses v_0, l_ang, and k to calculate the fightpath of a projectile with %   and without air resistance.  %   Returns vectors of flight time, speed, range, and position.  (t,u,v,v_t,x,y,rng,f_t)   V = v_0*sind(l_ang);  %This defines V U = v_0*cosd(l_ang);  %This defines U g = 9.81;  %Gravatational constant in m/s^2 x(1) = 0;  %Inital x position in m y(1) = 0;  %Inital altitude in m t(1) = 0;  %Initial time in seconds f_t(1) = 0; u(1) = U;  %Initial velocity in the x direction in m/s v(1) = V;  %Initial velocity in the y direction in m/s v_t(1) = v_0;  %Initial combined velocity is equal to the inital velocity dt = .0005;  %Change in time i = 1;  %This is the counter while  y >= 0      if  k == 0
Image of page 7
Flight Path of a Projectile 8         u(i) = U;  %Velocity of the projectile in the horizontal direction w/o  air resistance         v(i) = (-g*t(i))+V;  %Velocity of the projectile in the vertical  direction w/o air resistance         v_t(i) = sqrt((u(i))^2 + (v(i))^2);  %Velocity vector         x(i) = (U * t(i));  %Range in km of the projectile as a function of  time w/o air resistance         y(i) = (V*t(i)) + ((-1/2) * g * (t(i)^2));  %Altitude in km of the 
Image of page 8

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern