Flood::OrdinaryDifferentialEquations Class Reference

#include <OrdinaryDifferentialEquations.h>

List of all members.

Public Member Functions

 OrdinaryDifferentialEquations (void)
virtual ~OrdinaryDifferentialEquations (void)
int get_points_number (void)
double get_tolerance (void)
int get_initial_size (void)
int get_warning_size (void)
int get_error_size (void)
bool get_display (void)
void set_default (void)
void set_points_number (int)
void set_tolerance (double)
void set_initial_size (int)
void set_warning_size (int)
void set_error_size (int)
void set_display (bool)
void calculate_Runge_Kutta_integral (Vector< double > &, Vector< double > &, double(*f)(double, double), double, double, double)
void calculate_Runge_Kutta_integral (Vector< double > &, Vector< double > &, Vector< double > &, double(*f_1)(double, double, double), double(*f_2)(double, double, double), double, double, double, double)
void calculate_Runge_Kutta_integral (Vector< double > &, Vector< double > &, Vector< double > &, Vector< double > &, double(*f_1)(double, double, double, double), double(*f_2)(double, double, double, double), double(*f_3)(double, double, double, double), double, double, double, double, double)
void calculate_Runge_Kutta_integral (Vector< double > &, Vector< double > &, Vector< double > &, Vector< double > &, Vector< double > &, double(*f_1)(double, double, double, double, double), double(*f_2)(double, double, double, double, double), double(*f_3)(double, double, double, double, double), double(*f_4)(double, double, double, double, double), double, double, double, double, double, double)
void calculate_Runge_Kutta_integral (Vector< double > &, Vector< double > &, Vector< double > &, Vector< double > &, Vector< double > &, Vector< double > &, double(*f_1)(double, double, double, double, double, double), double(*f_2)(double, double, double, double, double, double), double(*f_3)(double, double, double, double, double, double), double(*f_4)(double, double, double, double, double, double), double(*f_5)(double, double, double, double, double, double), double, double, double, double, double, double, double)
int calculate_Runge_Kutta_Fehlberg_integral (Vector< double > &, Vector< double > &, double(*f)(double, double), double, double, double)
int calculate_Runge_Kutta_Fehlberg_integral (Vector< double > &, Vector< double > &, Vector< double > &, double(*f_1)(double, double, double), double(*f_2)(double, double, double), double, double, double, double)
int calculate_Runge_Kutta_Fehlberg_integral (Vector< double > &, Vector< double > &, Vector< double > &, Vector< double > &, double(*f_1)(double, double, double, double), double(*f_2)(double, double, double, double), double(*f_3)(double, double, double, double), double, double, double, double, double)
int calculate_Runge_Kutta_Fehlberg_integral (Vector< double > &, Vector< double > &, Vector< double > &, Vector< double > &, Vector< double > &, double(*f_1)(double, double, double, double, double), double(*f_2)(double, double, double, double, double), double(*f_3)(double, double, double, double, double), double(*f_4)(double, double, double, double, double), double, double, double, double, double, double)
template<class T >
void calculate_Runge_Kutta_integral (T &t, Vector< double > &x, Vector< double > &y, double(T::*f)(double, double), double a, double b, double ya)
template<class T >
void calculate_Runge_Kutta_integral (T &t, Vector< double > &x, Vector< double > &y_1, Vector< double > &y_2, double(T::*f_1)(double, double, double), double(T::*f_2)(double, double, double), double a, double b, double y1a, double y2a)
template<class T >
void calculate_Runge_Kutta_integral (T &t, Vector< double > &x, Vector< double > &y_1, Vector< double > &y_2, Vector< double > &y_3, double(T::*f_1)(double, double, double, double), double(T::*f_2)(double, double, double, double), double(T::*f_3)(double, double, double, double), double a, double b, double y1a, double y2a, double y3a)
template<class T >
void calculate_Runge_Kutta_integral (T &t, Vector< double > &x, Vector< double > &y_1, Vector< double > &y_2, Vector< double > &y_3, Vector< double > &y_4, double(T::*f_1)(double, double, double, double, double), double(T::*f_2)(double, double, double, double, double), double(T::*f_3)(double, double, double, double, double), double(T::*f_4)(double, double, double, double, double), double a, double b, double y1a, double y2a, double y3a, double y4a)
template<class T >
void calculate_Runge_Kutta_integral (T &t, Vector< double > &x, Vector< double > &y_1, Vector< double > &y_2, Vector< double > &y_3, Vector< double > &y_4, Vector< double > &y_5, double(T::*f_1)(double, double, double, double, double, double), double(T::*f_2)(double, double, double, double, double, double), double(T::*f_3)(double, double, double, double, double, double), double(T::*f_4)(double, double, double, double, double, double), double(T::*f_5)(double, double, double, double, double, double), double a, double b, double y1a, double y2a, double y3a, double y4a, double y5a)
template<class T >
int calculate_Runge_Kutta_Fehlberg_integral (T &t, Vector< double > &x_out, Vector< double > &yOut, double(T::*f)(double, double), double a, double b, double ya)
template<class T >
int calculate_Runge_Kutta_Fehlberg_integral (T &t, Vector< double > &x_out, Vector< double > &y1_out, Vector< double > &y2_out, double(T::*f_1)(double, double, double), double(T::*f_2)(double, double, double), double a, double b, double y1a, double y2a)
template<class T >
int calculate_Runge_Kutta_Fehlberg_integral (T &t, Vector< double > &x_out, Vector< double > &y1_out, Vector< double > &y2_out, Vector< double > &y3_out, double(T::*f_1)(double, double, double, double), double(T::*f_2)(double, double, double, double), double(T::*f_3)(double, double, double, double), double a, double b, double y1a, double y2a, double y3a)
template<class T >
int calculate_Runge_Kutta_Fehlberg_integral (T &t, Vector< double > &x_out, Vector< double > &y1_out, Vector< double > &y2_out, Vector< double > &y3_out, Vector< double > &y4_out, double(T::*f_1)(double, double, double, double, double), double(T::*f_2)(double, double, double, double, double), double(T::*f_3)(double, double, double, double, double), double(T::*f_4)(double, double, double, double, double), double a, double b, double y1a, double y2a, double y3a, double y4a)
template<class T >
int calculate_Runge_Kutta_Fehlberg_integral (T &t, Vector< double > &x_out, Vector< double > &y1_out, Vector< double > &y2_out, Vector< double > &y3_out, Vector< double > &y4_out, Vector< double > &y5_out, double(T::*f_1)(double, double, double, double, double, double), double(T::*f_2)(double, double, double, double, double, double), double(T::*f_3)(double, double, double, double, double, double), double(T::*f_4)(double, double, double, double, double, double), double(T::*f_5)(double, double, double, double, double, double), double a, double b, double y1a, double y2a, double y3a, double y4a, double y5a)


