Michael Thomas Flanagan's Java Scientific Library

RungeKutta Class:      Numerical Solution of Differential Equations

     

Last update: 31 January 2010
Main Page of Michael Thomas Flanagan's Java Scientific Library

This class contains the methods for performing the solving a single ordinary differential equation (ODE) and for solving a set of ordinary differential equations: A single ODE is supplied by means of the interface, DerivFunction.
A set of ODEs is supplied by means of the interface, DerivnFunction.
import statement/s: import flanagan.integration.RungeKutta;
import flanagan.integration.DerivFunction; [single ODE]
import flanagan.integration.DerivnFunction; [set of ODEs]
Related classes

SUMMARY OF METHODS

Constructor public RungeKutta()
Set initial value of x public void setInitialValueOfX(double x0)
Set final value of x public void setFinalValueOfX(double xn)
Set initial value/s of y public void setInitialValueOfY(double y0)
public void setInitialValuesOfY(double[] y0)
Set step size / initial step size public void setStepSize(double step)
Set tolerance (accuracy) public void setToleranceScalingFactor(double tolSF)
public void setToleranceAdditionFactor(double tolAddn)
Number of iterations public void setMaximumIterations(int maxIter)
public int getNumberOfIterations()
public static void resetNstepsMultiplier(int multiplier)
4th order Runge-Kutta public double fourthOrder(DerivFunction g)
public static double fourthOrder(DerivFunction g, double x0, double y0, double xn, double h)
public double[] fourthOrder(DerivnFunction g)
public static double[ ] fourthOrder(DerivnFunction g, double x0, double[ ] y0, double xn, double h)
Runge-Kutta-Cash-Karp public double cashKarp(DerivFunction g)
public static double cashKarp(DerivFunction g, double x0, double y0, double xn, double h, double abstol, double reltol, int maxiter)
public static double cashKarp(DerivFunction g, double x0, double y0, double xn, double h, double abstol, double reltol)
public double[] cashKarp(DerivnFunction g)
public static double[ ] cashKarp(DerivnFunction g, double x0, double[ ] y0, double xn, double h, double abstol, double reltol, int maxiter)
public static double[ ] cashKarp(DerivnFunction g, double x0, double[ ] y0, double xn, double h, double abstol, double reltol)
Runge-Kutta-Fehlberg public double fehlberg(DerivFunction g)
public static double fehlberg(DerivFunction g, double x0, double y0, double xn, double h, double abstol, double reltol, int maxiter)
public static double fehlberg(DerivFunction g, double x0, double y0, double xn, double h, double abstol, double reltol)
public double[] fehlberg(DerivnFunction g)
public static double[ ] fehlberg(DerivnFunction g, double x0, double[ ] y0, double xn, double h, double abstol, double reltol, int maxiter)
public static double[ ] fehlberg(DerivnFunction g, double x0, double[ ] y0, double xn, double h, double abstol, double reltol)



CONSTRUCTOR AND METHODS

CONSTRUCTOR
public double RungeKutta()

Usage:                      RungeKutta rk = RungeKutta();
Creates an instance of RungeKutta.



SET THE INITIAL VALUE OF X
public void setInitialValueOfX(double x0)
Usage:                      rk.setInitialValueOfX(x0);
Sets the intial value of x, as argument x0, for the single (n=1) or n differential equations (ODEs):
                    

SET THE FINAL VALUE OF X
public void setFinalValueOfX(double xn)
Usage:                      rk.setFinalValueOfX(xn);
Sets the final value of x, as argument xn, for the single (n=1) or n differential equations (ODEs):
                    

SET THE INITIAL VALUE OR VALUES OF Y
Set initial value of y (single ODE)
public void setInitialValueOfY(double y0)
Usage:                      rk.setInitialValueOfY(y0);
Sets the intial value of y, as argument y0, for a single differential equations (ODE):
                    

Set initial values of y (several ODEs)
public void setInitialValuesOfY(double[] yy0)
Usage:                      rk.setInitialValuesOfY(yy0);
Sets the intial values of y, as argument yy0, for n differential equations (ODEs):
                    

SET THE STEP SIZE OR INITIAL STEP SIZE
public void setStepSize(double step)
Usage:                      rk.setStepSize(step);
Sets the step size, as argument step, used by the Runge-Kutta procedure. In the case of the adaptive step procedures the entered value is the initial step size.

