import numpy as np g = 9.81 v_0 = 10 print('{:>3} {:>5} {:>4}'.format('t', 'v', 'h')) print('--- ----- ----') for t in np.linspace(0,2, 11): v = v_0 - g*t h = v_0*t - 0.5*g*t**2 print('{:3.1f} {:>5.2f} {:4.2f}'.format(t, v, h))
t v h --- ----- ---- 0.0 10.00 0.00 0.2 8.04 1.80 0.4 6.08 3.22 0.6 4.11 4.23 0.8 2.15 4.86 1.0 0.19 5.09 1.2 -1.77 4.94 1.4 -3.73 4.39 1.6 -5.70 3.44 1.8 -7.66 2.11 2.0 -9.62 0.38