Detailed Description

This class contains methods for numerical integration of ordinary differential equations. In particular it implements the Runge-Kutta and the Runge-Kutta-Fehlberg methods for systems consisting of up to five ODEs.

Definition at line 33 of file OrdinaryDifferentialEquations.h.


Constructor & Destructor Documentation

Flood::OrdinaryDifferentialEquations::OrdinaryDifferentialEquations ( void   )  [explicit]

General constructor. It creates an ordinary differential equations objecti with default values.

Definition at line 30 of file OrdinaryDifferentialEquations.cpp.

Flood::OrdinaryDifferentialEquations::~OrdinaryDifferentialEquations ( void   )  [virtual]

Destructor.

Definition at line 40 of file OrdinaryDifferentialEquations.cpp.


Member Function Documentation

template<class T >
int Flood::OrdinaryDifferentialEquations::calculate_Runge_Kutta_Fehlberg_integral ( T &  t,
Vector< double > &  x_out,
Vector< double > &  y1_out,
Vector< double > &  y2_out,
Vector< double > &  y3_out,
Vector< double > &  y4_out,
Vector< double > &  y5_out,
double(T::*)(double, double, double, double, double, double)  f_1,
double(T::*)(double, double, double, double, double, double)  f_2,
double(T::*)(double, double, double, double, double, double)  f_3,
double(T::*)(double, double, double, double, double, double)  f_4,
double(T::*)(double, double, double, double, double, double)  f_5,
double  a,
double  b,
double  y1a,
double  y2a,
double  y3a,
double  y4a,
double  y5a 
) [inline]

This method integrates the system of five differential equations

  • y_1' = f_1(x, y_1, y_2, y_3, y_4, y_5),
  • y_2' = f_2(x, y_1, y_2, y_3, y_4, y_5),
  • y_3' = f_3(x, y_1, y_2, y_3, y_4, y_5),
  • y_4' = f_4(x, y_1, y_2, y_3, y_4, y_5),
  • y_5' = f_5(x, y_1, y_2, y_3, y_4, y_5),

where y_1', y_2', y_3', y_4' and y_5' are given as class member methods, from x=a to x=b with initial conditions y_1(a)=y1a, y_2(a)=y2a, y_3(a)=y3a, y_4(a)=y4a and y_5(a)=y5a. The method is based on an explicit fourth order Runge-Kutta-Fehlberg formula.

Parameters:
t,: Object constructor containing the member methods to integrate (state equations).
x_out,: Pointer to vector with x values.
y1_out,: Pointer to vector with y_1 values.
y2_out,: Pointer to vector with y_2 values.
y3_out,: Pointer to vector with y_3 values.
y4_out,: Pointer to vector with y_4 values.
y5_out,: Pointer to vector with y_5 values.
f_1,: Member method to integrate (state equation for variable y_1).
f_2,: Member method to integrate (state equation for variable y_2).
f_3,: Member method to integrate (state equation for variable y_3).
f_4,: Member method to integrate (state equation for variable y_4).
f_5,: Member method to integrate (state equation for variable y_5).
a,: Lower integration limit.
b,: Upper integration limit.
y1a,: Initial condition for variable y_1.
y2a,: Initial condition for variable y_2.
y3a,: Initial condition for variable y_3.
y4a,: Initial condition for variable y_4.
y5a,: Initial condition for variable y_4.

Definition at line 1668 of file OrdinaryDifferentialEquations.h.

template<class T >
int Flood::OrdinaryDifferentialEquations::calculate_Runge_Kutta_Fehlberg_integral ( T &  t,
Vector< double > &  x_out,
Vector< double > &  y1_out,
Vector< double > &  y2_out,
Vector< double > &  y3_out,
Vector< double > &  y4_out,
double(T::*)(double, double, double, double, double)  f_1,
double(T::*)(double, double, double, double, double)  f_2,
double(T::*)(double, double, double, double, double)  f_3,
double(T::*)(double, double, double, double, double)  f_4,
double  a,
double  b,
double  y1a,
double  y2a,
double  y3a,
double  y4a 
) [inline]

