[wpimath] Synchronize C++ and Java RK4 docs (NFC) (#8238)

This commit is contained in:
Tyler Veness
2025-09-20 15:49:41 -07:00
committed by GitHub
parent a7e7f6912a
commit 0a4e44ea06

View File

@@ -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 <States extends Num> Matrix<States, N1> rk4(
UnaryOperator<Matrix<States, N1>> f, Matrix<States, N1> x, double dtSeconds) {