I am currently coding something with a moving object and can't figure out the physics with my school knowledge only. I hope this question is not below the standards of this forum.

I have a moving object at ($x_0, y_0, \theta_0, v_0, \omega_0$), where $x$ and $y$ are the 2D-coordinates, $\theta$ the angle (to the x axis), $v$ the forward velocity and $\omega$ the angular velocity.

I want to accelerate the object with a forward acceleration of $a$ and an angular acceleration of $\alpha$ and I want to calculate the new position after a time $\Delta t$.

If $\alpha = 0$ (just as an intermediate step), the new state should be $$ x_1 = x_0 + \Delta t (v_0 \cos \theta_0) + 0.5 a (\Delta t^2) \\ y_1 = y_0 + \Delta t (v_0 \sin \theta_0) + 0.5 a (\Delta t^2) \\ \theta_1 = \theta_0 + \omega_0 \Delta t \\ v_1 = v_0 + a \Delta t \\ \omega_1 = \omega_0 $$ I am not sure if this is correct, but this is all I have. And I can't figure out how to add the angular acceleration to this equations, and I guess $\omega$ should be in the equations for $x$ and $y$ too.

  • $\begingroup$ the correct way is to calculate them separately as you have done. but be careful to differentiate linear v and a from angular v and a. $\endgroup$
    – gregsan
    Jan 17 '14 at 13:26
  • $\begingroup$ The rotational kinematics are identical in form to the linear kinematics. $\endgroup$
    – Kyle Kanos
    Jan 17 '14 at 13:30
  • $\begingroup$ So just $$ \theta_1 = \theta_0 + \omega_0 \Delta t + 0.5 \alpha (\Delta t)^2 \\ \omega_1 = \omega_0 + \alpha \Delta t $$ and the rest as before? No $\omega$ in the equations for $x_1$ and $y_1$? The plain $\theta_0$ in these ($x_1$,$y_1$-)equations seems to me like it is not correct. $\endgroup$
    – petertex
    Jan 17 '14 at 13:34
  • $\begingroup$ Vectors are your friends. $\endgroup$ Jan 17 '14 at 14:37
  • $\begingroup$ Is the object following a 1D path (like a line or curve) or is it free on the 2D plane? $\endgroup$ Jan 17 '14 at 14:49

You need to keep track of 3 coordinates (2 positions and 1 rotation) and their derivatives. What you are missing is current velocity vector (2 components) which is not necessarily along the orientation direction unless constrainted to do so.

Your best best is a simplectic integrator such as

$$\begin{aligned} \begin{pmatrix} vx_1 \\ vy_1 \\ \omega_1 \end{pmatrix} & = \begin{pmatrix} vx_0 \\ vy_0 \\ \omega_0 \end{pmatrix} + \begin{pmatrix} a \cos\theta_0 \\ a\sin\theta_0 \\ \alpha \end{pmatrix} \Delta t \\ \begin{pmatrix} x_1 \\ y_1 \\ \theta_1 \end{pmatrix} & = \begin{pmatrix} x_0 \\ y_0 \\ \theta_0 \end{pmatrix} + \begin{pmatrix} vx_1 \\ vy_1 \\ \omega_1 \end{pmatrix} \Delta t \\ t_1 & = t_0 + \Delta t \end{aligned}$$

and take small steps to make it appear smooth. The above will not artificially add energy to the system like an Euler integrator does. The difference is to take the velocity step first and then use the new velocity in the position step.

If the acceleration is constant for the entire step, the exact equations are

$$\begin{pmatrix} x_1 \\ y_1 \\ \theta_1 \end{pmatrix} = \begin{pmatrix} x_0 \\ y_0 \\ \theta_0 \end{pmatrix}+ \frac{1}{2} \begin{pmatrix} vx_0 \\ vy_0 \\ \omega_0 \end{pmatrix} \Delta t + \frac{1}{2} \begin{pmatrix} vx_1 \\ vy_1 \\ \omega_1 \end{pmatrix} \Delta t \\$$

the problem with this is that typically the constant acceleration is a bad assumption.

  • $\begingroup$ Am I correct that this is an approximation? I guess the exact equations may be too difficult? $\endgroup$
    – petertex
    Jan 19 '14 at 12:56
  • $\begingroup$ Exact equations exist if the acceleration is constant for entire time step. If that is the case always, you want an Euler integrator. $\endgroup$ Jan 19 '14 at 19:39
  • $\begingroup$ I thought a constant acceleration would be a good approximation? Anyway, in your second equation, as the acceleration is constant, one has to replace $vx_1$ with $a \Delta t$ and it should work? $\endgroup$
    – petertex
    Jan 20 '14 at 17:14
  • $\begingroup$ In real life acceleration is never constant and numerically it adds energy to the system when it is not needed. $\endgroup$ Jan 20 '14 at 18:00
  • $\begingroup$ The distance for constant acceleration is $x_1 = x_0 + v_0 \Delta t + \frac{1}{2} a \cos \theta_0 \Delta t^2$ and similarly for the other coordinates. For speed it is $vx_1 = vx_0 + a \cos \theta_0 \Delta t$ and similarly for the other speeds. $\endgroup$ Jan 20 '14 at 18:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.