A ball is thrown straight upward from ground level with (here is taken positive upward)
PHYSICS · Multi-part · Fermi University Physics · Computational Physics · Mechanics & Dynamical Systems · Kinematics and Newtonian dynamics of particles
Computational Physics, Ch A falling body that knows about air: the first simulation
Problem
A ball is thrown straight upward from ground level with v0=20ms−1 (here v is taken positive upward), mass m=0.060kg, and quadratic drag b=0.00090kgm−1 that opposes whichever way it is moving. Someone writes the following, intending the loop to stop when the ball comes back down through the ground (y<0) or after a generous safety time tmax=200s: (line 1) t, y, v = 0.0, 0.0, v0 (line 2) for n in range(round(t_max/dt)): (line 3) a = -(b/m)*v*abs(v) (line 4) v_new = v + a*dt (line 5) y = y + v*dt (line 6) v = v_new (line 7) t = t + dt (line 8) if y < 0.0: (line 9) break. Run with Δt=0.2s, the first rows of (t,y,v) are (0,0,20.00), (0.2,4.00,18.80), (0.4,7.76,17.74), (0.6,11.31,16.80) in seconds, metres and ms−1; the run continues with v falling more and more slowly and y still climbing, and it is only cut off by the safety cap at t=200s, with y still positive and rising.
((a)) Identify the line that is missing a piece of physics, and say what it should read.
((b)) Explain, from the table, why the loop never reaches y<0 before the safety cap intervenes.