From 0a4e44ea066f0ca4b04d30ed2d69d130a46f8f67 Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Sat, 20 Sep 2025 15:49:41 -0700 Subject: [PATCH] [wpimath] Synchronize C++ and Java RK4 docs (NFC) (#8238) --- .../wpi/first/math/system/NumericalIntegration.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wpimath/src/main/java/edu/wpi/first/math/system/NumericalIntegration.java b/wpimath/src/main/java/edu/wpi/first/math/system/NumericalIntegration.java index a54e2eae44..546764b714 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/system/NumericalIntegration.java +++ b/wpimath/src/main/java/edu/wpi/first/math/system/NumericalIntegration.java @@ -19,9 +19,9 @@ public final class NumericalIntegration { } /** - * Performs Runge Kutta integration (4th order). + * Performs 4th order Runge-Kutta integration of dx/dt = f(x) for dt. * - * @param f The function to integrate, which takes one argument x. + * @param f The function to integrate. It must take one argument x. * @param x The initial value of x. * @param dtSeconds The time over which to integrate. * @return the integration of dx/dt = f(x) for dt. @@ -37,13 +37,13 @@ public final class NumericalIntegration { } /** - * Performs Runge Kutta integration (4th order). + * Performs 4th order Runge-Kutta integration of dx/dt = f(x, u) for dt. * * @param f The function to integrate. It must take two arguments x and u. * @param x The initial value of x. * @param u The value u held constant over the integration period. * @param dtSeconds The time over which to integrate. - * @return The result of Runge Kutta integration (4th order). + * @return the integration of dx/dt = f(x, u) for dt. */ public static double rk4(DoubleBinaryOperator f, double x, double u, double dtSeconds) { final var h = dtSeconds; @@ -89,7 +89,7 @@ public final class NumericalIntegration { * @param f The function to integrate. It must take one argument x. * @param x The initial value of x. * @param dtSeconds The time over which to integrate. - * @return 4th order Runge-Kutta integration of dx/dt = f(x) for dt. + * @return the integration of dx/dt = f(x) for dt. */ public static Matrix rk4( UnaryOperator> f, Matrix x, double dtSeconds) {