This method integrates the system of four differential equations

  • y_1' = f_1(x, y_1, y_2, y_3, y_4),
  • y_2' = f_2(x, y_1, y_2, y_3, y_4),
  • y_3' = f_3(x, y_1, y_2, y_3, y_4),
  • y_4' = f_4(x, y_1, y_2, y_3, y_4),

where y_1', y_2', y_3' and y_4' are given as class member methods, from x=a to x=b with initial conditions y_1(a)=y1a, y_2(a)=y2a, y_3(a)=y3a and y_4(a)=y4a. The method is based on an explicit fourth order Runge-Kutta-Fehlberg formula.

Parameters:
t,: Object constructor containing the member methods to integrate (state equations).
x_out,: Pointer to vector with x values.
y1_out,: Pointer to vector with y_1 values.
y2_out,: Pointer to vector with y_2 values.
y3_out,: Pointer to vector with y_3 values.
y4_out,: Pointer to vector with y_4 values.
f_1,: Member method to integrate (state equation for variable y_1).
f_2,: Member method to integrate (state equation for variable y_2).
f_3,: Member method to integrate (state equation for variable y_3).
f_4,: Member method to integrate (state equation for variable y_4).
a,: Lower integration limit.
b,: Upper integration limit.
y1a,: Initial condition for variable y_1.
y2a,: Initial condition for variable y_2.
y3a,: Initial condition for variable y_3.
y4a,: Initial condition for variable y_4.

Definition at line 1360 of file OrdinaryDifferentialEquations.h.

template<class T >
int Flood::OrdinaryDifferentialEquations::calculate_Runge_Kutta_Fehlberg_integral ( T &  t,
Vector< double > &  x_out,
Vector< double > &  y1_out,
Vector< double > &  y2_out,
Vector< double > &  y3_out,
double(T::*)(double, double, double, double)  f_1,
double(T::*)(double, double, double, double)  f_2,
double(T::*)(double, double, double, double)  f_3,
double  a,
double  b,
double  y1a,
double  y2a,
double  y3a 
) [inline]

This method integrates the system of three differential equations

  • y_1' = f_1(x, y_1, y_2, y_3),
  • y_2' = f_2(x, y_1, y_2, y_3),
  • y_3' = f_3(x, y_1, y_2, y_3),

where y_1', y_2' and y_3' are given as class member methods, from x=a to x=b with initial conditions y_1(a)=y1a, y_2(a)=y2a and y_3(a)=y3a. The method is based on an explicit fourth order Runge-Kutta-Fehlberg formula.

Parameters:
t,: Object constructor containing the member methods to integrate (state equations).
x_out,: Pointer to vector with x values.
y1_out,: Pointer to vector with y_1 values.
y2_out,: Pointer to vector with y_2 values.
y3_out,: Pointer to vector with y_3 values.
f_1,: Member method to integrate (state equation for variable y_1).
f_2,: Member method to integrate (state equation for variable y_2).
f_3,: Member method to integrate (state equation for variable y_3).
a,: Lower integration limit.
b,: Upper integration limit.
y1a,: Initial condition for variable y_1.
y2a,: Initial condition for variable y_2.
y3a,: Initial condition for variable y_3.

Definition at line 1109 of file OrdinaryDifferentialEquations.h.

template<class T >
int Flood::OrdinaryDifferentialEquations::calculate_Runge_Kutta_Fehlberg_integral ( T &  t,
Vector< double > &  x_out,
Vector< double > &  y1_out,
Vector< double > &  y2_out,
double(T::*)(double, double, double)  f_1,
double(T::*)(double, double, double)  f_2,
double  a,
double  b,
double  y1a,
double  y2a 
) [inline]

This method integrates the system of two differential equations

  • y_1' = f_1(x, y_1, y_2),
  • y_2' = f_2(x, y_1, y_2),

where y_1' and y_2' are given as class member methods, from x=a to x=b with initial conditions y_1(a)=y1a and y_2(a)=y2a. The method is based on an explicit fourth order Runge-Kutta-Fehlberg formula.

Parameters:
t,: Object constructor containing the member methods to integrate (state equations).
x_out,: Pointer to vector with x values.
y1_out,: Pointer to vector with y_1 values.
y2_out,: Pointer to vector with y_2 values.
f_1,: Member method to integrate (state equation for variable y_1).
f_2,: Member method to integrate (state equation for variable y_2).
a,: Lower integration limit.
b,: Upper integration limit.
y1a,: Initial condition for variable y_1.
y2a,: Initial condition for variable y_2.

Definition at line 864 of file OrdinaryDifferentialEquations.h.

template<class T >
int Flood::OrdinaryDifferentialEquations::calculate_Runge_Kutta_Fehlberg_integral ( T &  t,
Vector< double > &  x_out,
Vector< double > &  yOut,
double(T::*)(double, double)  f,
double  a,
double  b,
double  ya 
) [inline]

This method integrates differential equation

  • y' = f(x, y),

