Below we compute and plot velocity and height of the ball during its motion. This shows that the ball reaches the highest point of about 5 meters approximately one second after being thrown up. At that time ball velocity changes from positive to negative.

In [1]:
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
import matplotlib.pyplot as plt
import numpy as np

def ball_height(t, v_0=10):
    g = 9.81
    return v_0*t - 0.5*g*t**2

def ball_velocity(t, v_0=10):
    g = 9.81
    return v_0 - g*t

print('{:>3}  {:>5}  {:>4}'.format('t', 'v', 'h'))
print('---  -----  ----')
for t in np.linspace(0,2, 11):
    v = ball_velocity(t)
    h = ball_height(t) 
    print('{:3.1f}  {:>5.2f}  {:4.2f}'.format(t, v, h))  
    
t = np.linspace(0,2)
plt.figure(figsize=(4,2))

ax = plt.subplot(111)
plt.plot([1,1], [-10, 10], 'k:')
plt.plot(t, ball_velocity(t), 'r-', label='h')
plt.xlabel('time (sec)')   
plt.ylabel('velocity (m/s)', color='r') 

ax2 = ax.twinx()
plt.plot(t, ball_height(t), label='v')
plt.xlabel('time (sec)', fontsize=8)   
plt.ylabel('height (meters)', color='b') 

plt.title('Height and velocity vs time (v$_0$ = 10 m/s)', fontsize=10)
plt.show()
  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