我正在try 一个项目,以整合加速度数据,以便有一个近似值的位置.我首先使用了一组非常简单的数据,并保持恒定的加速度.
from scipy.integrate import cumtrapz
t = [0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7]
a = [-9.8, -9.8, -9.8, -9.8, -9.8, -9.8, -9.8, -9.8, -9.8, -9.8, -9.8, -9.8, -9.8, -9.8, -9.8]
v = cumtrapz(a, t, initial=0)
z = cumtrapz(v, t, initial=5)
The result is quite satisfying, apart from the fact that the initial condition for the position is only respected for the first value, and I don't understand how I can change this ?