MATLAB Projectile Motion
Aubrey Weese


Problem 1 - Simple Projectile Motion. I used a time step of 0.1 seconds, intial position [0,0], initial velocity 42.4 m/s, and angles of 30o, 35o, 40o, 45o, 50o, and 55o for this chart.

View my MATLAB code for Euler Method depending on angle, without air resititance.


Problem 2 - Improving balle.m.

I used linear interpolation to interpolate between the last two points on the graph and get an improved range and time of flight. All of these calculations neglect air resistance.

For intital position [0,0] and intial veloctity [30,30], the range should be 183.25 meters, using the equation xmax = (2v02/g)*(sinqcosq), where v0 = sqrt(302 + 302) and q = 45o (since the x and y velocity is the same). The time of flight should be 6.11 seconds, using the equation T = (2v0/g)*(sinq).

For a time step of 0.05 seconds, the Euler method gave me a range of 186 meters, which has a percent error of 1.5%, and a time of flight of 6.2 seconds, which has a percent error of 1.47%.

Using the same time step, the Interpolated (or "Improved") Euler method gave me a range of 184.96 meters, which has a percent error of 0.93%, and a time of flight of 6.2 seconds.

View my MATLAB code for Improved Euler Method.


Problem 3 - Euler-Cromers and Midpoint Method.

I calculated the range with each method using initial position [0,0], initial velocity [30,30] and linear interpolation. Again, the actual range is 183.25 meters, neglecing air resistance.

The Euler method needed a time step of 0.06 seconds to come within 1% of the range (185.285 meters).

The Euler-Cromer method needed a time step of 0.07 seconds to come within 1% of the range (181.403 meters).

The Midpoint method did not stray more than 0.55% away from the range for any time step under 1 second. The error did not get progressivley smaller when I reduced the time step, or progessivley larger when I increased the time step, but jumped around. However, it was always much smaller than the error with the other two methods.

The graphs show the Euler method at tau = 0.06 seconds, the Euler-Cromer Method at tau = 0.07 seconds, and the Midpoint Method at tau = 0.7 seconds, which gave the largest error I could get of 0.55% (182.228 meters). The Midpoint method is clearly superior.

Veiw my MATLAB code for Euler-Cromer Method.

View my MATLAB code for Midpoint Method.


Problem 4. Batted Ball. I used the Euler Method, a time step of 0.1 seconds, initial position [0,1], initial velocity 110 mph (which is 49.1744 meters per second), and drag coeffient 0.35. I found the angle that gives the maximum range to be 39o, which gives a range of 125.8 meters. The graph shows the path of the ball at this optimum angle.

Veiw my MATLAB code for Projectile Motion depending on angle, with air resistance.

Return to Aubrey's George Mason University School Bag