where y' is given as a class member method, from x=a to x=b and with initial condition y(a)=ya. The method is based on an explicit fourth order Runge-Kutta-Fehlberg formula.

Parameters:
t,: Object constructor containing the member methods to integrate (state equations).
x_out,: Pointer to vector with x values.
yOut,: Pointer to vector with y_1 values.
f,: Member method to integrate (state equation for variable y).
a,: Lower integration limit.
b,: Upper integration limit.
ya,: Initial condition for variable y.

Definition at line 644 of file OrdinaryDifferentialEquations.h.

int Flood::OrdinaryDifferentialEquations::calculate_Runge_Kutta_Fehlberg_integral ( Vector< double > &  x_out,
Vector< double > &  y1_out,
Vector< double > &  y2_out,
Vector< double > &  y3_out,
Vector< double > &  y4_out,
double(*)(double, double, double, double, double)  f_1,
double(*)(double, double, double, double, double)  f_2,
double(*)(double, double, double, double, double)  f_3,
double(*)(double, double, double, double, double)  f_4,
double  a,
double  b,
double  y1a,
double  y2a,
double  y3a,
double  y4a 
)

This method integrates the system of four differential equations

  • y_1' = f_1(x, y_1, y_2, y_3, y_4),
  • y_2' = f_2(x, y_1, y_2, y_3, y_4),
  • y_3' = f_3(x, y_1, y_2, y_3, y_4),
  • y_4' = f_4(x, y_1, y_2, y_3, y_4),

where y_1', y_2', y_3' and y_4' are given as C-style functions, from x=a to x=b with initial conditions y_1(a)=y1a, y_2(a)=y2a, y_3(a)=y3a and y_4(a)=y4a. The method is based on an explicit fourth order Runge-Kutta-Fehlberg formula.

Parameters:
x_out Pointer to vector with x values.
y1_out Pointer to vector with y_1 values.
y2_out Pointer to vector with y_2 values.
y3_out Pointer to vector with y_3 values.
y4_out Pointer to vector with y_4 values.
f_1 Member method to integrate (state equation for variable y_1).
f_2 Member method to integrate (state equation for variable y_2).
f_3 Member method to integrate (state equation for variable y_3).
f_4 Member method to integrate (state equation for variable y_4).
a Lower integration limit.
b Upper integration limit.
y1a Initial condition for variable y_1.
y2a Initial condition for variable y_2.
y3a Initial condition for variable y_3.
y4a Initial condition for variable y_4.

Definition at line 1439 of file OrdinaryDifferentialEquations.cpp.

int Flood::OrdinaryDifferentialEquations::calculate_Runge_Kutta_Fehlberg_integral ( Vector< double > &  x_out,
Vector< double > &  y1_out,
Vector< double > &  y2_out,
Vector< double > &  y3_out,
double(*)(double, double, double, double)  f_1,
double(*)(double, double, double, double)  f_2,
double(*)(double, double, double, double)  f_3,
double  a,
double  b,
double  y1a,
double  y2a,
double  y3a 
)

This method integrates the system of three differential equations

  • y_1' = f_1(x, y_1, y_2, y_3),
  • y_2' = f_2(x, y_1, y_2, y_3),
  • y_3' = f_3(x, y_1, y_2, y_3),

where y_1', y_2' and y_3' are given as C-style functions, from x=a to x=b with initial conditions y_1(a)=y1a, y_2(a)=y2a and y_3(a)=y3a. The method is based on an explicit fourth order Runge-Kutta-Fehlberg formula.

Parameters:
x_out Pointer to vector with x values.
y1_out Pointer to vector with y_1 values.
y2_out Pointer to vector with y_2 values.
y3_out Pointer to vector with y_3 values.
f_1 Member method to integrate (state equation for variable y_1).
f_2 Member method to integrate (state equation for variable y_2).
f_3 Member method to integrate (state equation for variable y_3).
a Lower integration limit.
b Upper integration limit.
y1a Initial condition for variable y_1.
y2a Initial condition for variable y_2.
y3a Initial condition for variable y_3.

Definition at line 1191 of file OrdinaryDifferentialEquations.cpp.

int Flood::OrdinaryDifferentialEquations::calculate_Runge_Kutta_Fehlberg_integral ( Vector< double > &  x_out,
Vector< double > &  y1_out,
Vector< double > &  y2_out,
double(*)(double, double, double)  f_1,
double(*)(double, double, double)  f_2,
double  a,
double  b,
double  y1a,
double  y2a 
)

This method integrates the system of two differential equations

  • y_1' = f_1(x, y_1, y_2),
  • y_2' = f_2(x, y_1, y_2),

where y_1' and y_2' are given as C-syle functions, from x=a to x=b with initial conditions y_1(a)=y1a and y_2(a)=y2a. The method is based on an explicit fourth order Runge-Kutta-Fehlberg formula.

Parameters:
x_out Pointer to vector with x values.
y1_out Pointer to vector with y_1 values.
y2_out Pointer to vector with y_2 values.
f_1 Member method to integrate (state equation for variable y_1).
f_2 Member method to integrate (state equation for variable y_2).
a Lower integration limit.
b,: Upper integration limit.
y1a Initial condition for variable y_1.
y2a Initial condition for variable y_2.

Definition at line 960 of file OrdinaryDifferentialEquations.cpp.

