I’ve been trying to see if I can model balls rolling on curved surfaces and I think I’ve cracked it. Here’s a teaser to get you interested:

What you see is a sphere rolling on a curved surface. The blue line is the path of the contact point and the orange line is the path of the center of the ball. What that ball is doing is called “rolling without slipping” which just means that the contact point doesn’t slide at all. In fact, the part of the ball in contact with the surface is (momentarily) at rest!

Rolling without slipping is something that happens in nature a lot. If something isn’t doing that (like a bowling ball at the beginning of your throw), it often is brought to rolling-without-slipping by friction. Once it gets to that point it tends to stay in that condition. So I thought it would be cool to learn how to model it.

So why did I think this would be an interesting challenge? It seems that introductory physics courses have problems with rolling without slipping all the time. It’s how we learn that rolling balls get down hills slower than the point mass calculations we typically start students with. The reason is that the potential energy of the hill has to be split between the translational kinetic energy that we think of with point particles *and* the rotational kinetic energy it gets while rolling. That’s why it’s slower.

But the reason this is interesting is I wanted to do two things: figure out the angular rotation at all times so that I could make fun animations, and ask what happens if you don’t just do a boring inclined plane — specifically a surface that’s curved.

## 2D first

First I tackled an effective 2D problem, or a problem I can draw on a sheet of paper. The easiest to do is a non-curved surface that’s at an angle. The rolling without slipping condition in that case is pretty easy:

where v is the speed of either the contact point (remember, the part of the ball touching the plane doesn’t move, where that point is does) or the speed of the center of the ball, since they’re the same if the surface is flat.

Now consider the Lagrangian approach for the problem. Let’s assume the angle the line makes with the horizontal is . Here’s my chicken scratch, barely legible approach:

If you like using x for horizontal and y for vertical, you use the first part. If you want to use a variable along the slope, you use the bottom part (where I used the variable “a”). Either way you get a pretty straightforward result showing that it moves down the slope at a constant acceleration that’s less than g, thanks to the rolling. Note that for the rest of this post I’ll be using the x and y approach because the slope is constantly changing making the “a” approach tricky.

Alright, so what happens when the surface is curved? I ran into this in my Brachistocrone for rolling things post, and the upshot is that the rolling without slipping condition changes to:

where is the speed of the contact point.

Here’s my notes where I proved that to myself:

The key it to realize that while the yellow and orange stripes line up as it rolls, the sphere is frustrated from fully executing its rotation because the curve has risen up to meet it. The part that’s taken back is that that’s labeled.

For that old post the more complicated expression was a major pain in the butt, and I was convinced for a few weeks it would be for this too until I went back to the paper I referenced in that post again a couple days ago and realized that you get a much cleaner version of the rolling without slipping condition:

which looks just like my simple one up at the top of this post! Yep, if you just switch to the speed of the center of the ball, instead of the speed of the contact point, you get to use our old tried-and-true rolling without slipping condition. This was the big breakthrough I needed!

Here’s the setup:

- Choose the generalized coordinate as (the x-location of the contact point). Assume .
- Find expressions for the coordinates and velocities of the center of the ball based on
- Using the trick above for the rolling-without-slipping condition, determine the kinetic and potential energies of the ball, at first in terms of the center coordinates but ultimately in terms of
- Do the usual Euler-Lagrange trick to find the equation of motion for
- Give both the EOM (and the initial conditions) along with the rolling-without-slipping condition to the differential equation solver so that you can get both and as functions of time
- Make fun animations

First let’s consider 1 & 2. Here’s an image showing most of the important variables:

How do you get the center-of-ball coordinates from the contact coordinates? The key is the right angle at the contact point. The center is R-units in the direction perpendicular to the surface from the contact point. That direction can be found from the function of the curve:

where f’ indicates the derivative (or slope) of the curve.

Ok, then we literally have the same kinetic and potential energies as what’s in my notes above for the flat curve, only we now know that all the x’s and y’s in there are actually functions of .

Then step four gives us the following differential equation for :

That’s for the special case where f(x)=sin(x). Ugly right? But who cares? We just dump it into an ODE solver! Here’s the result (remember that we get both and back so we can make the motion and the rotation look right):

