Let's say a bit about how the standard void -
Ma x newVa + Mb x newVb = Ma x Va + Mb x Vb
and -
(1/2) x ( Ma x newVa ^{ 2 }+ Mb x newVb^{ 2 }) = (1/2) x ( Ma x Va^{ 2 }+ Mb x Vb^{ 2 })
The newVa and the newVb quantities are our unknowns, and the old Va and Vb are like constants fed into the equations. Geometrically speaking, condition (1) describes a 'line,' while condition (2) describes an 'ellipse.' The intersection of a line and an ellipse gives two solutions: the pre-collision and the post-collision solution. To find them, you can replace (1) by two linear equations in the x and y components and replace equation (2) by a single quadratic equation in the x and y components. These equations can be solved by hand, though what the author did was feed them into the Mathematica symbolic computation program to come up with the two solutions, the pre-collision solution, newVa = Va and newVb = Vb , and the post-collision solution, in which some of the energy and momentum have been exchanged:
If we divide both numerators and denominators by Ma , and call Mb / Ma massratio we get
Simplifying a little more, we get
Note that if massratio is 1, then this is simply newVa = Vb ; newVb = Va , which is the standard billiard-ball collision that one first thinks of. The case where the masses aren't the same is the less obvious case; this is the case we are doing all the work for. And if a has a huge (infinite) mass compared to b , then massratio is about 0 and we get newVa = Va ; newVb = 2 Va “ Vb , which, if a is motionless, amounts to b simply bouncing off of a , which is another standard kind of collision example. A third thing that needs to be taken into account is that we shouldn't have two objects in the same place at the same time. Usually when two critters are touching, they will actually be overlapping. We add code to our A final issue in writing this algorithm is that we need to avoid having a collision move any critter that has its |

flylib.com © 2008-2017.

If you may any questions please contact us: flylib@qtcs.net

If you may any questions please contact us: flylib@qtcs.net