Lord Crc
- 341
- 47
Hi,
it's been quite some years since I took some entry-level mechanics at uni, and my book is no longer with me, so I'm struggling a bit here.
I'm making a very simple rigid body simulator just for fun, but the angular velocity is not working out right. I suspect I've forgotten something crucial and basic. My setup is as follows: I've got a long rectangular box (stick) with dimensions w x h x d, and which has uniform density. The center of mass of the box is \vec{x}, and the orientation is given by the rotation angle \phi. I use simple Euler integration (for now) to find the linear velocity \vec{v} and angular velocity \omega.
I apply a force \vec{F} at some point \vec{r} at one end of the stick. Here both \vec{F} and \vec{r} are in the local (unrotated) frame centered at the center of mass of the box.
For the linear part I find the rotated force vector \vec{F}' by rotating \vec{F} by \phi, and then integrate \vec{x}_{t + \Delta t} = \vec{x}_t + \Delta t \vec{v}_t and \vec{p}_{t + \Delta t} = \vec{p}_t + \Delta t \vec{F}', and recover the linear velocity \vec{v}_{t + \Delta t} = \frac{1}{m} \vec{p}_{t + \Delta t}.
To find the torque I first find \tau = \| \vec{r} \times \vec{F} \|. Then I integrate \phi_{t + \Delta t} = \phi_t + \Delta t \omega_t and L_{t + \Delta t} = L_t + \Delta t \tau. I then recover the angular velocity \omega_{t + \Delta t} = I^{-1} L_{t + \Delta t} for use in the next timestep.
I calculate the moment as inertia as I = \frac{1}{12}m(w^2 + h^2), where the mass is given as m = \rho w h d and \rho is the density of the box.
The issue I have is that for a long stick the moment of inertia is so large compared to the mass (due to the w^2 h^2 terms) that even though I apply a constant tangential force at the end of the stick (\vec{F} stays constant in the local, unrotated frame) the stick hardly rotates. Instead the linear velocity increases and the stick translates as if I had applied the force very close to the center of mass.
I assume I've done some silly above, and would really appreciate if someone could point it out.
it's been quite some years since I took some entry-level mechanics at uni, and my book is no longer with me, so I'm struggling a bit here.
I'm making a very simple rigid body simulator just for fun, but the angular velocity is not working out right. I suspect I've forgotten something crucial and basic. My setup is as follows: I've got a long rectangular box (stick) with dimensions w x h x d, and which has uniform density. The center of mass of the box is \vec{x}, and the orientation is given by the rotation angle \phi. I use simple Euler integration (for now) to find the linear velocity \vec{v} and angular velocity \omega.
I apply a force \vec{F} at some point \vec{r} at one end of the stick. Here both \vec{F} and \vec{r} are in the local (unrotated) frame centered at the center of mass of the box.
For the linear part I find the rotated force vector \vec{F}' by rotating \vec{F} by \phi, and then integrate \vec{x}_{t + \Delta t} = \vec{x}_t + \Delta t \vec{v}_t and \vec{p}_{t + \Delta t} = \vec{p}_t + \Delta t \vec{F}', and recover the linear velocity \vec{v}_{t + \Delta t} = \frac{1}{m} \vec{p}_{t + \Delta t}.
To find the torque I first find \tau = \| \vec{r} \times \vec{F} \|. Then I integrate \phi_{t + \Delta t} = \phi_t + \Delta t \omega_t and L_{t + \Delta t} = L_t + \Delta t \tau. I then recover the angular velocity \omega_{t + \Delta t} = I^{-1} L_{t + \Delta t} for use in the next timestep.
I calculate the moment as inertia as I = \frac{1}{12}m(w^2 + h^2), where the mass is given as m = \rho w h d and \rho is the density of the box.
The issue I have is that for a long stick the moment of inertia is so large compared to the mass (due to the w^2 h^2 terms) that even though I apply a constant tangential force at the end of the stick (\vec{F} stays constant in the local, unrotated frame) the stick hardly rotates. Instead the linear velocity increases and the stick translates as if I had applied the force very close to the center of mass.
I assume I've done some silly above, and would really appreciate if someone could point it out.