proj home

Files   Classes   Functions   Hierarchy  

nintegrationRK< D, T > Class Template Reference

Numerical integration with the classical Rung Kutta method. See Numerical Analysis by K.E.Atkinson, second edition page 423, ISBN 0-471-50023-2 . More...

#include <nintegration.h>

Collaboration diagram for nintegrationRK< D, T >:

List of all members.

Public Member Functions

 nintegrationRK (T *xi_, T *yi_)
 The clients equation needs to see the variables.
void operator++ ()
 Increment to the next equation.
void eval (T &dy, T const h, T const y, T const x)
 Evaluate the infinitesimal and the highest derivative.

Public Attributes

yDorder
 The equation of the system as a 1st order derivative.


Detailed Description

template<typename D, typename T>
class nintegrationRK< D, T >

Numerical integration with the classical Rung Kutta method. See Numerical Analysis by K.E.Atkinson, second edition page 423, ISBN 0-471-50023-2 .

Definition at line 94 of file nintegration.h.


Constructor & Destructor Documentation

template<typename D , typename T >
nintegrationRK< D, T >::nintegrationRK ( T xi_,
T yi_ 
) [inline]

The clients equation needs to see the variables.

Definition at line 102 of file nintegration.h.

00103     : yDorder(xi_,yi_) {}


Member Function Documentation

template<typename D , typename T >
void nintegrationRK< D, T >::eval ( T dy,
T const   h,
T const   y,
T const   x 
) [inline]

Evaluate the infinitesimal and the highest derivative.

Definition at line 111 of file nintegration.h.

References nintegrationRK< D, T >::yDorder.

00117   {
00118     T c1;
00119     yDorder(c1,y,x);
00120     c1 *= h;
00121 
00122     T x1 = x + h*0.5;
00123     T y1 = y + c1*0.5;
00124 
00125     T c2;
00126     yDorder(c2,y1,x1);
00127     c2 *= h;
00128 
00129     T y2 = y+c2*0.5;
00130     T c3;
00131     yDorder(c3,y2,x1);
00132     c3 *= h;
00133 
00134     T x2 = x + h;
00135     T y3 = y + c3;
00136     T c4;
00137     yDorder(c4,y3,x2);
00138     c4 *= h;
00139 
00140     dy = (c1+c2*2.0+c3*2.0+c4)/6.0;
00141   }

template<typename D , typename T >
void nintegrationRK< D, T >::operator++ (  )  [inline]

Increment to the next equation.

Definition at line 106 of file nintegration.h.

References nintegrationRK< D, T >::yDorder.

00107     { ++yDorder; }


Member Data Documentation

template<typename D , typename T >
D nintegrationRK< D, T >::yDorder

The equation of the system as a 1st order derivative.

Definition at line 99 of file nintegration.h.

Referenced by nintegrationRK< D, T >::eval(), and nintegrationRK< D, T >::operator++().


The documentation for this class was generated from the following file:

Generated on Fri Mar 4 00:50:07 2011 for Chelton Evans Source by  doxygen 1.5.8