Angular Momentum is not directionally conserved? (place file attached)

I understand that the magnitude of angular momentum is decreased over time to prevent energy leaks, but how conserved is the direction?

Of course, maybe I don’t understand angular momentum. But I’ve tried this 2 different ways and I get the same result. And I was under the impression that the vector of angular momentum is conserved.

Or maybe it’s that it’s just a hard problem to conserve it, and no engine has this, and if you limit the physics step delta to 0, it stays conserved.

I made a 2x4x1 part, and gave it a spin. I then printed out the unit of the current world-space angular momentum. This is what I got:

This is the code I wrote to get the current angular momentum. It returns the same value as the code I wrote that computes the moment of inertia in world space and multiplies by the rot velocity.

local v3 = Vector3.new
local cf = CFrame.new
local vtos = cf().vectorToObjectSpace
local vtws = cf().vectorToWorldSpace
local function getL(part)
    local c = part.CFrame
    local s = part.Size
    local m = part:GetMass()
    local w = vtos(c, part.RotVelocity)
    local sx, sy, sz = s.x, s.y, s.z
    local wx, wy, wz = w.x, w.y, w.z
    local l = v3(m/12*(sy*sy + sz*sz)*wx, m/12*(sx*sx + sz*sz)*wy, m/12*(sx*sx + sy*sy)*wz)
    local L = vtws(c, l)
    return L
end

angular momentum.rbxl (13.7 KB)

If you have a part such as a 2x1x4, you’ll have three distinct moments of inertia along each of the three axes. There’s a theorem that says if you’re rotating on the axis with the middlemost moment of inertia, your rotation will be unstable.and – from time to time – you’ll find inertia “just appear” along the other axes.

So, here is a script that explores this.

workspace.CurrentCamera.CFrame = CFrame.new(0, 50, 0) * CFrame.new(0, 5, -10);
workspace.CurrentCamera.Focus = CFrame.new(0, 50, 0)

local p = Instance.new("Part");
p.Size = Vector3.new(2, 1, 4);
p.Position = Vector3.new(0, 50, 0);
p.RotVelocity = Vector3.new(10, 0, .01); --Gotta have a slight perturbation, otherwise you'll be waiting a while for roblox's engine to create this perturbation naturally.

local pos = Instance.new("BodyPosition", p);
pos.Position = Vector3.new(0, 50, 0);
pos.P = p:GetMass() * workspace.Gravity;

p.Parent = workspace;

local indicator = Instance.new("Part");
indicator.Size = Vector3.new(.1, .1, 5);
indicator.CanCollide = false;
indicator.Anchored = true;
indicator.BrickColor = BrickColor.Red();
indicator.Parent = workspace;

game:GetService("RunService").Heartbeat:Connect(function()
	print(p.RotVelocity.unit);
	indicator.CFrame = CFrame.new(p.Position + p.RotVelocity.unit * indicator.Size.z/2, p.Position);
end);

So, you’ll see the above code imparts most of our rotational velocity around the x axis (which has the middlemost moment of inertia), and as a result, we get occasional inversions.

2018-09-27_20-11-46

If we change the size so it’s 4, 1, 2 and keep the RotVelocity the same, we’ll see no inversions:

2018-09-27_20-12-19

You can take my word for it that you get the same stable behavior for <1, 4, 2> (when you’re rotating around the axis with the highest moment).


This behavior, while I video’d it in studio, is a real world thing: https://www.youtube.com/watch?v=r-TnCMZF3fA

If you can, work around it by making sure your object has two or three equal moments. You will not get this behavior. Alternately, you can forsake realistic physics and go with BodyAngularVelocity or such. :slight_smile:


Fun fact! If you grip your phone by the short edge near the home button and flip it, you’ll see this behavior! Impress your friends!

7 Likes

I was under the impression that this effect only affected angular velocity and not angular momentum.

And actually I can’t find anything in the article explicitly stating that rotational momentum is not conserved.

Well, the moment of inertia along all three axes is constant, and the angular momentum is just the multiplication of angular velocity & moment.

However, you’re right when you say angular momentum is conserved. This is still true. It’s just the vector of rotation which changes. Here’s where the article calls this out explicitly.

|330x358

A visualization of the instability of the intermediate axis. The magnitude of the angular momentum and the kinetic energy of a spinning object are both conserved. As a result, the angular velocity vector remains on the intersection of two ellipsoids.

1 Like

Yeah I saw that but it’s not, like, really explicit. It implies that the direction changes by saying nothing about it and only that the magnitude is constant.

But yeah I thought through it, and it makes sense that a freely spinning body will torque itself. if you work out the math, you get that a rigid body of point masses with positions relative-to-center-mass r and masses m applies a torque to itself equal to

image

For anybody in the future who is wondering the same thing, in short:

  • An external torque is a torque applied by something outside the rigid body. (like a Torque object or a part that is not in the system of consideration)
  • An internal torque is a torque applied by the rigid body to itself.
  • Angular momentum is conserved only if there are neither external nor internal torques on the rigid body.
  • The magnitude of angular momentum is conserved if there are only internal torques on the rigid body.

Also this might be wrong

1 Like