Jump to content
  • Advertisement
Sign in to follow this  
Cybrosys

Simple stick physics question :)

This topic is 4163 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Since i'm bored out of my mind, i descided to try and tackle physics. To write the most simplest of implementations of a sphere rolling, the rotation of the surface, cubes.. and such. But, for starters i was just thinking about a stick. Let's say it's angled at 45 degress, one end firmly on the ground. Gravity is going to push down the upper and lower part of the stick, the problem is that the lower part can't move downwards to match the upper, the upper stick is going to exhert a force down the shaft of the stick. What i'm wondering, is how much force is going to be exhert down the shaft towards the lower end of the stick? Let's say there's no friction so the other end is going to shoot sideways instead because the height force is being nullified by the ground. So, in other words: the bottom part of the stick will shoot to the side while the top end of the stick will drop to the ground. The distance between the two points can never change. So to recap, F=a*m (m = 1 for the stick), the top part is being dragged down with the force of gravity, but how much of this force is being exherted downwards through the shaft? F*dot product of the shaft vector and gravityvector? In other words, at 45 degrees -> 50%?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Cybrosys
But, for starters i was just thinking about a stick. Let's say it's angled at 45 degress, one end firmly on the ground. Gravity is going to push down the upper and lower part of the stick, the problem is that the lower part can't move downwards to match the upper, the upper stick is going to exhert a force down the shaft of the stick. What i'm wondering, is how much force is going to be exhert down the shaft towards the lower end of the stick?


While this is technically true, this probably isn't how you want to think about it. For a game especially, you're probably going to treat your stick like a rigid body.

Gravity then would be applied to the center of mass for the stick. The normal force of the ground pushing up on the stick is going to cause a torque on the stick, causing it to twist (the angle will decrease from 45 degrees to something smaller).

If you wanted to solve this analytically, you'd set the point touching the ground as the fulcrum, and then your gravity on the center of mass becomes a torque causing force. It should be pretty easy from that to determine a path for the stick.

If you were to do something like this in a game, it gets a little messier, as you'd need to find the velocity of the contact point on the stick touching the ground, solve the collision with the ground, and reverse engineer your changes in linear and angular momentum.

These are good articles. Article 3 covers collisions.

Share this post


Link to post
Share on other sites
Quote:
Original post by Numsgil
If you wanted to solve this analytically, you'd set the point touching the ground as the fulcrum, and then your gravity on the center of mass becomes a torque causing force. It should be pretty easy from that to determine a path for the stick.


Except that it isn't that easy, since you can't move the fulcrum to the contact point :). The problem is that the contact point is moving (in an accelerated fashion even) if the stick is on slippery ground (as the OP suggested) - your frame of reference becomes non-inertial and you would have to take into account system (fictious) forces - which gets pretty messy pretty quick (you get a very nasty looking second degree differential equation).

A better approach would be to first notice a few things: 1. If there is no friction the contact force from the ground is always completely vertical, and 2. The "bottom" of the stick can't penetrate the ground, but there is no reason for it to lift off of the ground either - it always stays in contact with the ground, which means that it is only moving horizontally.

From these two observations it follows: 1. Since there is no external force acting in the horizontal direction the center of mass of the stick moves only in the vertical direction (it doesn't move sideways!), and 2. Since the force of the ground on the contact point is always perpendicular to the direction of movement of the contact point, the force of the ground doesn't generate any work (the force of the ground doesn't change the total energy of the system=stick!).

If we take into account these facts, then we can easily write:
1. If we write the height of the center of mass as "h", the length of the stick as "l" and the angle between the ground and stick as "Phi", then we can say:
h=(l/2)*Sin(Phi),
and
2. if we write the angle Phi at the start of the experiment (when the stick wasn't yet moving) as "Phi0", and the height "h" at that same time as "h0", the mass of the stick as "m", and it's moment of inertia around the center of mass as "J" (J=1/12*m*l2), the velocity of the center of mass as "v" and angular rotation velocity of the stick around its CoM as "Omega", and time as "t", we can say:
Wk=ΔWp

1/2*m*v2+1/2*J*Omega2=m*g*(h0-h) ; v=(l/2)*Cos(Phi)*Omega

Omega2*((l/2)2*Cos2(Phi)+J/m)=g*l*(Sin(Phi0)-Sin(Phi)) ; Omega=dPhi/dt

(dPhi/dt)2*((l/2)2+Cos2(Phi)+J/m)/(Sin(Phi0)-Sin(Phi))=g*l

Integrate[Sqrt(((l/2)2+Cos2(Phi)+J/m)/(Sin(Phi0)-Sin(Phi)))*dPhi, Phi0, Phi] = Sqrt(g*l)*t


Unfortunately it turns out that the above definite integral is unsolvable (at least Mathematica can't solve it!) :(.

But just as an exercise, if it were possible to solve it, you would then do the following to answer your question:
1. Express "Phi" as a function of "t" (you need to solve the above integral to do this),
2. Use h=(l/2)*Sin(Phi) to express "h" as a function of "t",
3. Differentiate "h" with respect to time "t" twice, to get the acceleration of the CoM "a",
4. Note the following relation (if we write the force of the ground as "Fn"):
a=g-Fn/m
Fn=m*(g-a)

5. To get the component of the force "Fn" acting in the direction of the stick ("Fshaft"), use the following: Fshaft=Fn*Cos(Phi)

Since you have already expressed both "Fn" and "Phi" as functions of time "t", you have just found "Fshaft" at any time "t", and hence solved your problem (if you managed to solve the integral in step 1 of course ;) ).

In conclusion: Your "simple" physics question turns out to be in fact quite far from being simple :).


P.S.
There might be other ways to solve this problem, but I really can't think of any way to get around solving either a nasty looking differential equation (system forces and other nasty things), or a "simple" one (one that you can turn into a definite integral) but which has no analytic solution. The problem is that the constraints are inherently position based (the bottom of the stick can't penetrate the ground), so you must at some point invoke the position ("Phi" or "h") but which as I have demonstrated you can't find analytically (though, as always, I could be wrong...).

P.P.S.
The "nasty" equation I was talking about is the following (define: Omega=dPhi/dt, Alpha=dOmega/dt=d2Phi/dt2):
Alpha*(J-(l/2)*Sin2(Phi)) - (l/4)*Sin(2*Phi)*Omega2 - m*g*Cos(Phi) = 0

[Edited by - Devilogic on July 25, 2007 7:07:30 AM]

Share this post


Link to post
Share on other sites
You could also model this using rigid constraints and handling the collisions using the projection and relaxation method described in the Advanced Character Physics article from a few years ago. This isn't as physically accurate as the analytical approach using rigid body dynamics, but it can be good enough for certain purposes in a game.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!