Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

OpenCAL::RungeKutta4Solver Class Reference

#include <RungeKutta4Solver.h>

Inheritance diagram for OpenCAL::RungeKutta4Solver:

Inheritance graph
[legend]
Collaboration diagram for OpenCAL::RungeKutta4Solver:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void solve (float stepSize, ODESource *source)

Detailed Description

This ODE solver implements the Runge-Kutta order 4 method for solving Ordinary Differential Equations

Definition at line 26 of file RungeKutta4Solver.h.


Member Function Documentation

void RungeKutta4Solver::solve float  stepSize,
ODESource source
[virtual]
 

\[ k_1 = hf(x_0, t_0) \]

\[ k_2 = hf(x_0 + \frac{k_1}{2}, t_0 + \frac{h}{2}) \]

\[ k_3 = hf(x_0 + \frac{k_2}{2}, t_0 + \frac{h}{2}) \]

\[ k_4 = hf(x_0 + k_3, t_0 + h) \]

\[ x(t_0 + h) = x_0 + \frac{1}{6} k_1 + \frac{1}{3} k_2 + \frac{1}{3} k_3 + \frac{1}{6} k_4 \]

Error: $ O(h^5) $

Todo:
We should have easier functions for the ODE source (not very intuitive this way) -> provide a function to get the derivative f at a given state x (time t not necesarry): $ f(x, t) $

Implements OpenCAL::ODESolver.

Definition at line 54 of file RungeKutta4Solver.cpp.

References OpenCAL::PhaseSpace::add(), OpenCAL::ODESource::fillDerivative(), OpenCAL::ODESource::fillState(), OpenCAL::ODESource::fromState(), OpenCAL::ODESource::getDerivative(), and OpenCAL::ODESource::getState().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Sun Aug 15 19:19:36 2004 for OpenCAL: Open Computer Animation Library by doxygen 1.3.8