- #1
Lord Crc
- 343
- 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 [itex]\vec{x}[/itex], and the orientation is given by the rotation angle [itex]\phi[/itex]. I use simple Euler integration (for now) to find the linear velocity [itex]\vec{v}[/itex] and angular velocity [itex]\omega[/itex].
I apply a force [itex]\vec{F}[/itex] at some point [itex]\vec{r}[/itex] at one end of the stick. Here both [itex]\vec{F}[/itex] and [itex]\vec{r}[/itex] 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 [itex]\vec{F}'[/itex] by rotating [itex]\vec{F}[/itex] by [itex]\phi[/itex], and then integrate [itex]\vec{x}_{t + \Delta t} = \vec{x}_t + \Delta t \vec{v}_t[/itex] and [itex]\vec{p}_{t + \Delta t} = \vec{p}_t + \Delta t \vec{F}'[/itex], and recover the linear velocity [itex]\vec{v}_{t + \Delta t} = \frac{1}{m} \vec{p}_{t + \Delta t}[/itex].
To find the torque I first find [itex]\tau = \| \vec{r} \times \vec{F} \|[/itex]. Then I integrate [itex]\phi_{t + \Delta t} = \phi_t + \Delta t \omega_t[/itex] and [itex]L_{t + \Delta t} = L_t + \Delta t \tau[/itex]. I then recover the angular velocity [itex]\omega_{t + \Delta t} = I^{-1} L_{t + \Delta t}[/itex] for use in the next timestep.
I calculate the moment as inertia as [itex]I = \frac{1}{12}m(w^2 + h^2)[/itex], where the mass is given as [itex]m = \rho w h d[/itex] and [itex]\rho[/itex] 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 [itex]w^2[/itex] [itex]h^2[/itex] terms) that even though I apply a constant tangential force at the end of the stick ([itex]\vec{F}[/itex] 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 [itex]\vec{x}[/itex], and the orientation is given by the rotation angle [itex]\phi[/itex]. I use simple Euler integration (for now) to find the linear velocity [itex]\vec{v}[/itex] and angular velocity [itex]\omega[/itex].
I apply a force [itex]\vec{F}[/itex] at some point [itex]\vec{r}[/itex] at one end of the stick. Here both [itex]\vec{F}[/itex] and [itex]\vec{r}[/itex] 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 [itex]\vec{F}'[/itex] by rotating [itex]\vec{F}[/itex] by [itex]\phi[/itex], and then integrate [itex]\vec{x}_{t + \Delta t} = \vec{x}_t + \Delta t \vec{v}_t[/itex] and [itex]\vec{p}_{t + \Delta t} = \vec{p}_t + \Delta t \vec{F}'[/itex], and recover the linear velocity [itex]\vec{v}_{t + \Delta t} = \frac{1}{m} \vec{p}_{t + \Delta t}[/itex].
To find the torque I first find [itex]\tau = \| \vec{r} \times \vec{F} \|[/itex]. Then I integrate [itex]\phi_{t + \Delta t} = \phi_t + \Delta t \omega_t[/itex] and [itex]L_{t + \Delta t} = L_t + \Delta t \tau[/itex]. I then recover the angular velocity [itex]\omega_{t + \Delta t} = I^{-1} L_{t + \Delta t}[/itex] for use in the next timestep.
I calculate the moment as inertia as [itex]I = \frac{1}{12}m(w^2 + h^2)[/itex], where the mass is given as [itex]m = \rho w h d[/itex] and [itex]\rho[/itex] 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 [itex]w^2[/itex] [itex]h^2[/itex] terms) that even though I apply a constant tangential force at the end of the stick ([itex]\vec{F}[/itex] 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.