Angular acceleration and velocity in 3D

In summary, the conversation discusses the use of quaternions for rotations and the rotational equations of motion. There are two ways to represent quaternions, left and right, and it is important to be aware of this when referencing books or papers. The rotational equations of motion involve attitude quaternion, rotation rate, and rotational acceleration, and it is convenient to represent angular velocity and acceleration in the body frame. The quaternion derivative can be used to propagate the quaternion, either through an exponential form or a linear approximation. However, it is important to normalize the quaternion after each time step to maintain its unit length. Additionally, it is advised to avoid using the Euler method for its lack of stability and accuracy.
  • #1
Alkatran
Science Advisor
Homework Helper
959
0
I'm trying to write a small rigid-body physics program. I already have the linear forces part done, using Euler's method. This makes it easy to take the current forces and compute the next position.

The issue I'm having is that I don't know how to get the next angular position/velocity from the current torques on the body. If I use quaternions for torque, velocity and orientation, do I just left-multiply my torque rotation quaternions together, then use that to rotate my velocity, then use that to rotate my position?
 
Physics news on Phys.org
  • #2
First, a word of caution regarding quaternions for rotations. There are many ways to do this. Quaternions can be represented by a scalar and an imaginary vector: [tex]\mathcal Q = \bmatrix q_s \\ \boldsymbol q_v \endbmatrix [/tex]

Suppose [tex]\mathcal Q[/tex] is a unit quaternion. Both of the following forms transform a vector in [tex]\mathbb R^3[/tex]:

[tex]\bmatrix 0 \\ \boldsymbol x_{rot}\endbmatrix =
\mathcal Q
\bmatrix 0 \\ \boldsymbol x \endbmatrix
\mathcal Q^\star
[/tex]

[tex]\bmatrix 0 \\ \boldsymbol x_{rot}\endbmatrix =
\mathcal Q^\star
\bmatrix 0 \\ \boldsymbol x \endbmatrix
\mathcal Q
[/tex]

The difference between the two forms is whether the the unconjugated quaternion is on the left or the right, hence the terminology left and right quaternions. Some people prefer left quaternions because they chain right to left, exactly the way transformation matrices chain (a good thing). Others prefer right quaternions because they chain left-to-right, which is intuitively more obvious. Those people see the right-to-left chaining of transformation matrices as goofy and something to be discarded. Both sides are often guilty of being unaware that there are two ways to do this. So beware. You have to scrutinize any books or papers you reference to make sure you and the reference are in sync.

BTW, I use left quaternions. They are by far the more prevalent form at NASA JSC. (Marshall uses right quaternions, so go figure.)

Now, about the rotational equations of motion. Denote the attitude quaternion, rotation rate, and rotational acceleration of some body with respect to inertial as [tex]\mathcal Q_{I\to B}[/tex], [tex]\boldsymbol \omega_{B:I\to B}[/tex], and [tex]\dot \boldsymbol \omega_{B:I\to B}[/tex]. The B: denotes that the vectors are expressed in the body frame rather than inertial. Vehicles need to know their angular velocity in their own frame, and torques typically arise in the body frame. It is very convenient to represent angular velocity and acceleration in the body frame. However, it is a rotating frame. Since the body frame is rotating, the angular acceleration includes a rotating frame term as well as terms from external torques.

The quaterion derivative is

[tex]\frac d{dt} \mathcal Q_{I\to B} =
-\;\frac 1 2\bmatrix 0 \\ \boldsymbol \omega_{B:I\to B}\endbmatrix
\mathcal Q_{I\to B}[/tex]

How to propagate? The above form obviously suggests an exponential form (using the quaternion exponential function!):

[tex]\mathcal Q_{I\to B}(t+\delta t) \approx
\exp\left(\frac d{dt} \mathcal Q_{I\to B}(t) \delta t\right)
\mathcal Q_{I\to B}(t)[/tex]

However, if the time steps are sufficiently small, a linear approximation can be used since the quaternion exponential behaves analogously to the complex and real exponential:

[tex]\mathcal Q_{I\to B}(t+\delta t) \approx
(1+\frac d{dt} \mathcal Q_{I\to B}\delta t) \mathcal Q_{I\to B}(t)[/tex]

One problem with this is that the result is not a unit quaternion. There is a simple solution: normalize the quaternion after each time step.

I will leave the second derivative as an excercise for the reader.

Another word of caution: If you are propagating the quaternion derivative (rather than angular velocity) will need to enforce the fact that the quaternion derivative is normal to the quaternion. The inner product of any constant length vector and its derivative is identically zero.

A final word of caution: Don't use the Euler method. It is never stable. It does not conserve energy. It loses accuracy incredibly quickly. It is easy to understand, which is why it is taught. Learn it and then never, ever, ever, ever use it.
 
Last edited:
  • #3


First of all, great job on completing the linear forces part of your physics program using Euler's method. As for the issue you are having with angular position and velocity, it sounds like you are on the right track by using quaternions. Quaternions are a useful tool for representing rotations in 3D space and can be used to calculate angular velocity and position.

To calculate the next angular position, you can indeed left-multiply your torque rotation quaternions together and use the resulting quaternion to rotate your current orientation quaternion. This will give you the updated angular position of your rigid body.

To calculate the next angular velocity, you can use the same approach by left-multiplying your torque rotation quaternions with your current angular velocity quaternion. This will give you the updated angular velocity.

It is important to note that quaternions are not commutative, meaning the order in which you multiply them matters. So make sure to use the correct order when calculating the updated angular position and velocity.

I would also recommend checking out other methods for calculating angular position and velocity, such as using matrix transformations or vector operations. It may be beneficial to compare and contrast these methods to determine which one is the most efficient and accurate for your program.

Overall, using quaternions for torque, velocity, and orientation is a valid approach for calculating angular acceleration and velocity in 3D. Keep experimenting and refining your program to achieve the best results. Good luck!
 

1. What is angular acceleration?

Angular acceleration is the rate at which the angular velocity of an object changes over time. It is measured in radians per second squared (rad/s²) in the SI system.

2. How is angular acceleration different from linear acceleration?

Angular acceleration is a measure of how an object's rotational speed changes, while linear acceleration is a measure of how its linear or straight-line speed changes. Angular acceleration is measured in radians per second squared (rad/s²), while linear acceleration is measured in meters per second squared (m/s²).

3. What is the difference between angular velocity and angular acceleration?

Angular velocity is a measure of how fast an object is rotating, while angular acceleration is a measure of how that rotational speed is changing. Angular velocity is measured in radians per second (rad/s), while angular acceleration is measured in radians per second squared (rad/s²).

4. How is angular acceleration calculated?

Angular acceleration can be calculated by dividing the change in angular velocity by the change in time. The formula for angular acceleration is α = (ω₂ - ω₁)/t, where α is the angular acceleration, ω₂ is the final angular velocity, ω₁ is the initial angular velocity, and t is the change in time.

5. How does angular acceleration affect an object's motion in 3D?

In 3D motion, an object's angular acceleration can cause it to rotate and change direction in all three dimensions. This can lead to complex and varied motion patterns, depending on the object's shape and the direction and magnitude of the angular acceleration.

Similar threads

Replies
3
Views
1K
Replies
2
Views
723
  • Mechanics
Replies
11
Views
2K
Replies
5
Views
951
Replies
15
Views
905
Replies
42
Views
4K
Replies
2
Views
736
  • Mechanics
Replies
17
Views
2K
Back
Top