next up previous contents
Next: 8.13 The Corrector Step Up: 8. A More Modular Previous: 8.11 Taking a Single

8.12 The Predictor Step

The first half of a Hermite step is particularly simple, nothing more than a rather short Taylor series development:



\begin{Code}[nbody\_sh1.C: predict\_step]
\small\verbatiminput{chap8/nbody_sh1.C.predict_step} \end{Code}

Notice how much we can already read off from the way the arguments to predict_step() are declared: accelerations and jerks are passed as const variables, whereas positions and velocities are not. This implies that the latter two are updated, whereas the former two are used to provide information for the update, without being changed themselves. This of course is exactly what happens.



The Art of Computational Science
2004/01/25