Information Technology Reference
In-Depth Information
6.7.3
Software for Systems of ODEs
This project extends Sect. 6.4 and Project 6.7.2 to systems of ODEs.
(a) Generalize Algorithm 6.12 to systems of ODEs. Make two versions of the algo-
rithm: one that does not store values in an array, except at the final step, and one
that stores all the computed values in an array.
(b) Implement the algorithm for solving a system of ODEs as a function in a
programming language. Consider only the algorithm that stores the computed
values at the final step.
The other algorithm would need to return a two-dimensional array, with one
index for the step numbers and one index for the components in the ODE sys-
tem. Since two-dimensional arrays are not covered in Sect. 6.4 ,wedropthe
corresponding implementation. In the version of the algorithm to be imple-
mented, return the solution as an array, where each element contains the
corresponding component in the solution (at the final, N -th, step of the algo-
rithm). Note that calling the algorithm repeatedly with N D 1 (single step at a
time) makes it easy to load the solution at many time steps into some array in
the calling code. This array might be convenient for visualizing the solution.
(c) Extend the ODESolver prm class and the ODESolver hierarchy to systems of
ODEs. Use the code from (b) in a subclass of ODESolver .
(d) Construct a test problem and verify the implementations.
Search WWH ::




Custom Search