SET THE TOLERANCE (ACCURACY) REQUIRED BY THE ADAPTIVE STEP METHODS
The step size h is adjusted on each iteration by the Fehlberg and by the Cash-Karp procedures. After each iteration the ratio, R, is calculated where
                    
and y is the predicted value of y after the last step, err is the difference in the prediction of y using a 4th and 5th order Runge-Kutta procedure. If R is greater than one the step is rejected, the value of h is decreased as
                    
and the step repeated. If R is less than one the step is accepted and the value of h is increased by
                    
for the next step. The scaling factor, reltol, is a measure of the required accuracy and a trial value approximating to the reqiuired fractional accuracy in y is suggested. The factor, abstol, is a small number to accommodate the possibility of a zero value in one of the y values precluding its scaling.

public void setToleranceScalingFactor(double relTol)
Usage:                      rk.setToleranceScalingFactor(relTol);
Sets the value of scaling tolerance factor, reltol, as argument relTol, as described above.

public void setToleranceAdditionFactor(double absTol)
Usage:                      rk.setToleranceAdditionFactor(absTol);
Sets the value of addition tolerance factor, abstol, as argument absTol, as described above.

NUMBER OF ITERATIONS
Set the maximum number of iterations allowed in the adaptive step methods
public void setMaximumIterations(int maxIter)
Usage:                      rk.setMaximumIterations(maxIter);
Sets the value of maximum number of iterations, as argument maxIter, allowed in the adaptive step methods. See immediately below for the default value.

public static void resetNstepsMultiplier(int multiplier)
Usage:                      RungeKutta.resetNstepsMultiplier(multiplier);
If the method setting the maximum number of allowed iterations (see immediately above) is not called this number is calculated as multiplier(xn - x0)/h where x0 is the intial value of x, xn is the final value, h is the initial step size and the multiplier as a default value of 1000. This method allows the value of the multiplier factor to be reset.

Get the number of iterations performed
public int getNumberOfIterations()
Usage:                      nIter = rk.getNumberOfIterations();
Returns the number of iterations performed by any of the methods, fixed step or adaptive step.



FOURTH ORDER RUNGE-KUTTA METHOD
Set of n Ordinary Differential Equations (See below for n = 1)
Instance method
public static double[ ] fourthOrder(DerivnFunction g)
Usage:                      y = rk.fourthOrder(func);
Returns the n values of yi, as y[i], at the final value of x for the initial value of x and initial values of y, entered by the relevant setting methods described above, for a set of n ordinary differential equation (ODEs):
                    
The method uses a classical fourth order Runge-Kutta procedure hence the step size is fixed. If (final value of x - initial value of x)/(step size) is not an integer the step size is first adjusted so that it is.
The argument, func, is a reference to the instance of the class that codes the function, f(x, y)reference (pointer) to the instance of the class that codes the function, f(x, y).
The mathematical functions to which the derivatives are equal, i.e. the n fi(x, yi), must be coded as a method
                    public double[ ] derivn(double x, double[ ] y)
The method, derivn, must have the above signature, i.e. name, type and argument list, and be a method in a class which must implement the interface, DerivnFunction. The name of this class is the user's choice. The arguments to the mathematical version of the functions, fi(x, yi, a, b, c . . .) other than x and the n yi, i.e. a, b, c . . . may not be included in the method deriv(x, y) argument list. They should be declared as members of the class of which derivn(x, y) is a member. The function is passed to the RungeKutta.fourthOrder(. . .) method as an instance of the class containing the method derivn(x, y) [func in the above example but this instance may be named at the user's choice]. This instance should be created in the method that calls RungeKutta.fourthOrder(. . .). This procedure can be seen more clearly in example four in Example programs.

Static method
public static double[ ] fourthOrder(DerivnFunction g, double x0, double[ ] y0, double xn, double h)
Usage:                      y = RungeKutta.fourthOrder(func, x0, y0, xn, h);
Returns the n values of y[i] at a given value of x (xn) for a set of n ordinary differential equation (ODEs):
                    
given initial values of the n y(i), y0[i], at an initial value of x, x0, the final value of x, xn, the step size h and a reference (pointer) to the instance of the class that codes the function, f(x, y), func.
The method uses a classical fourth order Runge-Kutta procedure hence the step size is fixed. If (xn - x0)/h is not an integer the step size h is first adjusted so that it is.
The mathematical functions to which the derivatives are equal, i.e. the n fi(x, yi), must be coded as a method
                    public double[ ] derivn(double x, double[ ] y)
