I have a task where I have to find at what time a runner passes the 100m mark. I made a plot, but how can I choose out a point on the y-axis and make the program tell me what value on the x-axis corresponds to it?
import numpy as np
import matplotlib.pyplot as plt
t = np.linspace(0,7, 71)
dt = t[1] - t[0]
n = len(t)
a = np.zeros(n, float)
x = np.zeros(n, float)
v = np.zeros(n, float)
a[0] = 0.0
x[0] = 0.0
v[0] = 0.0
for i in range(0, n-1):
a[i] = 5 - (0.34911*v[i]**2)/80
v[i+1] = v[i] + a[i]*dt
x[i+1] = x[i] + v[i]*dt
plt.subplot(3,1,1)
plt.plot(t,x)
plt.xlabel('t [s]')
plt.ylabel('x [m]')
plt.subplot(3,1,2)
plt.plot(t,v)
plt.xlabel('t [s]')
plt.ylabel('v [m/s]')
plt.subplot(3,1,3)
plt.plot(t,a)
plt.xlabel('t [s]')
plt.ylabel('a [m/s^2]')
plt.show