cpp_an_ode

View page source

Use C++ Runge-Kutta Method to Solve an ODE

Syntax

      # include <cmpad/algo/an_ode.hpp>
      cmpad::an_ode < Vector > ode
      ode . setup ( option )
      y = ode ( x )

Class Declaration

template <class Vector> class an_ode : public fun_obj<Vector>

Algo

This is an cpp_fun_obj interface to the an_ode Algorithm . We use Algo for the type of this algorithm; i.e.,

      typedef cmpad::an_ode < Vector > Algo

Vector

This is a fun_obj Vector type.

vector_type

The type Algo :: vector_type is the same as Vector . This is useful when Algo is a template parameter.

scalar_type

The type Algo :: scalar_type is the type of the elements of Vector ; i.e., Vector :: value_type . This is also useful when Algo is a template parameter.

ode

The object ode is a fun that computes the function corresponding to the an_ode algorithm.

option

This is an option_t object that specifies n_arg and n_other .

n_arg

see n_arg .

n_other

see n_other .

x

This is the Parameter Vector that appears in the ODE.

yf

The return value yf is \(y(t)\) at \(t = 2\) .

Example

xam_an_ode.cpp contains an example and test of an_ode .

Source Code

an_ode.hpp displays the source code for this algorithm.