dt. The small change in momentum, defined by
dpis simply the force vector multiplied by
dt, the time interval. Once again, we use
dthere because it scales the simulation to real time no matter what the frame rate of our virtual universe is set to.
dvrepresents the change in velocity that will occur in one frame. We need to then add this value to the current velocity value so that it is updated. Again, remember that Tychos will do this iteratively, updating the velocity each frame as long as the calculation is indeed in the Calculation pane:
ballwe can use that value to calculate the new position that
ballshould move to in the animation. We just use the same iterative calculation process that we have used before:
balland then replay the simulation to see how the
ballchanges its behavior. Is it acting as you would expect?
ball. This new force will be called
force3. Add this line of code to the Initial State pane:
ballParticle using this line of code:
ballParticle's momentum will be affected by the NET force, the sum total of all forces acting on it. We can simply modify this line of code so that it now looks like this:
ball3Particle accelerate along a diagonal path because two forces are acting on it now, not just one.
ball3.We do that below by defining a new variable called
Fnet3that represents all the forces combined:
ball3just a little more closely. Change these lines of code in the Calculations Pane from: