|
Algorithms_in_C++
1.0.0
Set of algorithms implemented in C++.
|
Runge Kutta fourth order method implementation More...
#include <iostream>#include <vector>#include <cassert>Namespaces | |
| numerical_methods | |
| for io operations | |
| runge_kutta | |
| Functions for Runge Kutta fourth order method. | |
Functions | |
| double | numerical_methods::runge_kutta::rungeKutta (double init_x, const double &init_y, const double &x, const double &h) |
| the Runge Kutta method finds the value of integration of a function in the given limits. the lower limit of integration as the initial value and the upper limit is the given x More... | |
| static double | change (double x, double y) |
| asserting the test functions More... | |
| static void | test () |
| Tests to check algorithm implementation. More... | |
| int | main () |
| Main function. More... | |
Runge Kutta fourth order method implementation
It solves the unknown value of y for a given value of x only first order differential equations can be solved
|
static |
asserting the test functions
for io operations for using the vector container
The change() function is used to return the updated iterative value corresponding to the given function
| x | is the value corresponding to the x coordinate |
| y | is the value corresponding to the y coordinate |
| int main | ( | void | ) |
Main function.
| double numerical_methods::runge_kutta::rungeKutta | ( | double | init_x, |
| const double & | init_y, | ||
| const double & | x, | ||
| const double & | h | ||
| ) |
the Runge Kutta method finds the value of integration of a function in the given limits. the lower limit of integration as the initial value and the upper limit is the given x
| init_x | is the value of initial x and is updated after each call |
| init_y | is the value of initial x and is updated after each call |
| x | is current iteration at which the function needs to be evaluated |
| h | is the step value |
|
static |
Tests to check algorithm implementation.