Showing rotational trajectory with Python

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
8 replies · 3K views
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?
 
Physics 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:

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

Here [itex]I = [0,a][/itex] 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   Reactions: Avatrin