int Flood::OrdinaryDifferentialEquations::calculate_Runge_Kutta_Fehlberg_integral ( Vector< double > &  x_out,
Vector< double > &  yOut,
double(*)(double, double)  f,
double  a,
double  b,
double  ya 
)

This method integrates the differential equation

  • y' = f(x, y),

where y' is given as a C-style function, from x=a to x=b with initial condition y(a)=ya. The method is based on an explicit fourth order Runge-Kutta-Fehlberg formula.

Parameters:
x_out Pointer to vector with x values.
yOut Pointer to vector with y values.
f Pointer to C-style function f (state equation for variable y).
a Lower integration limit.
b Upper integration limit.
ya Initial condition for variable y.

Definition at line 778 of file OrdinaryDifferentialEquations.cpp.

template<class T >
void Flood::OrdinaryDifferentialEquations::calculate_Runge_Kutta_integral ( T &  t,
Vector< double > &  x,
Vector< double > &  y_1,
Vector< double > &  y_2,
Vector< double > &  y_3,
Vector< double > &  y_4,
Vector< double > &  y_5,
double(T::*)(double, double, double, double, double, double)  f_1,
double(T::*)(double, double, double, double, double, double)  f_2,
double(T::*)(double, double, double, double, double, double)  f_3,
double(T::*)(double, double, double, double, double, double)  f_4,
double(T::*)(double, double, double, double, double, double)  f_5,
double  a,
double  b,
double  y1a,
double  y2a,
double  y3a,
double  y4a,
double  y5a 
) [inline]

This method integrates the system of five differential equations

  • y_1' = f_1(x, y_1, y_2, y_3, y_4, y_5),
  • y_2' = f_2(x, y_1, y_2, y_3, y_4, y_5),
  • y_3' = f_3(x, y_1, y_2, y_3, y_4, y_5),
  • y_4' = f_4(x, y_1, y_2, y_3, y_4, y_5),
  • y_5' = f_5(x, y_1, y_2, y_3, y_4, y_5),

where y_1', y_2', y_3', y_4' and y_5' are given as class member methods, from x=a to x=b with initial conditions y_1(a)=y1a, y_2(a)=y2a, y_3(a)=y3a, y_4(a)=y4a and y_5(a)=y5a. The method is based on an explicit fourth order Runge-Kutta formula.

Parameters:
t,: Object constructor containing the member methods to integrate (state equations).
x,: Pointer to vector with x values.
y_1,: Pointer to vector with y_1 values.
y_2,: Pointer to vector with y_2 values.
y_3,: Pointer to vector with y_3 values.
y_4,: Pointer to vector with y_4 values.
y_5,: Pointer to vector with y_5 values.
f_1,: Member method to integrate (state equation for variable y_1).
f_2,: Member method to integrate (state equation for variable y_2).
f_3,: Member method to integrate (state equation for variable y_3).
f_4,: Member method to integrate (state equation for variable y_4).
f_5,: Member method to integrate (state equation for variable y_5).
a,: Lower integration limit.
b,: Upper integration limit.
y1a,: Initial condition for variable y_1.
y2a,: Initial condition for variable y_2.
y3a,: Initial condition for variable y_3.
y4a,: Initial condition for variable y_4.
y5a,: Initial condition for variable y_5.

Definition at line 538 of file OrdinaryDifferentialEquations.h.

template<class T >
void Flood::OrdinaryDifferentialEquations::calculate_Runge_Kutta_integral ( T &  t,
Vector< double > &  x,
Vector< double > &  y_1,
Vector< double > &  y_2,
Vector< double > &  y_3,
Vector< double > &  y_4,
double(T::*)(double, double, double, double, double)  f_1,
double(T::*)(double, double, double, double, double)  f_2,
double(T::*)(double, double, double, double, double)  f_3,
double(T::*)(double, double, double, double, double)  f_4,
double  a,
double  b,
double  y1a,
double  y2a,
double  y3a,
double  y4a 
) [inline]

This method integrates the system of four differential equations

  • y_1' = f_1(x, y_1, y_2, y_3, y_4),
  • y_2' = f_2(x, y_1, y_2, y_3, y_4),
  • y_3' = f_3(x, y_1, y_2, y_3, y_4),
  • y_4' = f_4(x, y_1, y_2, y_3, y_4),

where y_1', y_2', y_3' and y_4' are given as class member methods, from x=a to x=b with initial conditions y_1(a)=y1a, y_2(a)=y2a, y_3(a)=y3a and y_4(a)=y4a. The method is based on an explicit fourth order Runge-Kutta formula.

Parameters:
t,: Object constructor containing the member methods to integrate (state equations).
x,: Pointer to vector with x values.
y_1,: Pointer to vector with y_1 values.
y_2,: Pointer to vector with y_2 values.
y_3,: Pointer to vector with y_3 values.
y_4,: Pointer to vector with y_4 values.
f_1,: Member method to integrate (state equation for variable y_1).
f_2,: Member method to integrate (state equation for variable y_2).
f_3,: Member method to integrate (state equation for variable y_3).
f_4,: Member method to integrate (state equation for variable y_4).
a,: Lower integration limit.
b,: Upper integration limit.
y1a,: Initial condition for variable y_1.
y2a,: Initial condition for variable y_2.
y3a,: Initial condition for variable y_3.
y4a,: Initial condition for variable y_4.

