Class RungeKuttaNs

java.lang.Object
gaiasky.util.gaia.utils.RungeKuttaNs

public class RungeKuttaNs extends Object
Provides an implementation of the Runge-Kutta method for solving single or sets of ordinary differential equations (ODEs).

A set of ODEs are supplied by means of the interface DiffnFunction.

This class is taken from the Java library developed by Michael Thomas Flanagan available at http://www.ee.ucl.ac.uk/~mflanaga/java/RungeKutta.html

NOTE: This is for RSLS use only - do not use in any other software

  • Constructor Details

    • RungeKuttaNs

      public RungeKuttaNs()
  • Method Details

    • fourthOrder

      public static double[] fourthOrder(DiffnFunctionNs g, long tOld, double[] y0, long tNew, long tStepMax, long tUnit)
      Returns the value of y at a given value of x (xn) for a set of ordinary differential equation (ODEs)
      See http://www.ee.ucl.ac.uk/~mflanaga/java/RungeKutta.html#four
      Parameters:
      g - an implementation of DiffnFunction describing a set of Ordinary Differential Equations
      tOld - the initial value for t
      y0 - the initial value for y
      tNew - the value of t where we want to know y
      tStepMax - the initial step size
      tUnit - the time unit used for the derivatives
      Returns:
      the value of y at xn