and here’s rolling down the function f(x)=sin(x)+x:

Cool, right?!

## Now for 3D

As soon as I got that working I realized that I could get the 3D working, only I realized that I’d have to shift from also solving for as single angle to solving for all the Euler angles. But, I‘m good at dealing with those so I went for it. Here’s the modified setup:

- Choose both and as the generalized coordinates. Assume
- Find expressions for the coordinates and velocities of the center of the ball based on and
- Using the trick above for the rolling-without-slipping condition, determine the kinetic and potential energies of the ball, at first in terms of the center coordinates but ultimately in terms of and .
- Do the usual Euler-Lagrange trick to find the equations of motion for and
- Give both the EOMs (and the initial conditions) along with the rolling-without-slipping condition to the differential equation solver so that you can get both and the Euler angles as functions of time
- Make fun animations

Step 2 needs some adjustment from the 2D case. To find the direction that is perpendicular to a surface at a particular location. The trick is to make a new function:

This function has a set of level surfaces where S is a constant. Our surface is when S=0. But the key is to recognize that the shortest path from one level surface to another is found by finding the gradient of the function. Therefore:

Step 3 looks identical, just with 3 variables instead of 2.

Step 5, especially the Euler angle part, is a little tricky. What is the rolling without slipping condition? We have but what is the magnitude of ? Well, we know what that is in terms of the Euler angles (and their time derivatives)!

We could just grab their total amplitude, but we actually know something about the direction of . We know that it’s perpendicular to both the normal vector to the surface and to the direction of rolling.

Note that “the direction of rolling” is parallel to both the direction that the contact point is moving and the direction the center of the ball is moving, but you’ll see in a second that it’s much easier to use the ball for this (we’re normalizing that vector either way, so it doesn’t matter that they aren’t the same length, it only matters that they’re parallel). Out front, the magnitude of can be found from our simple rolling-without-slipping condition. Putting it all together yields:

Here’s how all that looks in Mathematica:

One thing that took me a while was figuring out how to make a ball look like it was rolling in Mathematica. Here’s how I did that:

Once you have the prototype ball you just use GeometricTransformation[ball[[1]], {m, r}] on it where m is the Euler rotation matrices dotted together and r is the location of the center of the ball.

Whoo hoo! On to step 6:

Here’s a comparison of 4 balls rolling on the function f(x,y)=sin(x)+sin(y) (it looks somewhat like an egg carton). They’re all started at the same point. Two are small and two are larger. In each size one is a solid ball and one is a shell. They all have the same mass:

And here’s the biggest ball I could get to roll on that surface. Why would there be a limit? Because you can’t use a ball that has a larger radius than the concave up radius of curvature at any point on its journey (Mathematica actually craps out right when this happens):

Here’s a still frame zoomed in a little showing that biggest ball right at the smallest radius of curvature:

One cool thing is that I can have Mathematica calculate the radius of curvature at all points along the trajectory. Here’s that plot where the red horizontal line is the radius of the ball:

How do you calculate the radius? You get it from this equation from way at the top of this post:

Note that before I really got my head wrapped around how to do this I thought I would have to calculate that radius of curvature (which, by the way depends on both where you are on the surface and what direction you’re rolling) directly from the definition of the curve itself. That was an interesting rabbit hole that this approach didn’t need (sorry for bothering you, my friend (and occasional guest blogger Art) for how to do this).

## Your thoughts?

I’m really excited about this new type of modeling I can do. What are your thoughts? Here are some starters for you:

- This is cool! What I especially like is . . .
- This is dumb. I could do this on a napkin.
- Why do you sometimes use hypens and sometimes not in the phrase ro-lli-ng—-wit-hou—-t-sli–ppin———-g?
- Can you model a ball rolling on a rotating turntable? (actually this is what started all of this, I just haven’t gotten back to it yet)
- What is up with that [[1]] you have to add to the GeometricTransformation command?
- Will this make you a better golfer?
- I like your handwriting better than . Do that from now on.
- I hate your handwriting.
- That level curve method is exactly what you did in 2D too, idiot.
- This is Art: Are you telling me you didn’t use any of those calculations I gave you?!
- What happens if the surface changes with time?