# Vehicle acceleration

What I'm essentially doing is Kalman Filter. If anyone is familiar with (but it doesn't really matter in this case). Consider the following formulas:

$$x_k=x_{k-1}+v_{k-1}dt+a_{k-1}\frac{dt^2}{2}$$

$$v_k=v_{k-1}+a_{k-1}dt$$

$$a_k=a_{k-1}$$

where $p$ is position, $v$ is velocity and $a$ is acceleration. The above model represents the movement of a vehicle... Why is acceleration taken into account, both in position and velocity? And why is it in position $\frac{dt^2}{2}$?

-
This looks like a velocity verlet. Not for the position but velocity. en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet – huseyin tugrul buyukisik Sep 3 '12 at 6:59
Are you making a simulator? – huseyin tugrul buyukisik Sep 3 '12 at 7:00
Hm, so this is purely mathemathic/physic - no intuitive explanation what that does? No, I'm just learning Kalman Filter and need to know the model. – Primož Kralj Sep 3 '12 at 7:04
Lubos gives a physical answer below, but the second order correction $a_k\,dt^2/2$ may also help the Kalman filter - I'm guessing $a$ is a parameter being estimated by the filter? – WetSavannaAnimal aka Rod Vance Sep 24 '13 at 14:01

## 1 Answer

As written down, your code describes a motion with constant acceleration (see $a_k=a_{k-1}$), so the trajectory will simply be a quadratic function (parabola).

Every moment $dt$, the velocity changes by the obvious amount, $dt\cdot a$. The same is true for position which changes by $dt\cdot v$ but there is an extra piece $a/2\cdot dt^2$ in the change of the position. This term is infinitely smaller than the main term, $dt\cdot v$, and if $dt$ is short enough, you may neglect it.

However, if you include it, you get a higher accuracy of the simulation even if $dt$ isn't too small. Why? Because the change of the position $p$ during the time $dt$ is calculated as $dt$ times the average velocity in this short time interval. And because the velocity is changing approximately linearly, the average velocity is $$\overline v = \frac{v(t)+v(t+dt)}{2} = \frac{v(t)+v(t)+a(t)dt}{2} = v(t)+\frac{a(t)dt}{2}$$ If you multiply this $\overline v$ by $dt$, you get the change of the position $p$ as incorporated to your first equation.

-
So with that part you basically compensate for the error that is produced by averaged velocity? – Primož Kralj Sep 3 '12 at 7:23
With that part, we change the position by $dt\cdot \overline v$ where $\overline v$ is the average velocity over the following interval $dt$, while if we had omitted the extra term, we would be using the initial velocity of the interval, one which will be somewhat inaccurate at the end of the interval. – Luboš Motl Sep 3 '12 at 7:41