proj home

Files   Classes   Functions   Hierarchy  

nintegrationTrapezoidEuler< D, T > Class Template Reference

Numerical integration with the Trapezoid - Euler method. More...

#include <nintegration.h>

Collaboration diagram for nintegrationTrapezoidEuler< D, T >:

List of all members.

Public Member Functions

 nintegrationTrapezoidEuler (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 nintegrationTrapezoidEuler< D, T >

Numerical integration with the Trapezoid - Euler method.

Definition at line 47 of file nintegration.h.


Constructor & Destructor Documentation

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

The clients equation needs to see the variables.

Definition at line 55 of file nintegration.h.

00056     : yDorder(xi_,yi_) {}


Member Function Documentation

template<typename D , typename T >
void nintegrationTrapezoidEuler< 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 64 of file nintegration.h.

References nintegrationTrapezoidEuler< D, T >::yDorder.

00070   {
00071     // Estimate the implicit variable y[n+1] by Eulers method.
00072     // w1 is y[n+1] interpolated: y[n+1] = y[n]+h*y'[n]
00073 
00074     T yD;
00075     yDorder(yD,y,x);
00076     T w1 = y + h*yD;
00077 
00078     T x1 = x+h;
00079     T y1D;
00080     yDorder(y1D,w1,x1);
00081 
00082     dy = (y1D+yD)*h/2.0;
00083   }

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

Increment to the next equation.

Definition at line 59 of file nintegration.h.

References nintegrationTrapezoidEuler< D, T >::yDorder.

00060     { ++yDorder; }


Member Data Documentation

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

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

Definition at line 52 of file nintegration.h.

Referenced by nintegrationTrapezoidEuler< D, T >::eval(), and nintegrationTrapezoidEuler< 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