The method, derivn, must have the above signature, i.e. name, type and argument list, and be a method in a class which must implement the interface, DerivnFunction. The name of this class is the user's choice. The arguments to the mathematical version of the functions, fi(x, yi, a, b, c . . .) other than x and the n yi, i.e. a, b, c . . . may not be included in the method deriv(x, y) argument list. They should be declared as members of the class of which derivn(x, y) is a member. The function is passed to the RungeKutta.fourthOrder(. . .) method as an instance of the class containing the method derivn(x, y) [func in the above example but this instance may be named at the user's choice]. This instance should be created in the method that calls RungeKutta.fourthOrder(. . .). This procedure can be seen more clearly in example two in Example programs.

FOURTH ORDER RUNGE-KUTTA METHOD
Single Ordinary Differential Equation
Instance method
public double fourthOrder(DerivFunction g)
Usage:                      y = rk.fourthOrder(func);
Returns the value of yi, as y, at the final value of x for the initial value of x and initial value of y, entered by the relevant setting methods described above, for a set of the ordinary differential equation (ODE):
                    
The method uses a classical fourth order Runge-Kutta procedure hence the step size is fixed. If (final value of x - initial value of x)/(step size) is not an integer the step size is first adjusted so that it is.
The argument, func, is a reference to the instance of the class that codes the function, f(x, y)reference (pointer) to the instance of the class that codes the function, f(x, y).
The mathematical function to which the derivative is equal, i.e. fi(x, yi), must be coded as a method
                    public double deriv(double x, double y)
The method, deriv, must have the above signature, i.e. name, type and argument list, and be a method in a class which must implement the interface, DerivnFunction. The name of this class is the user's choice. The arguments to the mathematical version of the functions, fi(x, y, a, b, c . . .) other than x and y, i.e. a, b, c . . . may not be included in the method deriv(x, y) argument list. They should be declared as public members of the class of which deriv(x, y) is a member. The function is passed to the RungeKutta.fourthOrder(. . .) method as an instance of the class containing the method derivn(x, y) [func in the above example but this instance may be named at the user's choice]. This instance should be created in the method that calls RungeKutta.fourthOrder(. . .). This procedure can be seen more clearly in example three in Example programs.

Static method
public static double fourthOrder(DerivFunction g, double x0, double y0, double xn, double h)
Usage:                      y = RungeKutta.fourthOrder(func, x0, y0, xn, h);
Returns the value of y at a given value of x (xn) for a single ordinary differential equation (ODE):
                    
given an initial value of y, y0, at an initial value of x, x0, the final value of x, xn, the initial step size h and a reference to the instance of the class that codes the function, f(x, y), func.
The method uses a classical fourth order Runge-Kutta procedure hence the step size is fixed. If (xn - x0)/h is not an integer the step size h is first adjusted so that it is.
The mathematical function to which the derivative is equal, i.e. f(x, y), must be coded as a method
                    public double deriv(double x, double y)
The method, deriv, must have the above signature, i.e. name, type and argument list, and be a method in a non-public class which must implement the interface, DerivFunction. The name of this class is the user's choice. The arguments to the mathematical version of the function, f(x, y, a, b, c . . .) other than x and y, i.e. a, b, c . . . may not be included in the method deriv(x, y) argument list. They should be declared as members of the class of which deriv(x, y) is a member. The function is passed to the RungeKutta.fehlberg(. . .) method as an instance of the class containing the method deriv(x, y) [func in the above example but this instance may be named at the user's choice]. This instance should be created in the method that calls RungeKutta.fehlberg(. . .). This procedure can be seen more clearly in example one in Example programs .



RUNGE-KUTTA-FEHLBERG METHOD
Set of n Ordinary Differential Equations (See below for n = 1)
Instance method
public double[ ] fehlberg(DerivnFunction g)
Usage:                      y = rk.fehlberg(func);
Returns the n values of yi, as y[i], at the final value of x for the initial value of x and initial values of y, entered by the relevant setting methods described above, for a set of n ordinary differential equation (ODEs):
                    
The method uses Fehlberg's modification of the Runge-Kutta procedure incorporating an adaptive step size.
The argument, func, is a reference to the instance of the class that codes the function, f(x, y)reference (pointer) to the instance of the class that codes the function, f(x, y).
The mathematical functions to which the derivatives are equal, i.e. the n fi(x, yi), must be coded as a method
                    public double[ ] derivn(double x, double[ ] y)
