Physics with Danno

Previous Chapter: Momentum

Lesson 5: Kinetic Energy

Let's return to a familiar simulation.

I want to talk about its force/position graph.

positionforce

So. First thing to notice is that they look symmetric. And they are!

Okay, so It's symmetric, big deal. Most of the graphs we've looked at for this particular simulation are symmetric. Also, one is positive while the other is negative, of course. And they attain the same max force at the same time, just with opposite signs.

Additionally, both graphs have the same "width" and the same "height." Well obviously they do, they're symmetric. But if you think about it, the "width" of the graph, the amount of the x-axis that isn't 0, is showing the distance each object travels during the collision. And both objects will travel the same distance during the collision. At the moment when their collision starts, they'll be barely touching, so their centers will be (left ball's radius) + (right ball's radius) away from each other. But at the moment when their collision ends, they'll be barely touching as well. So therefore, they'll both have traveled the same distance.

Let's make it more interesting. Here's another sim that we've seen before, the one where the left object has twice the mass.

positionforce

Maybe you might have guessed it, but now the symmetry is broken. And because we want to have lots of tools for thinking about complex physics interactions, we're going to see if we can explain this, and maybe recover the symmetry like we did last time with velocity and momentum.

So one of them is now slanted more "away" than the other. And so you might think that we can do a similar thing to what we did with velocity. Maybe we can stretch or shrink one of these in the horizontal direction, somehow, dependent on mass?

This is made all the more complicated by the fact that the graphs can double back on themselves:

positionforce

Unfortunately, that technique doesn't work here. No simple stretching scheme is going to help us. So what to do?

Well, okay, so I don't really know how to motivate this. I could dance around it for a while and try to connect a bunch of different ideas together to imply what we should try here. But I think that's probably just confusing, and that I should just give it to you straight.

The trick here is to look at these graphs like they're triangles. So they have a "width", and a height. And remember, their bottom edges are the same length, and their peaks are the same height. Now, if you remember your geometry, there aren't a ton of things you can say concretely about these triangles. Like, they don't share angles, or perimeters. BUT they do have the same area.

So here's an idea. What were to happen if we tried calculating the area of these graphs?

positionforce
positionforce
positionforce

From top to bottom, the areas are (-0.500,0.500), (-0.888,0.888), (-0.444,0.444)

And if we do that, sure enough, the graphs' areas are exactly equal. Well, you know, equal and opposite. We're on to something here. Also, notice how these areas are, like, they're simple numbers. Like 0.5, and 2 and stuff.

... but what is that area? They're equal, sure, but what is that number? What I mean is, the area of these graphs are not going to be 1/2 * (distance traveled) * (max force). That was just a silly idea I threw out there to get us thinking in the right direction. But because the numbers we're seeing look pretty simple, maybe there's a simple expression for the area of the graphs that we can narrow in on.

Well, now that we have numbers that we can drive against, we can do some simulations. It might be tempting to look at the effects of mass first, but actually let's look at the effects of the initial velocity first.

positionforce
positionforce
positionforce
positionforce

From top to bottom, the areas are (-0.500,0.500), (-2.000,2.000), (-4.500,4.500), (-8.000,8.000)

Here, we have 4 simulations. In each, the left and right objects have the same mass, and the right object starts with 0 velocity, but the left object starts with different velocity in each.

And on the right are the graphs of their areas. Maybe it's hard to tell, but these numbers are scaling *quadratically*. 0.5 is half of 1^2, 2 is half of 2^2, 4.5 is half of 3^2, 8 is half of 4^2. So it looks like the graph areas scale quadratically with the initial velocity of the left ball. That's interesting.

Okay now let's try varying the masses. The right object has a velocity of 0 and a mass of 1. The left object has a velocity of +1, but different masses.

positionforce
positionforce
positionforce
positionforce

From top to bottom, the areas are (-0.500,0.500), (-0.889,0.889), (-1.125,1.125), (-1.280,1.280)

And when we look at the areas... huh. Okay that one's maybe not as obvious. Now we could run a bunch more simulations and graph the relationship, but I want to try something else first real quick.

In this one, the masses are matched for both objects:

positionforce
positionforce
positionforce
positionforce

From top to bottom, the areas are (-0.500,0.500), (-1.000,1.000), (-1.500,1.500), (-2.000,2.000)

Aaaaand... Okay, there we go, that's something. So it looks like the force/position graph areas scale linearly with mass, when both objects have the same mass.

Okay, I won't lead you on anymore. The issue with the middle set of graphs, the reason that it didn't scale linearly, is because when varying the left masses, another important quantity ended up inadvertently changing as well: the end velocities!

You can go do some simulations on your own if you want, to figure out the complete relationship between all of these variables, but I'll us all the trouble. The final relationship is:

12mass(final-velocity2-initial-velocity2)

So two things about this. First is that this is pretty different from the momentum derivation from last time. In the last chapter, each object has the same mass(final-velocity-initial-velocity) between any two points in time. Here, each object has the same differences in... well the quantity 12mass(final-velocity2-initial-velocity2). So linear in mass, and also in this other weird term. And we don't know this for sure as of yet, but these quantities are only equal when the final and initial velocities are taken after and before the collision.

The other thing to note about this is... well, look at this form. If you remember your calculus, this should be screaming at you. But to be concrete, let's finally work it out from our simulation loop.

Derivation

I'm going to be showing you why why the area of one of these graphs is equal to 12mass(final-velocity2-initial-velocity2). I'll be doing so in 2 two steps. First, I'm going to rewrite the sum in terms of velocities, and then I'm going to show how the sum works out.

To calculate the graph's area, we're going to be taking its integral. We're going to be using the double-right-point-integral formulation that I introduced in the calculus chapter for this:

k=T1T2forcek+dtdposk

So. First off, force and dpos are both closely related to velocity. So maybe by re-writing each item of the sum in terms of velocities, we can simplify a bit.

forcek+dtdposk=(dvelk+dtmass1dt)(velocitykdt)=massvelocitykdvelk+dt

Here I've pulled out, say, the k'th item of the integral we're dealing with. First, we can replace the force with mass * dvel / dt. Then we can replace dpos with velocity * dt. So with those two replacements, we see the sum is equal to the sums of mass * velocity * dvel.

Now we're going to do a little funny business to take advantage of the relationship between velocity and dvel:

massvelocitykdvelk+dt=122massvelocitykdvelk+dt=12mass((velocityk+dvelk+dt)2-velocityk2-dvelk+dt2)=12mass(velocityk+dt2-velocityk2-dvelk+dt2)

So we do a bit of algebraic manipulation here. First multiplying and dividing by 2, then completing the square. But then notice that each velocityk+dvelk+dt=velocityk+dt.

This is a good form to end on, because after replacement a bunch of terms cancel out:

k=T1T2forcek+dtdposk=k=T1T212mass(velocityk+dt2-velocityk2-dvelk+dt2)=12mass(velocityT2+dt-velocityT1-k=T1T2dvelk+dt2)

This is *almost* the form we saw earlier. But it has all of these dvelk2 terms as well.

We're going to be using another classic calculus trick here: we're going to say that these dvel2 terms are "negligible", or that they "go to zero". Here's the intuition:

Say I reduced our simulation's dt by a factor of 10. We've seen that velocities converge closer to their "correct" value, and that the dvels all reduce by about a factor of 10. This means that each dvelk2 term will reduce by about a factor of 100. But by reducing the dt like this, it also mean that between any two points in time, there will be 10 times as many samples.

So for the sum of dvelT12+...+dvelT22, we have 10 times as many samples, but each sample is about 100 times smaller. So the sum of all of these dvel2 terms reduce by about a factor of 10.

The point here is that as you make dt smaller (to make the simulation more accurate), the sum of these dvel2 terms rapidly become so close to zero that they aren't worth thinking about.

dt12mass(velocity8.02-velocity0.02)k=0.08.0-dtdvelk+dt2
dt = 13.632812515.015625
dt = 1/4-0.499999762833558070.2084749852716972
dt = 1/16-0.49999999418557630.05052222607773189
dt = 1/32-0.49999999931827980.025224773497103642
dt = 1/128-0.499999999997291670.006303368328105668
dt = 1/512-0.49999999999999240.0015757979957734538
dt = 1/2048-0.53.939488101319231e-4

This table is based on the equal mass simulation that we've seen so many times already, but ran with different dt's.

The last thing to mention is the "T2+dt" bit. It's true that 12mass(velocityT2+dt2-velocityT12) doesn't quite match the expression 12mass(final-velocity2-initial-velocity2) that we had before. Here we're going to make one more little approximation: if you reduce dt by a factor of 10, dvel will also shrink by about a factor of 10, and so velocityk is about equal to velocityk+dt. This is an approximation that should be handled with care, but in this case it should be fine.

So to conclude, the sum of forcedpos over every timestamp between times T1 and T2 converges to 12mass(velocityT22-velocityT12) as we make our dt smaller.

This situation is starting to mirror the situation from last chapter. In the last chapter, we found out that mass * (final-velocity - initial-velocity) has an important symmetry property, and we used that to come up with mass * velocity as a quantity of interest. And now we have 12mass(final-velocity2-initial-velocity2). So now we're going to name:

kinetic_energy=12massvelocity2
timekinetic energy
timekinetic energy
timekinetic energy

Conservation of kinetic energy

We can see above that the kinetic energy graphs are *not* symmetric, but by the end of the collision they do seem to end up balancing out.

But I still have to explain why that would be true. Because the difference of kinetic energies is the same as the integral of force/position, this is equivalent to asking why the force/position graphs would have equal and opposite area. It's certainly not obvious, at least not obvious to me, why these two graphs *should* be equal.

So we're going to try to show that the two force/position have equal and opposite areas. Last time, we saw that the sum of momentums are equal to 0 at every timestamp. But that won't work here. The areas are only equal when taken over the *entire* collision.

This time we're going to go with the right-point formulation of the kinetic energy sum. We're start by looking at each individual timestamp, and then see what happens.

forcedpos+forcedpos

So we have here our two force * dpos. The forces are equal and opposite.

forcedpos+forcedpos=force(dpos-dpos)=forced(pos-pos)

This is interesting. d(quantity)k is the difference between quantityk+dt and quantityk. And due to commutativity, the sum of differences is the difference of sums:

da-db=(a2-a1)-(b2-b1)=(a2-b2)-(a1-b1)=d(a-b)

That's the key to it, but there's another observation that we need to make first. That is, about the particular force that we've been using. Remember, it was itself a function of the distance between the two objects. So if we were to go out on a limb and assume that our collision function has to be a function of the difference in positions, we could re-write it like this.

forced(pos-pos)=collision_force(pos-pos)d(pos-pos)

So we have this nice, very suggestive form.

Now that we have this:

k=T1T2forcekd(posk-posk)=k=T1T2collision_force((pos-pos)k)d(pos-pos)k

Since each of the ball's positions converge as dt goes to zero, d(pos-pos) goes to 0. We're also going to assume that the collision force is strong enough to stop objects from "phasing through" each other, so in other words pos-pos never crosses 0. So this fulfills all of the requirements (listed in the calculus chapter) to call this an integral and apply tools from calculus.

We know, since this sum is an integral, it will have an antiderivative. We don't know what it is, and it can be very complicated to figure out its exact form. Err... well, we *do* know its antiderivative, it's the sum of the kinetic energy equations from before, one for each object! But expressing its antiderivative as a mathematical expression in terms of position would be very complicated.

But because we're able to write it this way, we do know that it does have an antiderivative that is a function *only of* pos-pos. Just to give it a name, I'm going to call it graph_antiderivative().

k=T1T2collision_force((pos-pos)k)d(pos-pos)k=graph_antiderivative((pos-pos)T2)-graph_antiderivative((pos-pos)T1)

But here's the trick! Remember from a couple minutes ago, when I was explaining that the base of the force/position graphs were the same width? I told you that, at the moment when the balls first touch, they'll be (left ball's radius + right ball's radius) apart, and at the moment they separate, they'll also be (left ball's radius + right ball's radius) apart. So if T1 and T2 are taken to be the very start and very end of the collision, (pos-pos)T1 and (pos-pos)T2 are the same! And so therefore, graph_antiderivative((pos-pos)T2)-graph_antiderivative((pos-pos)T1) is going to be 0!

This also explains why the integrals are only equal for the *entire* collision: when T1 and T2 are taken to be some other range, (pos-pos)T1 and (pos-pos)T2 aren't equal, and so when you apply graph_antiderivative() to them and subtract, the value isn't guaranteed to be zero!

And if you extend T1 to be sometime before the start of the collision, well it's not feeling any forces, is it? So it adds 0 to the final result. Same with extending T2 to be sometime after the collision ends.

And there you have it. The sum of forcedpos+forcedpos, taken between the moment the balls touch and the force/position graph rises above the x-axis, and the moment the separate and the force/position graph returns to the x-axis, is 0. The areas of the force/position graphs are equal and opposite.

This also means the sum of the kinetic energy of the two balls is conserved. That's because

graph_antiderivative((pos-pos)k)=kinetic_energyk+kinetic_energyk

, and so therefore, if T1 and T2 are taken before and after the collision, respectively,

kinetic_energyT1+kinetic_energyT1=kinetic_energyT2+kinetic_energyT2

3 objects

Right. So. Now that we've got that out of the way, the last thing left to talk about is multiple objects. We know that the total kinetic energy of a simulation with two objects is the same before and after a collision. But what happens when three objects all interact at once?

positionforce forcedpos+forcedpos+forcedpos=forcedpos+(0-force-force)dpos+forcedpos=force(dpos-dpos)+force(dpos-dpos)

Well, it goes pretty much the same. Here, we have 3 "force * dpos" terms, but the middle one's force equal and opposite to the sum of the forces on the left and right. So we can split them up and now both the left and right have a copy the dpos from the middle. And from here we just do it all again, getting "force * d(pos - pos)", it's just that each side has two separate versions of "pos - pos". Each side doesn't depend on the other. When we write the result of the sum using their antiderivatives, it's the same function, just two different "pos - pos"'s.

k=T1T2force(dpos-dpos)+force(dpos-dpos)=graph_antiderivative((pos-pos)k)+graph_antiderivative((pos-pos)k)

And that's that. When T1 is taken to be before all collisions begin, and T2 is taken to be after all collisions are finished, the sum is 0.

Conclusion

That was quite a lot. Let's regroup.

Similar to last time, the sum of forcedpos over lots of timesteps heavily suggested a quantity we called kinetic energy, 12massvel2.

We saw there was a symmetry in the kinetic energy graphs. But instead of the symmetry occurring at every timestep like last time, the kinetic energy symmetry happens on the level of entire collisions. Or, in the case of 3 or more objects, groups of collisions.

The derivation of these facts required a number of assumptions. Namely:

The assumptions from calculus aren't up for debate, but we'll see in later lessons that if either of the other two assumptions are invalidated, kinetic energy isn't actually conserved.

So yeah. That's kinetic energy.

And hey, I think we've covered a lot of ground these last couple lessons. We started with the base rules of physics, the rules that describe the little micro-movements that happen to individual objects over micro-durations of time. We then derived from them some rules about the macro-movement of entire simulations over macro-durations of time. And I think that's kinda cool.

Changelog:

Previous Chapter: Momentum

© by Daniel Taylor