Definition at line 419 of file OrdinaryDifferentialEquations.h.

template<class T >
void Flood::OrdinaryDifferentialEquations::calculate_Runge_Kutta_integral ( T &  t,
Vector< double > &  x,
Vector< double > &  y_1,
Vector< double > &  y_2,
Vector< double > &  y_3,
double(T::*)(double, double, double, double)  f_1,
double(T::*)(double, double, double, double)  f_2,
double(T::*)(double, double, double, double)  f_3,
double  a,
double  b,
double  y1a,
double  y2a,
double  y3a 
) [inline]

This method integrates the system of three differential equations

  • y_1' = f_1(x, y_1, y_2, y_3),
  • y_2' = f_2(x, y_1, y_2, y_3),
  • y_3' = f_3(x, y_1, y_2, y_3),

where y_1', y_2' and y_3' are given as class member methods, from x=a to x=b with initial conditions y_1(a)=y1a, y_2(a)=y2a and y_3(a)=y3a. The method is based on an explicit fourth order Runge-Kutta formula.

Parameters:
x,: Pointer to vector with x values.
y_1,: Pointer to vector with y_1 values.
y_2,: Pointer to vector with y_2 values.
y_3,: Pointer to vector with y_3 values.
t,: Object constructor containing the member methods to integrate (state equations).
f_1,: Member method to integrate (state equation for variable y_1).
f_2,: Member method to integrate (state equation for variable y_2).
f_3,: Member method to integrate (state equation for variable y_3).
a,: Lower integration limit.
b,: Upper integration limit.
y1a,: Initial condition for variable y_1.
y2a,: Initial condition for variable y_2.
y3a,: Initial condition for variable y_3.

Definition at line 315 of file OrdinaryDifferentialEquations.h.

template<class T >
void Flood::OrdinaryDifferentialEquations::calculate_Runge_Kutta_integral ( T &  t,
Vector< double > &  x,
Vector< double > &  y_1,
Vector< double > &  y_2,
double(T::*)(double, double, double)  f_1,
double(T::*)(double, double, double)  f_2,
double  a,
double  b,
double  y1a,
double  y2a 
) [inline]

This method integrates the system of two differential equations

  • y_1' = f_1(x, y_1, y_2),
  • y_2' = f_2(x, y_1, y_2),

where y_1' and y_2' are given as class member methods, from x=a to x=b with initial conditions y_1(a)=y1a and y_2(a)=y2a. The method is based on an explicit fourth order Runge-Kutta formula.

Parameters:
x,: Pointer to vector with x values.
y_1,: Pointer to vector with y_1 values.
y_2,: Pointer to vector with y_2 values.
t,: Object constructor containing the member methods to integrate (state equations).
f_1,: Member method to integrate (state equation for variable y_1).
f_2,: Member method to integrate (state equation for variable y_2).
a,: Lower integration limit.
b,: Upper integration limit.
y1a,: Initial condition for variable y_1.
y2a,: Initial condition for variable y_2.

Definition at line 226 of file OrdinaryDifferentialEquations.h.

template<class T >
void Flood::OrdinaryDifferentialEquations::calculate_Runge_Kutta_integral ( T &  t,
Vector< double > &  x,
Vector< double > &  y,
double(T::*)(double, double)  f,
double  a,
double  b,
double  ya 
) [inline]

This method integrates the differential equation

  • y' = f(x, y),

where y' is given as a class member method, from x=a to x=b with initial condition y(a)=ya. The method is based on an explicit fourth order Runge-Kutta formula.

Parameters:
x,: Pointer to vector with x values.
y,: Pointer to vector with y values.
t,: Object constructor containing the member method to integrate (state equation)
f,: Member method to integrate (state equation for variable y).
a,: Lower integration limit.
b,: Upper integration limit.
ya,: Initial condition for variable y.

Definition at line 154 of file OrdinaryDifferentialEquations.h.

void Flood::OrdinaryDifferentialEquations::calculate_Runge_Kutta_integral ( Vector< double > &  x,
Vector< double > &  y_1,
Vector< double > &  y_2,
Vector< double > &  y_3,
Vector< double > &  y_4,
Vector< double > &  y_5,
double(*)(double, double, double, double, double, double)  f_1,
double(*)(double, double, double, double, double, double)  f_2,
double(*)(double, double, double, double, double, double)  f_3,
double(*)(double, double, double, double, double, double)  f_4,
double(*)(double, double, double, double, double, double)  f_5,
double  a,
double  b,
double  y1a,
double  y2a,
double  y3a,
double  y4a,
double  y5a 
)

This method integrates the system of five differential equations

  • y_1' = f_1(x, y_1, y_2, y_3, y_4, y_5)
  • y_2' = f_2(x, y_1, y_2, y_3, y_4, y_5)
  • y_3' = f_3(x, y_1, y_2, y_3, y_4, y_5)
  • y_4' = f_4(x, y_1, y_2, y_3, y_4, y_5)
  • y_5' = f_5(x, y_1, y_2, y_3, y_4, y_5)

where y_1', y_2', y_3', y_4' and y_5' are given as C-style functions, from x=a to x=b with initial conditions y_1(a)=y1a, y_2(a)=y2a, y_3(a)=y3a, y_4(a)=y4a and y_5(a)=y5a. The method is based on an explicit fourth order Runge-Kutta formula.