The method, derivn, must have the above signature, i.e. name, type and argument list, and be a method in a class which must implement the interface, DerivnFunction. The name of this class is the user's choice. The arguments to the mathematical version of the functions, fi(x, yi, a, b, c . . .) other than x and the n yi, i.e. a, b, c . . . may not be included in the method deriv(x, y) argument list. They should be declared as members of the class of which derivn(x, y) is a member. The function is passed to the RungeKutta.fourthOrder(. . .) method as an instance of the class containing the method derivn(x, y) [func in the above example but this instance may be named at the user's choice]. This instance should be created in the method that calls RungeKutta.fourthOrder(. . .). This procedure can be seen more clearly in example four in Example programs.

Static methods
public static double[ ] fehlberg(DerivnFunction g, double x0, double[ ] y0, double xn, double h, double abstol, double reltol, double maxiter)
public static double[ ] fehlberg(DerivnFunction g, double x0, double[ ] y0, double xn, double h, double abstol, double reltol)
Usage:
                      y = RungeKutta.fehlberg(func, x0, y0, xn, h, abstol, reltol, maxiter);
                      y = RungeKutta.fehlberg(func, x0, y0, xn, h, abstol, reltol);

Returns the n values of y[i] at a given value of x (xn) for a set of n ordinary differential equation (ODEs):
                    
given initial values of the n y(i), y0[i], at an initial value of x, x0, the final value of x, xn, the initial step size h, an absolute tolerance abstol, a relative tolerance abstol, a maximum number of iterations maxiter and a reference (pointer) to the instance of the class that codes the functions, f(x, y), func.
The step size h is adjusted on each iteration by Fehlberg's procedure. After each iteration the ratio, R, is calculated, where
                    
and y(i) are the n predicted values of the n y(i) after the last step, err(i) are the differences in the n predictions of the n y(i) using a 4th and 5th order Runge-Kutta procedure. If R is greater than one the step is rejected, the value of h is decreased as
                    
and the step repeated. If R is less than one the step is accepted and the value of h is increased by
                    
for the next step. The scaling factor, reltol, is a measure of the required accuracy and a trial value approximating to the reqiuired fractional accuracy in y is suggested. The factor, abstol, is a small number to accommodate the possibility of a zero value in one of the y values precluding its scaling.
If the maximum number of iterations, maxiter, is reached a ArthmeticException is thrown and the program is terminated. If maxiter is not included in the argument it is calculated as multiplier(xn - x0)/h. The multiplier has a default value of 1000 and maybe reset (see method above).
The mathematical functions to which the derivatives are equal, i.e. the n fi(x, yi), must be coded as a method
                    public double[ ] derivn(double x, double[ ] y)
The method, derivn, must have the above signature, i.e. name, type and argument list, and be a method in a non-public class which must implement the interface, DerivnFunction. The name of this class is the user's choice. The arguments to the mathematical version of the functions, fi(x, yi, a, b, c . . .) other than x and the n yi, i.e. a, b, c . . . may not be included in the method deriv(x, y) argument list. They should be declared as members of the class of which derivn(x, y) is a member. The function is passed to the RungeKutta.fehlberg(. . .) method as an instance of the class containing the method derivn(x, y) [func in the above example but this instance may be named at the user's choice]. This instance should be created in the method that calls RungeKutta.fehlberg(. . .). This procedure can be seen more clearly in example two in Example programs. This example considers the fourth order Runge-Kutta but the programming scheme is equally illustrative of the Fehlberg method. Only the extra parameters, abstol, reltol, (maxiter), need adding and the call statement amending.

RUNGE-KUTTA-FEHLBERG METHOD
Single Ordinary Differential Equation
Instance method
public double[ ] fehlberg(DerivFunction g)
Usage:                      y = rk.fehlberg(func);
Returns the value of yi, as y, at the final value of x for the initial value of x and initial value of y, entered by the relevant setting methods described above, for the ordinary differential equation (ODE):
                    
The method uses Fehlberg's modification of the Runge-Kutta procedure incorporating an adaptive step size.
The argument, func, is a reference to the instance of the class that codes the function, f(x, y)reference (pointer) to the instance of the class that codes the function, f(x, y).
The mathematical functions to which the derivative is equal, i.e. fi(x, yi), must be coded as a method
                    public double deriv(double x, double y)
