A problem with rotational dynamics

In summary, the conversation discusses the use of a "perpendicularized vector" in calculating angular momentum and torque. It is suggested that this may be a roundabout way of obtaining the usual equations for these quantities. The conversation also touches on using polar vs. cartesian coordinates and the confusion with applying the concepts in code. Ultimately, the formula ||\vec N|| = \sqrt{ (\vec r \cdot \vec r)(\vec F \cdot \vec F)-(\vec r \cdot \vec F)^2} is recommended for calculating torque without having to find the angle.
  • #1
g9icy
5
0
Greets all, I'm attempting to build a small physics engine that manages linear and angular forces. Please bear with me while I explain the problem I'm having.

Linear forces so far have not been an issue at all, however rotational forces are rather confusing.

I'm using Chris Hecker's rigid body dynamics articles (http://chrishecker.com/Rigid_Body_Dynamics) for my rotational dynamics, and its within his equations I've come across something I don't understand.

For his equation to work out the torque being applied to the center of mass of an object, he uses a "perpendicularised-vector", and this is what I fail to understand.

He uses the equation (to work out the angular momentum):
Picture 1.png


The superscript A and B means the position of object A (its center of mass) and object B (or the point a force is being applied to). The brackets mean the dot (product) symbol, and p is linear momentum.

Now here's what I'm trying to do: I have an object in 2d space, that has "engines" at specific points. When an engine fires at a point directly behind the object (for example, the back of a space ship) there should be no rotational force because the force is applied in the same direction as the distance vector from the object.

Now, in the above equation, how is the perpendicularised vector r actually calculated? It appears it needs to generate another vector and then retrieve a dot product of that vector and p, but I don't know how to generate a new vector from what I have. In a following equation the equation above is used but uses a force vector instead of p, which makes more sense but still leaves me with the same problem.

Thanks for taking the time to read this, I know it was probably a bit long winded just to ask a simple question. :)
 
Physics news on Phys.org
  • #2
It sounds like using the "perpendicularized vector" is just a roundabout way of obtaining the usual equation for angular momentum:

[tex] \vec L = \vec r \times \vec p [/itex]

where r is the ordinary vector of displacement of the particle from the center of rotation, p is the momentum, and x is the cross product. There may be a computational reason for doing it his way, but the simple, physical way to calculate torque is by:

[tex] \vec N = \vec r \times \vec F [/itex]

Where N is the torque vector, with magntiude the amount of torque, and the direction of N is in the axis about which the rotation is applied. In 2D, this direction is always "pointing out of the page", so all that matters is the length, given by:

[tex] N = rF \sin \theta [/tex]

where [itex]\theta[/itex] is the angle between the r and F vectors. A formula that might be more useful is given by the identity:

[tex] || \vec A \times \vec B||^2 = (\vec A \cdot \vec A)(\vec B \cdot \vec B)-(\vec A \cdot \vec B)^2 [/tex]
 
Last edited:
  • #3
Thanks for the reply. The equation:
rFsin0
is definitely what I needed.

Now I'm having a bit of an issue with the vectors involved with calculating theta.

In my app, all vectors are defined in component form.
Say I have my rectangular object at (its center of mass, that is):
position.x = -300
position.y = -20

with a width of 80 and a height of 50. Now if I applied a force at:
f.x = -340
f.y = -20

the resulting distance from the center of my object would be 40. So now I have the vectors of where the force was applied and how far away from position. If I'm thinking correctly, the resulting angle would be 0, and there would be no rotation. But what values and calculation do I use to get this angle?

I understand there is a cos calculation, but I'm not sure what using.

Thanks for any help, I think I'm unable to see the wood for the trees in this case.
 
  • #4
The last formula I gave should help. Plugging in r and F:

[tex] ||\vec N|| = \sqrt{ (\vec r \cdot \vec r)(\vec F \cdot \vec F)-(\vec r \cdot \vec F)^2} [/tex]

Which avoids having to calculate the angle. This is dervied as follows:

[tex] || \vec A \times \vec B||^2 = ||\vec A||^2 ||\vec B||^2 \sin^2 \theta=||\vec A||^2 ||\vec B||^2(1-\cos^2 \theta) [/tex]

[tex] =||\vec A||^2 ||\vec B||^2-(||A|| ||B|| \cos \theta)^2 [/tex]

[tex]= (\vec A \cdot \vec A)(\vec B \cdot \vec B)-(\vec A \cdot \vec B)^2 [/tex]
 
  • #5
