I want to analyze the velocity/time graphs of our simulations.
There is another VERY clear line of symmetry here. But it's maybe not super obvious *why* this one is symmetric.
Before moving on from these three graphs, I want to run another simulation, same situation, but now the left ball has twice as much mass. Remember from before, the role of mass in an interaction with forces is that they respond less to the same force than objects with less mass.
The symmetry is still *kinda* there. It's reminiscent of the reflectional symmetry we had. But not quite. I want to talk about this.
loop for every instant of time { loop for every object { 1. force = ... 2. dvel = force / mass * dt 3. velocity += dvel 4. dpos = velocity * dt 5. position += dpos } time += dt }
To explain this, let's go back to the simulation loop.
What I want to draw your attention to is line 2, "dvel = force / mass * dt". Rearranging this line gives "dvel * mass = force * dt". We know that dt is the same for each timestep and for each object, and we know that at each timestep the force between the objects are equal and opposite in sign. So that means, at each timestep the quantities "dvel * mass" are going to be equal and opposite in sign.
And, sure enough, if I scale the velocity/time graph by each object's mass, the symmetry comes back.
Just to write it out, for every timestamp k:
This is true at every timestamp, but you don't see us graphing mass * dvel above. That's because the "d" terms are pretty uninteresting to graph: they converge to zero as dt gets small. So whenever we notice something like this we almost always want to translate it into macro-terms.
To do that, we'll use the fact that the macro-term velocity is just the sum of lots of dvels:
, to conclude:
If on one timestep, mass * dvel increases for the red ball by 8, it must decrease for the blue ball by 8. And if on the next timestep it increases for the red ball by 2, it must decrease for the blue ball by 2. And so therefore, over the course of two consecutive timesteps, mass * dvel increases for the red ball by 10, and decreases for the blue ball by 10. So these quantities are equal and opposite not just for single timesteps, but for larger spans of time as well!
So that's where the mass * velocity graph's symmetry comes from.
The labels on these graphs probably gave it away, but this quantity, mass * velocity, is important enough to have a name: momentum.
And this symmetry that you're seeing here also has a name: conservation of momentum.
This name reflects a different way of looking at all this. Instead of the two mass * dvel's being equal and opposite, the traditional way of writing it is that they add to 0:
And the traditional way of looking at the momentum equations it is that between two time points, whatever momentum is lost by one object is gained by the other. So the total momentum felt by all of the objects, the sum of all of their momentums, is constant.
So that's pretty cool and all, but so far in these last couple lessons we've only talked about pairs of objects. What happens if we throw in another one? Here we have 3 balls in play, with varying masses, colliding with each other:
It's a bit hard to see, but the velocity/time graph is slightly lopsided: the sum of velocities at the beginning of the sim is a bit larger than it is at the end. But the momentum graph is perfectly balanced.
So why is this?
Well, it all comes down to our simulation rules. It's still (and always) the case that "dvel * mass = force * dt". And forces are still (and always) equal and opposite. But now that we have more than 2 objects, we get to see forces adding. The force that the middle ball experiences is a positive force from its interaction with the left object, and a negative one from its interaction with right.
If we were to add up all of the mass * dvel of all of the objects, it would *still* add up to 0! And so therefore, for every two timestamps T1 and T2:
This is conservation of momentum. The sum of all of the object's masses * their dvels at every timestep is always 0. We define an object's momentum to be equal to its mass times its velocity. The sum of all of the object's momentums never change from timestep to timestep.
So yeah. That's momentum. We'll come back to this eventually, a couple times. Momentum is a really important concept, one of those things that, throughout physics you never really get away from.
Changelog:
© by Daniel Taylor