Sub topic 14
When the Ideal Model Fails: Air Resistance
This chapter assumes you know the ideal projectile equations from the earlier chapters: independent x and y motion, time of flight, maximum height, range, and the parabolic trajectory. You also need Newton's second law, F = ma, and basic Python for the code. The calculus is only a sketch. The simulation does the real work.
What the ideal model leaves out
The ideal model has one force on the projectile, gravity. In air there is a second force, drag, which always points opposite to the velocity. The ideal equations are accurate when drag is small compared with the weight. That holds for a shot put or a thrown rock. It does not hold for a badminton shuttlecock, a golf drive, or a fast baseball.
Drag changes more than the numbers. It breaks the structure that made the ideal solution easy:
- Horizontal velocity is no longer constant. Drag slows it.
- The x and y motions are no longer independent, because the drag force depends on the total speed, which mixes both components.
- The path is no longer a parabola.
- The closed-form formulas for range, height, and flight time no longer apply, so you integrate numerically.
Two common drag models
Drag grows with speed. Which law fits depends on the speed, the size of the object, and the fluid.
| Model | Acceleration from drag | Typical use | Column | Column |
|---|---|---|---|---|
| Linear | a = -b v | Very slow motion, small objects, thick fluids. Often solvable by hand. | ||
| Quadratic | a = -k \ | v\ | v | Everyday projectiles in air: balls, stones, arrows. |
In the quadratic model, the vector v gives the direction and |v| = √(vx² + vy²) gives the size. The drag acceleration has magnitude k|v|² and points opposite to the velocity. The coefficient is
k = ρ C_d A / (2m)
where ρ is the air density (about 1.2 kg/m³ at sea level), C_d is the dimensionless drag coefficient (about 0.3 to 0.5 for a ball), A is the cross-sectional area, and m is the mass. The unit of k is 1/m. The code in this chapter uses this quadratic form.
For a baseball with m = 0.145 kg, A = 0.0043 m², and Cd ≈ 0.35, k = (1.2 × 0.35 × 0.0043) / (2 × 0.145) ≈ 0.006 m⁻¹. Treat Cd as approximate, because it changes with speed and spin.
The equations of motion with drag
Apply Newton's second law along each axis, with gravity pointing down in y:
- ax = -k |v| vx
- ay = -g - k |v| vy
Both equations contain |v| = √(vx² + vy²). This is the coupling. If vy is large, for example just after launch, the horizontal drag is also large. You cannot solve the x equation without knowing vy, so the axes are no longer independent.
Terminal velocity
For an object falling straight down, drag grows as the object speeds up. At some speed the drag equals the weight, and the acceleration becomes zero. For quadratic drag:
k v² = g, so v_t = √(g / k)
For the baseball, v_t = √(9.81 / 0.006) ≈ 40 m/s, which is about 145 km/h. A baseball thrown downward faster than that would slow down. A skydiver in a belly-down position has a much smaller k·m⁻¹ ratio of area to mass and falls at about 55 m/s.
How drag changes the trajectory
For a launch from level ground, quadratic drag produces these systematic effects:
- Shorter range. Energy is removed continuously, so the projectile lands closer than the ideal formula predicts.
- Lower maximum height. Drag has a vertical component pointing downward while the projectile rises, which adds to gravity.
- Asymmetric path. The descent is steeper than the ascent, so the trajectory is not symmetric about the apex.
- Unequal times. The projectile takes longer to fall from the apex than it took to rise to it. On the way up, drag and gravity both point down. On the way down, drag points upward and partly cancels gravity.
- Lower impact speed. The projectile lands slower than it was launched. In the ideal model, the speed at landing on level ground equals the launch speed.
- A smaller best angle. The launch angle that gives the maximum range drops below 45°, typically to the region of 35° to 42° for ball-like objects. A lower, flatter launch spends less time at high altitude and less time exposed to drag on a long climb. Real air also thins with altitude, which slightly favors higher angles. Treat the drop below 45° as a trend, not a fixed value.
Solving numerically
Without a closed-form solution, you step the motion forward in small time increments. This is Euler integration. At each step:
- Compute the acceleration from the current velocity.
- Move the position using the current velocity.
- Update the velocity using the acceleration.
The function below does this and stops when the projectile crosses y = 0. It interpolates linearly between the last two points so the landing x is not biased by the final step overshooting the ground. It requires a launch angle above 0°.
import math
def simulate_range(v0, angle_deg, k=0.0, dt=0.001, g=9.81):
"""Euler integration of a projectile launched from y = 0.
k is the quadratic drag coefficient per unit mass (1/m); k = 0 is ideal.
Returns the horizontal distance at which the projectile returns to y = 0."""
theta = math.radians(angle_deg)
x, y = 0.0, 0.0
vx, vy = v0 * math.cos(theta), v0 * math.sin(theta)
while True:
speed = math.hypot(vx, vy)
ax = -k * speed * vx
ay = -g - k * speed * vy
x_new = x + vx * dt
y_new = y + vy * dt
vx += ax * dt
vy += ay * dt
if y_new < 0.0:
# Interpolate between the last point above ground and this one.
return x + (x_new - x) * y / (y - y_new)
x, y = x_new, y_new
v0 = 40.0
k_ball = 0.006
ideal_45 = v0**2 * math.sin(math.radians(90)) / 9.81
print(f"analytic ideal range at 45 deg: {ideal_45:.1f} m")
print("angle ideal(m) drag(m)")
for angle in range(20, 65, 5):
r0 = simulate_range(v0, angle, k=0.0)
r1 = simulate_range(v0, angle, k=k_ball)
print(f"{angle:5d} {r0:8.1f} {r1:7.1f}")
best = max(range(20, 65, 5), key=lambda a: simulate_range(v0, a, k=k_ball))
print(f"best angle on this 5-degree grid with drag: {best} deg")The k = 0 column should match the analytic range v0² sin(2θ)/g. For example, the 45° row should be close to 163.1 m. This comparison is your check on the code. If the ideal column disagrees with the formula, the integrator has a bug or the time step is too coarse.
The drag column should be clearly smaller at every angle. On this 5° grid, the best angle with drag should come out below the 45° of the ideal column. The grid is coarse, so refine it to see the exact value.
Choosing the time step
Euler's method has an error that scales roughly in proportion to dt. Halve dt and the error roughly halves. To test your result, run the simulation with dt = 0.001 and dt = 0.0005. If the ranges agree to the precision you need, the step is small enough. If not, shrink dt further or switch to a higher-order method such as the midpoint (RK2) or fourth-order Runge-Kutta method.
Common errors
- Applying drag to each axis separately. Writing ax = -k vx² and ay = -g - k vy² treats the axes as independent. The correct form uses the total speed in both equations.
- Wrong sign on the drag term. Drag opposes velocity. The term -k |v| vy is negative while rising and positive while falling, which is correct. Using -k |v|² for ay gives a downward force during descent, which is wrong.
- Using the ideal landing check. Stopping when y becomes negative and reporting that x overstates the range by up to one step. Interpolate, or use a very small dt.
- Mixing units for k. The k in this chapter is per unit mass and has units of 1/m. If you use ρ C_d A / 2 without dividing by m, it has units of kg/m, and the accelerations will be wrong.
- Reading the simulation as exact. A constant C_d ignores the way real drag coefficients change with speed, spin, and surface roughness. Spin also produces a sideways lift force (the Magnus effect), which this model does not include.
When to use which model
Use the ideal formulas when drag is below a few percent of the weight over the flight. This is a quick check: compare k v² with g at the launch speed. For the baseball, k v² = 0.006 × 40² = 9.6 m/s², about equal to g, so drag is not small and the ideal model is a poor approximation. For a dense, compact object such as a shot put, k is on the order of 0.0003 m⁻¹, so k v² at 13 m/s is only about 0.05 m/s², roughly 0.5% of g. The ideal model works well there.
Exercise
A ball has k = 0.01 m⁻¹ with quadratic drag. (a) What is its terminal speed in free fall? (b) At a launch speed of 20 m/s, compare k v² with g to decide whether the ideal model is reasonable.
Show answer
(a) At terminal speed, k v² = g, so v_t = √(g/k) = √(9.81 / 0.01) = √981 ≈ 31.3 m/s. (b) At 20 m/s, k v² = 0.01 × 400 = 4 m/s², which is about 40% of g. Drag is a large fraction of the weight, so the ideal model is not reasonable. Use a numerical simulation.
Exercise
In a drag simulation of a level-ground launch, the projectile rises for 1.8 s and then falls for 2.1 s. Is that consistent with the model, and what would the ideal model predict?
Show answer
It is consistent. With drag, the downward fall takes longer than the rise, because on the way up drag adds to gravity and on the way down it opposes gravity. The ideal model on level ground predicts equal rise and fall times, each 1.8 s in this case, and it would also give a symmetric path.
Exercise
You run simulate_range(30.0, 40.0, k=0.0) with dt = 0.001 and get 87.9 m. The analytic formula gives v0² sin(2θ)/g = 90.35 m. Is the code correct? Say what to check first.
Show answer
The code is probably wrong or the angle or formula was used incorrectly, because the difference is far larger than the expected Euler error with dt = 0.001, which is a fraction of a metre at most. Check the inputs first. sin(80°) = 0.9848, so 900 × 0.9848 / 9.81 = 90.35 m is correct, so the analytic value is right. Then check that the k = 0 branch uses the same g and that the angle is converted to radians. Also test with dt = 0.0001. If the result does not converge to 90.35 m, the integration loop has a bug.