The method, deriv, must have the above signature, i.e. name, type and argument list, and be a method in a class which must implement the interface, DerivnFunction. The name of this class is the user's choice. The arguments to the mathematical version of the functions, fi(x, y, a, b, c . . .) other than x and the y, i.e. a, b, c . . . may not be included in the method deriv(x, y) argument list. They should be declared as public members of the class of which derivn(x, y) is a member. The function is passed to the RungeKutta.fourthOrder(. . .) method as an instance of the class containing the method deriv(x, y) [func in the above example but this instance may be named at the user's choice]. This instance should be created in the method that calls RungeKutta.fourthOrder(. . .). This procedure can be seen more clearly in example three in Example programs.

Static methods
public static double fehlberg(DerivFunction g, double x0, double y0, double xn, double h, double abstol, double reltol, double maxiter)
public static double fehlberg(DerivFunction g, double x0, double y0, double xn, double h, double abstol, double reltol)
Usage:
                      y = RungeKutta.fehlberg(func, x0, y0, xn, h, abstol, reltol, maxiter);
                      y = RungeKutta.fehlberg(func, x0, y0, xn, h, abstol, reltol);

Returns the value of y at a given value of x (xn) for a single ordinary differential equation (ODE):
                    
given an initial value of y, y0, at an initial value of x, x0, the final value of x, xn, the initial step size h, an absolute tolerance abstol, a relative tolerance abstol, a maximum number of iterations maxiter and a reference (pointer) to the instance of the class that codes the function, f(x, y), func.
The step size h is adjusted on each iteration by Fehlberg's procedure. After each iteration the ratio, R, is calculated where
                    
and y is the predicted value of y after the last step, err is the difference in the prediction of y using a 4th and 5th order Runge-Kutta procedure. If R is greater than one the step is rejected, the value of h is decreased as
                    
and the step repeated. If R is less than one the step is accepted and the value of h is increased by
                    
for the next step. The scaling factor, reltol, is a measure of the required accuracy and a trial value approximating to the reqiuired fractional accuracy in y is suggested. The factor, abstol, is a small number to accommodate the possibility of a zero value in one of the y values precluding its scaling.
If the maximum number of iterations, maxiter, is reached a ArthmeticException is thrown and the program is terminated. If maxiter is not included in the argument it is calculated as multiplier(xn - x0)/h. The multiplier has a default value of 1000 and maybe reset (see method above).
The mathematical function to which the derivative is equal, i.e. f(x, y), must be coded as a method
                    public double deriv(double x, double y)
The method, deriv, must have the above signature, i.e. name, type and argument list, and be a method in a non-public class which must implement the interface, DerivFunction. The name of this class is the user's choice. The arguments to the mathematical version of the function, f(x, y, a, b, c . . .) other than x and y, i.e. a, b, c . . . may not be included in the method deriv(x, y) argument list. They should be declared as members of the class of which deriv(x, y) is a member. The function is passed to the RungeKutta.fehlberg(. . .) method as an instance of the class containing the method deriv(x, y) [func in the above example but this instance may be named at the user's choice]. This instance should be created in the method that calls RungeKutta.fehlberg(. . .). This instance should be created in the method that calls RungeKutta.fehlberg(. . .). This procedure can be seen more clearly in example one in Example programs. This example considers the fourth order Runge-Kutta but the programming scheme is equally illustrative of the Fehlberg method. Only the extra parameters, abstol, reltol, (maxiter), need adding and the call statement amending.



RUNGE-KUTTA-CASH-KARP METHOD
Set of n Ordinary Differential Equations (See below for n = 1)
Instance method
public double[ ] cashKarp(DerivnFunction g)
Usage:                      y = rk.cashKarp(func);
Returns the n values of yi, as y[i], at the final value of x for the initial value of x and initial values of y, entered by the relevant setting methods described above, for a set of n ordinary differential equation (ODEs):
                    
The method uses Cash and Karp's modification of the Runge-Kutta procedure incorporating an adaptive step size.
The argument, func, is a reference to the instance of the class that codes the function, f(x, y)reference (pointer) to the instance of the class that codes the function, f(x, y).
The mathematical functions to which the derivatives are equal, i.e. the n fi(x, yi), must be coded as a method
                    public double[ ] derivn(double x, double[ ] y)
The method, derivn, must have the above signature, i.e. name, type and argument list, and be a method in a class which must implement the interface, DerivnFunction. The name of this class is the user's choice. The arguments to the mathematical version of the functions, fi(x, yi, a, b, c . . .) other than x and the n yi, i.e. a, b, c . . . may not be included in the method deriv(x, y) argument list. They should be declared as members of the class of which derivn(x, y) is a member. The function is passed to the RungeKutta.fourthOrder(. . .) method as an instance of the class containing the method derivn(x, y) [func in the above example but this instance may be named at the user's choice]. This instance should be created in the method that calls RungeKutta.fourthOrder(. . .). This procedure can be seen more clearly in example four in Example programs.

