I’m enjoying. Best book out of 3 (by various non_Nerd authors) so far. But I have found a odd IMHO misunderstanding in the simulation example.
Example works as coded, as provided by you, but the time interval dt is 1.0. So I decided to see how much more accurate the simulation would be if I set the time interval dt = 0.1. OOPS. When you do that, you also have to increase the starting y-acceleration of the particle to 1000 instead of 100 to get the same high-altitude and curve of position vs time. My view of simulations is that they should yield increasingly more accurate results as the interval is decreased (unless there is some built-in instability that is smoothed over by picking a long interval.
I think I know what is wrong. Nobody releases a (passive) particle with an initial acceleration. Its condition of release is that it has an initial velocity. From the instant it leaves the launcher, the acceleration it experiences is - 9.8. Velocity, of course, is acceleration * dt. So although the program works, the initializers should start with velocity, rather than acceleration.
So far, I’m a very happy camper and am finally learning something useful. Thanks for the book.