|
The Vish Visualization Shell 0.3
Vish
|
Runge-Kutta solver of order 8 with dense output. More...
#include <elementary/ode/dop853.hpp>
Classes | |
| struct | statistic_vars |
Public Member Functions | |
| real | abstol (int i) const |
| Get the absolute tolerance for given index. | |
| success_code | advance (bool backward=false) override |
| Advance the solution by one step, producing dense output. | |
| real | dop (int i, const real &s) const |
| Dense output function, returns the exact value of the ith solution at the specified x value. | |
| dop853 () | |
| Constructor, does nothing. | |
| const real & | dx () const |
| Predicted step size of the last accepted step. | |
| bool | EnableDenseOutput () |
| Enable computation of dense output. | |
| real | evalDOP (int i, const real &s) const |
| Evaluate the dense output function with a parameter relative to the last integration interval. | |
| const real & | f (int i) const |
Return the solution of the ![]() | |
| void | initialize (int n, const real &x, const real *y) |
| real | reltol (int i) const |
| Get the relative tolerance for given index. | |
| void | settol (const real &abstol=1E-10, const real &reltol=1E-10) |
| Set the absolute and relative tolerance globally for all indices (1E-10 by default) | |
| void | settol (int i, const real &abstol, const real &reltol) |
| Set the absolute and relative tolerance for each index. | |
| long | step_nr () const |
| Return the current integration step number, which is increased with each call to advance(). | |
| const real & | x0 () const |
| Return the last integration parameter. | |
| const real & | x1 () const |
| Return the current integration parameter. | |
| ~dop853 () | |
| Destructor. | |
Runge-Kutta solver of order 8 with dense output.
DOP853 - Dense Output or Order 8(5,3).
This code computes the numerical solution of a system of first order ordinary differential equations y'=f(x,y). It uses an explicit Runge-Kutta method of order 8(5,3) due to Dormand & Prince with step size control and dense output.
Authors : E. Hairer & G. Wanner
Universite de Geneve, dept. de Mathematiques
CH-1211 GENEVE 4, SWITZERLAND
E-mail : HAIRE.nosp@m.R@DI.nosp@m.VSUN..nosp@m.UNIG.nosp@m.E.CH, WANNE.nosp@m.R@DI.nosp@m.VSUN..nosp@m.UNIG.nosp@m.E.CH
The code is described in : E. Hairer, S.P. Norsett and G. Wanner, Solving ordinary differential equations I, nonstiff problems, 2nd edition, Springer Series in Computational Mathematics, Springer-Verlag (1993).
Version of Mai 2, 1994.
Remarks about the C version : this version allocates memory by itself, the iwork array (among the initial FORTRAN parameters) has been splitted into independant initial parameters, the statistical variables and last step size and x have been encapsulated in the module and are now accessible through dedicated functions; the variable names have been kept to maintain a kind of reading compatibility between the C and FORTRAN codes; adaptation made by J.Colinge (colin.nosp@m.ge@d.nosp@m.ivsun.nosp@m..uni.nosp@m.ge.ch).
Remarks about the C++ version: this version is a large restructuring of the original C version such that it allows loop control from outside. I.e. no callback functions are required any longer, and multiple instances of the dop853 integrator may be used in parallel. The implementation of the core differential equation itself is left to the DiffEquation template argument; it may be implemented as a virtual function, via a function pointer, or as an explicit equation which is then inlined into the solver. Moreover, the storage type of array type variables is left open to the implementation of the Array template argument: It may be an array whose size may be changed at runtime, like the STL vector<> class, or it may be an array with fixed size known at compile-time, such that the length of the loops internal to the integrator is known to the optimizer when compiling, possibly producing better performant code. Adaption, classification and templatization made by Werner Benger werne.nosp@m.r@ph.nosp@m.oton..nosp@m.at, 2004.
| DiffEquation | Functor computing the value of ![]() |
| struct Traum::dop853::statistic_vars |
| Traum::dop853< DiffEquation >::dop853 | ( | ) |
Constructor, does nothing.
Need to call the initialize() function prior to integration.
|
inline |
Dense output function, returns the exact value of the ith solution at the specified x value.
Dense output must be enabled first by calling EnableDenseOutput() .
| i | index of the equation |
| s | the integration parameter, must be between xold() and x() . |
References Traum::dop853< DiffEquation >::f().
|
inline |
Enable computation of dense output.
Must be called before dop() may be invoked.
| dop853< DiffEquation >::real Traum::dop853< DiffEquation >::evalDOP | ( | int | i, |
| const real & | s | ||
| ) | const |
Evaluate the dense output function with a parameter relative to the last integration interval.
Dense output must be enabled via EnableDenseOutput() for this function to succeed.
| s | An interval parameter in the range 0.0 to 1.0 . |
|
inline |
| n | the dimension of the equation system |
References Traum::dop853< DiffEquation >::initialize().
Referenced by Traum::dop853< DiffEquation >::initialize().