Class NumericalJacobian

java.lang.Object
edu.wpi.first.math.system.NumericalJacobian

public final class NumericalJacobian
extends Object
Numerical Jacobian utilities.
  • Method Details

    • numericalJacobian

      public static <Rows extends Num,​ Cols extends Num,​ States extends Num> Matrix<Rows,​Cols> numericalJacobian​(Nat<Rows> rows, Nat<Cols> cols, Function<Matrix<Cols,​N1>,​Matrix<States,​N1>> f, Matrix<Cols,​N1> x)
      Computes the numerical Jacobian with respect to x for f(x).
      Type Parameters:
      Rows - Number of rows in the result of f(x).
      States - Num representing the number of rows in the output of f.
      Cols - Number of columns in the result of f(x).
      Parameters:
      rows - Number of rows in the result of f(x).
      cols - Number of columns in the result of f(x).
      f - Vector-valued function from which to compute the Jacobian.
      x - Vector argument.
      Returns:
      The numerical Jacobian with respect to x for f(x, u, ...).
    • numericalJacobianX

      public static <Rows extends Num,​ States extends Num,​ Inputs extends Num,​ Outputs extends Num> Matrix<Rows,​States> numericalJacobianX​(Nat<Rows> rows, Nat<States> states, BiFunction<Matrix<States,​N1>,​Matrix<Inputs,​N1>,​Matrix<Outputs,​N1>> f, Matrix<States,​N1> x, Matrix<Inputs,​N1> u)
      Returns numerical Jacobian with respect to x for f(x, u, ...).
      Type Parameters:
      Rows - Number of rows in the result of f(x, u).
      States - Number of rows in x.
      Inputs - Number of rows in the second input to f.
      Outputs - Num representing the rows in the output of f.
      Parameters:
      rows - Number of rows in the result of f(x, u).
      states - Number of rows in x.
      f - Vector-valued function from which to compute Jacobian.
      x - State vector.
      u - Input vector.
      Returns:
      The numerical Jacobian with respect to x for f(x, u, ...).
    • numericalJacobianU

      public static <Rows extends Num,​ States extends Num,​ Inputs extends Num> Matrix<Rows,​Inputs> numericalJacobianU​(Nat<Rows> rows, Nat<Inputs> inputs, BiFunction<Matrix<States,​N1>,​Matrix<Inputs,​N1>,​Matrix<States,​N1>> f, Matrix<States,​N1> x, Matrix<Inputs,​N1> u)
      Returns the numerical Jacobian with respect to u for f(x, u).
      Type Parameters:
      States - The states of the system.
      Inputs - The inputs to the system.
      Rows - Number of rows in the result of f(x, u).
      Parameters:
      rows - Number of rows in the result of f(x, u).
      inputs - Number of rows in u.
      f - Vector-valued function from which to compute the Jacobian.
      x - State vector.
      u - Input vector.
      Returns:
      the numerical Jacobian with respect to u for f(x, u).