Static methods
public static double[ ] cashKarp(DerivnFunction g, double x0, double[ ] y0, double xn, double h, double abstol, double reltol, double maxiter)
public static double[ ] cashKarp(DerivnFunction g, double x0, double[ ] y0, double xn, double h, double abstol, double reltol)
Usage:
                      y = RungeKutta.cashKarp(func, x0, y0, xn, h, abstol, reltol, maxiter);
                      y = RungeKutta.cashKarp(func, x0, y0, xn, h, abstol, reltol);

Returns the n values of y[i] at a given value of x (xn) for a set of n ordinary differential equation (ODEs):
                    
This method is essentially the same as the Fehlberg method (see above). The coefficients derived by Cash and Karp differ from those of Fehlberg and are said to give a more efficient method. The programming instructions are identical to those listed under the Fehlberg method above.

RUNGE-KUTTA-CASH-KARP METHOD
Single Ordinary Differential Equation
Instance method
public double[ ] cashKarp(DerivFunction g)
Usage:                      y = rk.cashKarp(func);
Returns the value of yi, as y, at the final value of x for the initial value of x and initial value of y, entered by the relevant setting methods described above, for the ordinary differential equation (ODE):
                    
The method uses Cash and Karp's modification of the Runge-Kutta procedure incorporating an adaptive step size.
The argument, func, is a reference to the instance of the class that codes the function, f(x, y)reference (pointer) to the instance of the class that codes the function, f(x, y).
The mathematical functions to which the derivative is equal, i.e. fi(x, yi), must be coded as a method
                    public double deriv(double x, double y)
The method, deriv, must have the above signature, i.e. name, type and argument list, and be a method in a class which must implement the interface, DerivnFunction. The name of this class is the user's choice. The arguments to the mathematical version of the functions, fi(x, y, a, b, c . . .) other than x and the y, i.e. a, b, c . . . may not be included in the method deriv(x, y) argument list. They should be declared as public members of the class of which derivn(x, y) is a member. The function is passed to the RungeKutta.fourthOrder(. . .) method as an instance of the class containing the method deriv(x, y) [func in the above example but this instance may be named at the user's choice]. This instance should be created in the method that calls RungeKutta.fourthOrder(. . .). This procedure can be seen more clearly in the example four in Example programs.

Static methods
public static double cashKarp(DerivFunction g, double x0, double y0, double xn, double h, double abstol, double reltol, double maxiter)
public static double cashKarp(DerivFunction g, double x0, double y0, double xn, double h, double abstol, double reltol)
Usage:
                      y = RungeKutta.cashKarp(func, x0, y0, xn, h, abstol, reltol, maxiter);
                      y = RungeKutta.cashKarp(func, x0, y0, xn, h, abstol, reltol);

Returns the value of y at a given value of x (xn) for a single ordinary differential equation (ODE):
                    
This method is essentially the same as the Fehlberg method (see above). The coefficients derived by Cash and Karp differ from those of Fehlberg and are said to give a more efficient method. The programming instructions are identical to those listed under the Fehlberg method above.



EXAMPLE PROGAMS

Four sample programs are given below:

Illustrating instance methods
Program RungeKuttaExampleThree
RungeKuttaExampleThree illustrates the use of a fourth order Runge-Kutta, Cash-Karp and Fehlberg procedures with a single ordinary differential equation
RungeKuttaExampleThree.java

Program RungeKuttaExampleFour
RungeKuttaExampleFour.java illustrates the use the fourth order Runge-Kutta, Cash-Karp and Fehlberg procedures with a set of three ordinary differential equation.
RungeKuttaExampleFour.java


Illustrating static methods
Program RungeKuttaExampleOne
RungeKuttaExampleOne illustrates the use of a fourth order Runge-Kutta, Cash-Karp and Fehlberg procedures with a single ordinary differential equation
RungeKuttaExampleOne.java

Program RungeKuttaExampleTwo
RungeKuttaExampleTwo.java illustrates the use the fourth order Runge-Kutta, Cash-Karp and Fehlberg procedures with a set of three ordinary differential equation.
RungeKuttaExampleTwo.java





OTHER CLASSES USED BY THIS CLASS

This class uses the following classes in this library:



This page was prepared by Dr Michael Thomas Flanagan