Python Showing rotational trajectory with Python

AI Thread Summary
The discussion centers on visualizing the trajectory of a rotation on a unit sphere using a list of 3D angular velocities derived from a numerical solution to an ODE. Participants clarify that while three angular velocities are provided, only two are necessary for motion on the unit sphere. The conversation explores the idea of simulating motion through discrete updates of position vectors, emphasizing the use of the formula for angular velocity to determine the trajectory. Suggestions include creating a series of still images or a video to represent the motion effectively. Resources such as the Feynman Lectures on Physics are recommended for understanding the mathematical foundations of rotation.
Avatrin
Messages
242
Reaction score
6
Hi

I have a list of 3D angular velocities (a numerical solution to an ODE). I want to show the trajectory this rotation would cause by mapping it out on the unit sphere. How can I go about doing that? What is the best way to approach this?
 
Technology news on Phys.org
Okay, it looks like this may not be easy. Does anybody here have any suggestion regarding how I can show the trajectory of a rotation given the list of 3D angular velocities?
 
Isn't it simple like this:

If a body turns 1 degree in one second around x-axis, and during that same second it also turns 2 degrees around y-axis, then the new angles are: old x-angle + 1 , old y-angle + 2If the turning around the x-axis occurred mostly during the first half of the second and the turning around the y-axis occurred mostly during the last half of the second, that would be problematic.Oh yes, it was simple because I considered just one sample of the many different angular velocities.:smile:
 
Last edited:
I should've been clearer. I don't think your issue applies in this case... I have this:

\omega(t_n) = [\omega_x(t_n),\omega_y(t_n),\omega_z(t_n)]_{t_n \in I}

Here I = [0,a] for some real, positive number a is a closed interval. So, if, for some closed subinterval, the turning occurred along the x-axis before the y-axis, that information already is contained in my list.

Also, my initial condition for position is any point on the unit sphere. So, let's say the north pole. I want to see how the north pole moves around given the angular velocities I have available.
 
Avatrin said:
I have a list of 3D angular velocities (a numerical solution to an ODE). I want to show the trajectory this rotation would cause by mapping it out on the unit sphere.

If motion is constrained to the unit sphere, then three angular velocities is too many; motion on the unit sphere only requires two angles to specify it completely, so you should only have two angular velocities.
 
PeterDonis said:
If motion is constrained to the unit sphere, then three angular velocities is too many; motion on the unit sphere only requires two angles to specify it completely, so you should only have two angular velocities.
Well, technically, I am modelling the rotation of some rigid body. Let's be more specific:

It has a diagonal inertia matrix, and no external force is acting on it. So, together with some initial conditions, Euler's rotation equations gives me a system of ODE's which I can use to calculate its rotational motion. I have been tasked with visualizing the resulting motion in three dimensions... in a still image...

I am open for suggestions of other ways of doing this.
 
Avatrin said:
I have been tasked with visualizing the resulting motion in three dimensions... in a still image...

I'm not sure how one would visualize motion with a still image. Wouldn't you want to make a video? Or at least a succession of still images showing what the object looks like at a succession of times?

As for numerically simulating the motion, the simplest way is just to update the position vector of each point (or, since you have to discretize, each small piece) of the object at each time step, using the fact that the velocity of that point will be a sum of terms of the form ##\mathbf{\omega} \times \mathbf{r}##, where ##\mathbf{\omega}## is one of the angular velocity vectors (each such vector points along one of the three axes of rotation and has magnitude equal to the angular velocity about that axis) and ##\mathbf{r}## is the distance of the point from the axis of rotation for that angular velocity.
 
PeterDonis said:
I'm not sure how one would visualize motion with a still image. Wouldn't you want to make a video? Or at least a succession of still images showing what the object looks like at a succession of times?
Well, yeah, and that's my issue.. That's why I thought that visualizing the motion of a point on the surface of a sphere would do; It creates a trajectory which does show how a rigid body with the same center of mass would rotate given the same angular velocities...

PeterDonis said:
As for numerically simulating the motion, the simplest way is just to update the position vector of each point (or, since you have to discretize, each small piece) of the object at each time step, using the fact that the velocity of that point will be a sum of terms of the form ##\mathbf{\omega} \times \mathbf{r}##, where ##\mathbf{\omega}## is one of the angular velocity vectors (each such vector points along one of the three axes of rotation and has magnitude equal to the angular velocity about that axis) and ##\mathbf{r}## is the distance of the point from the axis of rotation for that angular velocity.
Hmm, I am not entirely sure what you mean. I am willing to try this out. What book or online lectures can I use to understand this?
 
Avatrin said:
That's why I thought that visualizing the motion of a point on the surface of a sphere would do; It creates a trajectory which does show how a rigid body with the same center of mass would rotate given the same angular velocities

Ah, I see. You could use the same method I described for just that one point to generate a trajectory; because the velocity is always perpendicular to the position, the point's distance from the center of the sphere will never change.

Avatrin said:
What book or online lectures can I use to understand this?

If the formula ##\mathbf{\omega} \times \mathbf{r}## doesn't already look familiar to you, you probably need to review the basic math of rotation. That formula just gives the velocity vector of a point at position ##\mathbf{r}## due to the angular velocity ##\mathbf{\omega}##. The treatment in the Feynman Lectures on Physics, Ch. 20 is pretty good (section 20.2 gives the formula I just gave, as well as other formulas involving cross products, which are helpful in simplifying the equations):

http://www.feynmanlectures.caltech.edu/I_20.html
 
  • Like
Likes Avatrin

Similar threads

Replies
10
Views
3K
Replies
8
Views
2K
Replies
1
Views
11K
Replies
8
Views
2K
Replies
1
Views
2K
Replies
4
Views
5K
Back
Top