Parameters:
x Pointer to vector with x values.
y_1 Pointer to vector with y_1 values.
y_2 Pointer to vector with y_2 values.
y_3 Pointer to vector with y_3 values.
y_4 Pointer to vector with y_4 values.
y_5 Pointer to vector with y_5 values.
f_1 Pointer to C-style function f_1 (state equation for variable y_1).
f_2 Pointer to C-style function f_2 (state equation for variable y_2).
f_3 Pointer to C-style function f_3 (state equation for variable y_3).
f_4 Pointer to C-style function f_4 (state equation for variable y_4).
f_5 Pointer to C-style function f_5 (state equation for variable y_5).
a Lower integration limit.
b Upper integration limit.
y1a Initial condition for variable y_1.
y2a Initial condition for variable y_2.
y3a Initial condition for variable y_3.
y4a Initial condition for variable y_4.
y5a Initial condition for variable y_5.

Definition at line 671 of file OrdinaryDifferentialEquations.cpp.

void Flood::OrdinaryDifferentialEquations::calculate_Runge_Kutta_integral ( Vector< double > &  x,
Vector< double > &  y_1,
Vector< double > &  y_2,
Vector< double > &  y_3,
Vector< double > &  y_4,
double(*)(double, double, double, double, double)  f_1,
double(*)(double, double, double, double, double)  f_2,
double(*)(double, double, double, double, double)  f_3,
double(*)(double, double, double, double, double)  f_4,
double  a,
double  b,
double  y1a,
double  y2a,
double  y3a,
double  y4a 
)

This method integrates the system of four differential equations

  • y_1' = f_1(x, y_1, y_2, y_3, y_4)
  • y_2' = f_2(x, y_1, y_2, y_3, y_4)
  • y_3' = f_3(x, y_1, y_2, y_3, y_4)
  • y_4' = f_4(x, y_1, y_2, y_3, y_4)

where y_1', y_2', y_3' and y_4' are given as C-style functions, from x=a to x=b with initial conditions y_1(a)=y1a, y_2(a)=y2a, y_3(a)=y3a and y_4(a)=y4a. The method is based on an explicit fourth order Runge-Kutta formula.

Parameters:
x Pointer to vector with x values.
y_1 Pointer to vector with y_1 values.
y_2 Pointer to vector with y_2 values.
y_3 Pointer to vector with y_3 values.
y_4 Pointer to vector with y_4 values.
f_1 Pointer to C-style function f_1 (state equation for variable y_1).
f_2 Pointer to C-style function f_2 (state equation for variable y_2).
f_3 Pointer to C-style function f_3 (state equation for variable y_3).
f_4 Pointer to C-style function f_4 (state equation for variable y_4).
a Lower integration limit.
b Upper integration limit.
y1a Initial condition for variable y_1.
y2a Initial condition for variable y_2.
y3a Initial condition for variable y_3.
y4a Initial condition for variable y_4.

Definition at line 514 of file OrdinaryDifferentialEquations.cpp.

void Flood::OrdinaryDifferentialEquations::calculate_Runge_Kutta_integral ( Vector< double > &  x,
Vector< double > &  y_1,
Vector< double > &  y_2,
Vector< double > &  y_3,
double(*)(double, double, double, double)  f_1,
double(*)(double, double, double, double)  f_2,
double(*)(double, double, double, double)  f_3,
double  a,
double  b,
double  y1a,
double  y2a,
double  y3a 
)

This method integrates the system of three differential equations

  • y_1' = f_1(x, y_1, y_2, y_3),
  • y_2' = f_2(x, y_1, y_2, y_3),
  • y_3' = f_3(x, y_1, y_2, y_3),

where y_1', y_2' and y_3' are given as C-style functions, from x=a to x=b with initial conditions y_1(a)=y1a, y_2(a)=y2a and y_3(a)=y3a.

The method is based on an explicit fourth order Runge-Kutta formula.

Parameters:
x Pointer to vector with x values.
y_1 Pointer to vector with y_1 values.
y_2 Pointer to vector with y_2 values.
y_3 Pointer to vector with y_3 values.
f_1 Pointer to C-style function f_1 (state equation for variable y_1).
f_2 Pointer to C-style function f_2 (state equation for variable y_2).
f_3 Pointer to C-style function f_3 (state equation for variable y_3).
a Lower integration limit.
b Upper integration limit.
y1a Initial condition for variable y_1.
y2a Initial condition for variable y_2.
y3a Initial condition for variable y_3.

Definition at line 408 of file OrdinaryDifferentialEquations.cpp.

void Flood::OrdinaryDifferentialEquations::calculate_Runge_Kutta_integral ( Vector< double > &  x,
Vector< double > &  y_1,
Vector< double > &  y_2,
double(*)(double, double, double)  f_1,
double(*)(double, double, double)  f_2,
double  a,
double  b,
double  y1a,
double  y2a 
)

This method integrates the system of two differential equations

  • y_1' = f_1(x, y_1, y_2),
  • y_2' = f_2(x, y_1, y_2),

where y_1' and y_2' are given as C-style functions, from x=a to x=b with initial conditions y_1(a)=y1a and y_2(a)=y2a. The method is based on an explicit fourth order Runge-Kutta formula.

