Class DifferentialEquations
java.lang.Object
com.github.gbenroscience.math.differentialcalculus.equations.DifferentialEquations
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.
-
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
-