Projectile Motion with Air Resistance

2-D Motion & Plotting

This example simulates a baseball (particle Q) hit from home plate (point No) over flat Earth (Newtonian Frame N). Variables x and y are the Nx> (horizontally-right) and Ny> (vertically-upward) measures of Q's position from No.

Mass of baseball m = 145 g (5.1 ozm)
Gravity force is -m*g*Ny> where g = 9.8 m/s^2
Aerodynamic drag is -b*v where v is Q's velocity. With air resistance b = 0.05 N*s/m whereas without b = 0.

Simulation data can be plotted with MotionGenesis plotting (or MATLAB®, Excel®, etc.) which can save plots in various graphics formats (.jpg, .png, .gif, .eps, .ps, etc.)

Advanced: Improved Drag Model, USA Units

This example uses air density, cross-sectional area, and the coefficient of drag to simulate a baseball traveling through air.

MotionGenesis Baseball projectile motion results .jpg

Optional: Use MotionGenesis to generate a MATLAB® .m file.

Modify the MotionGenesis script so it writes a MATLAB® .m file that takes coefDrag as an input argument. Next, modify the .m file so it detects the instant the ball hits the ground.
To use MATLAB® event handling, create a modified MotionGenesis script.

  1. Add Constant thetaDegrees
    Change ODE() MGBaseballTrajectory  to 
    ODE() MGBaseballTrajectory.m(thetaDegrees)
  2. Edit the MATLAB® .m file to set the initial values of x' and y'.
    xDt = 100*cosd(thetaDegrees);
    yDt = 100*sind(thetaDegrees);
  3. Edit the MATLAB® .m file using these event-handling instructions (5 very small changes).
  4. At the MATLAB® command prompt, type:
    [t, state] = MGBaseballTrajectory