Parameters:
x Pointer to vector with x values.
y_1 Pointer to vector with y_1 values.
y_2 Pointer to vector with y_2 values.
f_1 Pointer to C-style function f_1' (state equation for variable y_1).
f_2 Pointer to C-style function f_2' (state equation for variable y_2).
a Lower integration limit.
b Upper integration limit.
y1a Initial condition for variable y_1.
y2a Initial condition for variable y_2.

Definition at line 316 of file OrdinaryDifferentialEquations.cpp.

void Flood::OrdinaryDifferentialEquations::calculate_Runge_Kutta_integral ( Vector< double > &  x,
Vector< double > &  y,
double(*)(double, double)  f,
double  a,
double  b,
double  ya 
)

This method integrates the differential equation

  • y' = f(x, y),

where y' is given as a C-style function, from x=a to x=b with initial condition y(a)=ya. The method is based on an explicit fourth order Runge-Kutta formula.

Parameters:
x Pointer to vector with x values.
y Pointer to vector with y values.
f Pointer to C-style function f (state equation for variable y).
a Lower integration limit.
b Upper integration limit.
ya Initial condition for variable y.

Definition at line 244 of file OrdinaryDifferentialEquations.cpp.

bool Flood::OrdinaryDifferentialEquations::get_display ( void   ) 

This method returns true if messages from this class are to be displayed on the screen, or false if messages from this class are not to be displayed on the screen.

Definition at line 106 of file OrdinaryDifferentialEquations.cpp.

int Flood::OrdinaryDifferentialEquations::get_error_size ( void   ) 

This method returns the size of the solution vectors at wich the Runge-Kutta-Fehlberg method throws an error.

Definition at line 95 of file OrdinaryDifferentialEquations.cpp.

int Flood::OrdinaryDifferentialEquations::get_initial_size ( void   ) 

This method returns the initial size of the solution vectors for the Runge-Kutta-Fehlberg method. If during integration the number of points required is greater, the algorithm resizes that vectors.

Definition at line 74 of file OrdinaryDifferentialEquations.cpp.

int Flood::OrdinaryDifferentialEquations::get_points_number ( void   ) 

This method returns the number of integration points to be used in the Runge-Kutta method.

Definition at line 53 of file OrdinaryDifferentialEquations.cpp.

double Flood::OrdinaryDifferentialEquations::get_tolerance ( void   ) 

This method returns the tolerance to be used in the Runge-Kutta-Fehlberg method.

Definition at line 63 of file OrdinaryDifferentialEquations.cpp.

int Flood::OrdinaryDifferentialEquations::get_warning_size ( void   ) 

This method returns the size for the solution vectors at wich a warning message is written to the screen during Runge-Kutta-Fehlberg integration.

Definition at line 85 of file OrdinaryDifferentialEquations.cpp.

void Flood::OrdinaryDifferentialEquations::set_default ( void   ) 

This method sets the members of the objective functional object to their default values: Runge-Kutta method parameters:

  • Points number: 1001.
Runge-Kutta-Fehlberg method parameters:
  • Tolerance: 1.0e-9.
  • Initial size: 1e3.
  • Warning size: 1e6.
  • Error size: 1e9.
Utilities:
  • Display: true.

Definition at line 133 of file OrdinaryDifferentialEquations.cpp.

void Flood::OrdinaryDifferentialEquations::set_display ( bool  new_display  ) 

This method sets a new display value. If it is set to true messages from this class are to be displayed on the screen; if it is set to false messages from this class are not to be displayed on the screen.

Parameters:
new_display Display value.

Definition at line 217 of file OrdinaryDifferentialEquations.cpp.

void Flood::OrdinaryDifferentialEquations::set_error_size ( int  new_error_size  ) 

This method returns sets a new size for the solution vectors at wich the Runge-Kutta-Fehlberg method throws an error.

Parameters:
new_error_size Error size value.

Definition at line 204 of file OrdinaryDifferentialEquations.cpp.

void Flood::OrdinaryDifferentialEquations::set_initial_size ( int  new_initial_size  ) 

This method returns sets a new initial size of the solution vectors for the Runge-Kutta-Fehlberg method. If during integration the number of points required is greater, the algorithm resizes that vectors.

Parameters:
new_initial_size Initial size for the solution vectors.

Definition at line 180 of file OrdinaryDifferentialEquations.cpp.

void Flood::OrdinaryDifferentialEquations::set_points_number ( int  new_points_number  ) 

This method returns sets a new number of integration points to be used in the Runge-Kutta method.

Parameters:
new_points_number Number of integration points.

Definition at line 157 of file OrdinaryDifferentialEquations.cpp.

void Flood::OrdinaryDifferentialEquations::set_tolerance ( double  new_tolerance  ) 

This method sets a new tolerance to be used in the Runge-Kutta-Fehlberg method.

Parameters:
new_tolerance Tolerance in the integration error.

Definition at line 168 of file OrdinaryDifferentialEquations.cpp.

void Flood::OrdinaryDifferentialEquations::set_warning_size ( int  new_warning_size  ) 

This method a new size for the solution vectors at wich a warning message is written to the screen during Runge-Kutta-Fehlberg integration.

Parameters:
new_warning_size Warning size value.

Definition at line 192 of file OrdinaryDifferentialEquations.cpp.


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

Generated on Fri Jul 30 09:52:01 2010 for Flood by  doxygen 1.5.9