Class DifferentialEquations

java.lang.Object
com.github.gbenroscience.math.differentialcalculus.equations.DifferentialEquations

public class DifferentialEquations extends Object
High-performance, JIT-optimized Vectorized Ordinary Differential Equation (ODE) solvers. Supports arbitrary n-th order differential equations by reduction to first-order vector systems. Target MethodHandle signature MUST strictly match: void f(double[] vars, double[] outDerivatives)
Author:
GBEMIRO
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double[]
    stepEuler(MethodHandle dy_dt, int tSlot, int ySlotStart, int systemSize, int frameSize, double t0, double[] y0, double tEnd, int steps)
    Vectorized Explicit Euler solver for systems of equations.
    static double[]
    stepImplicitEuler(MethodHandle dy_dt, int tSlot, int ySlotStart, int systemSize, int frameSize, double t0, double[] y0, double tEnd, int steps)
    Vectorized Implicit Backward Euler solver using multivariable Newton-Raphson with numerical central-difference Jacobian approximations.
    static double[]
    stepRK4(MethodHandle dy_dt, int tSlot, int ySlotStart, int systemSize, int frameSize, double t0, double[] y0, double tEnd, int steps)
    Vectorized 4th Order Classical Runge-Kutta (RK4) solver for systems of equations.
    static double[]
    stepRK45Adaptive(MethodHandle dy_dt, int tSlot, int ySlotStart, int systemSize, int frameSize, double t0, double[] y0, double tEnd, double initialH)
    Vectorized Adaptive-step Dormand-Prince 5(4) solver for systems of equations.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DifferentialEquations

      public DifferentialEquations()
  • Method Details

    • stepEuler

      public static double[] stepEuler(MethodHandle dy_dt, int tSlot, int ySlotStart, int systemSize, int frameSize, double t0, double[] y0, double tEnd, int steps) throws Throwable
      Vectorized Explicit Euler solver for systems of equations.
      Parameters:
      dy_dt -
      tSlot -
      ySlotStart -
      systemSize -
      frameSize -
      t0 -
      y0 -
      tEnd -
      steps -
      Returns:
      Throws:
      Throwable
    • stepRK4

      public static double[] stepRK4(MethodHandle dy_dt, int tSlot, int ySlotStart, int systemSize, int frameSize, double t0, double[] y0, double tEnd, int steps) throws Throwable
      Vectorized 4th Order Classical Runge-Kutta (RK4) solver for systems of equations.
      Parameters:
      dy_dt -
      tSlot -
      ySlotStart -
      systemSize -
      frameSize -
      t0 -
      y0 -
      tEnd -
      steps -
      Returns:
      Throws:
      Throwable
    • stepRK45Adaptive

      public static double[] stepRK45Adaptive(MethodHandle dy_dt, int tSlot, int ySlotStart, int systemSize, int frameSize, double t0, double[] y0, double tEnd, double initialH) throws Throwable
      Vectorized Adaptive-step Dormand-Prince 5(4) solver for systems of equations.
      Parameters:
      dy_dt -
      tSlot -
      ySlotStart -
      systemSize -
      frameSize -
      t0 -
      y0 -
      tEnd -
      initialH -
      Returns:
      Throws:
      Throwable
    • stepImplicitEuler

      public static double[] stepImplicitEuler(MethodHandle dy_dt, int tSlot, int ySlotStart, int systemSize, int frameSize, double t0, double[] y0, double tEnd, int steps) throws Throwable
      Vectorized Implicit Backward Euler solver using multivariable Newton-Raphson with numerical central-difference Jacobian approximations. Ideal for stiff systems.
      Parameters:
      dy_dt -
      tSlot -
      ySlotStart -
      systemSize -
      frameSize -
      t0 -
      y0 -
      tEnd -
      steps -
      Returns:
      Throws:
      Throwable