numopt-js
    Preparing search index...

    Function finiteDiffResidualPartialX

    • Computes the partial derivative of a constrained residual function with respect to states. Uses central difference method while keeping parameters fixed. Returns a Jacobian matrix of size (residualCount × stateCount).

      Formula: ∂r/∂x_ij ≈ (r_i(p, x+h·e_j) - r_i(p, x-h·e_j)) / (2h)

      Parameters

      • parameters: Float64Array

        Parameter vector p (kept fixed)

      • states: Float64Array

        State vector x

      • residualFunction: ConstrainedResidualFn

        Constrained residual function r(p, x)

      • options: NumericalDifferentiationOptions = {}

        Optional numerical differentiation settings

      Returns Matrix

      Jacobian matrix ∂r/∂x