diff --git a/experiment/newton/newton.py b/experiment/newton/newton.py index 79538f884bb531d18b615702ba1fec96158c5330..bd11c68b3b25f2e78c762c7ecdb0e7037e30e5a3 100644 --- a/experiment/newton/newton.py +++ b/experiment/newton/newton.py @@ -1,4 +1,5 @@ import numpy as np +import matplotlib.pyplot as plt time_pos = np.genfromtxt("input.txt", delimiter=",") @@ -16,3 +17,8 @@ vel_p1 = np.roll(vel, -1) acc = (vel_p1 - vel) / (time_p1 - time) # print(np.mean(acc[0:len(acc)-2])) +plt.plot(time[0:len(pos)], pos, label='position') +plt.plot(time[0:len(vel)-1], vel[0:len(vel)-1], label='velocity') +plt.plot(time[0:len(acc)-2], acc[0:len(acc)-2], label='acceleration') +plt.legend() +plt.show()