Thank you for your help.

When referring to the r and F vectors, I understand that you mean the vectors of the radius (from the center of mass to the point of collision) and Force.

However, I'm unsure what qualifies as "r" and "F" in my code.
My failure of understanding is not in the calculation, you've been more than helpful there, it's applying the figures I have into the equations. More of an issue with vectors themselves.

What I mean is, how do I use "radius" as a vector, and "Force" as a vector?
I have the center of mass, the radius to the point and the point of collision (both vectors in component form remember) and a magnitude of force (in Newtons).

How would these form together to produce the vectors r and F?

In my understanding, F would be the point of collision, but I'm unsure about r.

Am I to form the vectors in polar form and not cartesian?

This is probably a very basic problem, but I'm teaching myself much of the fundamentals of physics and the math as I go, so please be patient. :)
 
  • #6
g9icy said:
Thanks for the reply. The equation:
rFsin0
is definitely what I needed.

Now I'm having a bit of an issue with the vectors involved with calculating theta.

In my app, all vectors are defined in component form.
Say I have my rectangular object at (its center of mass, that is):
position.x = -300
position.y = -20

with a width of 80 and a height of 50. Now if I applied a force at:
f.x = -340
f.y = -20

the resulting distance from the center of my object would be 40. So now I have the vectors of where the force was applied and how far away from position. If I'm thinking correctly, the resulting angle would be 0, and there would be no rotation. But what values and calculation do I use to get this angle?

I understand there is a cos calculation, but I'm not sure what using.

Thanks for any help, I think I'm unable to see the wood for the trees in this case.

Stick with vectors! If r is the position of the force relative to the body's centre of mass and F is the force vector then the torque vector is

T = r x F

using the vector cross product. If r and F are in the same direction then this product will be essentially the 0 vector and so this force will produce no net torque though it may linearly move the centre-of-mass if unbalanced.

To compute these values, let x be the vector position of the centre of mass, and p be the vector position of the point of impact. Then naively r = p-x. HOWEVER...

...It's important to keep everything in the right coordinate system. The torque needs to be computed in the frame of the object, so if F' is the force vector in the world system then you need to compute F = WF' where W is the inverse of the transform matrix of the body. Similarly r needs to be transformed from r'=p-x st r = Wr'. So you can bundle this all up as

T = W(r x F).
 
Last edited:
  • #7
I always steered away from using the cross product as I'm working in 2d at the moment, but I will work on what I have soon and report on my progress. (i'm in work atm :))

Thanks for you help.
 
  • #8
The cross product is the same in 2dimensions as it is in 3 except it is minus one direction. It really is the easiest way to go.
 
  • #9
Thanks everyone that helped me on this.

Once I realized r = force-center_of_mass everything fit into place and all the equations finally made sense.

I now have an excellent system whereby the objects rotate (and transform) based entirely on where forces hit it, as it should be.

Thanks again all.
 

Related to A problem with rotational dynamics

1. What is rotational dynamics?

Rotational dynamics is the branch of mechanics that studies the motion of objects that rotate around a fixed axis. It involves understanding how forces and torques affect the rotational motion of an object.

2. What is the difference between rotational and translational motion?

Rotational motion involves objects moving around a fixed axis, while translational motion involves objects moving in a straight line. Rotational motion is also described by angular displacement, velocity, and acceleration, while translational motion is described by linear displacement, velocity, and acceleration.

3. How is torque related to rotational dynamics?

Torque is a measure of the force that causes an object to rotate around an axis. In rotational dynamics, torque is responsible for changing an object's angular momentum, and therefore, its rotational motion.

4. What is the moment of inertia and how does it relate to rotational dynamics?

The moment of inertia is a measure of an object's resistance to rotation. It is affected by an object's mass, distribution of mass, and the axis of rotation. In rotational dynamics, the moment of inertia is used to calculate an object's angular acceleration.

5. What are some real-world applications of rotational dynamics?

Rotational dynamics has many practical applications, including understanding the motion of spinning objects such as tops and gyroscope, analyzing the motion of celestial bodies, and designing machines and vehicles that involve rotational motion, such as bicycles, motors, and turbines.

Similar threads

Replies
1
Views
530
  • Mechanics
Replies
7
Views
1K
Replies
2
Views
828
Replies
9
Views
1K
Replies
4
Views
957
Replies
3
Views
809
Replies
2
Views
705
Replies
1
Views
763
Back
Top