numopt-js
    Preparing search index...

    Function finiteDiffConstraintPartialX

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

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

      Parameters

      • parameters: Float64Array

        Parameter vector p (kept fixed)

      • states: Float64Array

        State vector x

      • constraintFunction: ConstraintFn

        Constraint function c(p, x)

      • options: NumericalDifferentiationOptions = {}

        Optional numerical differentiation settings

      Returns Matrix

      Jacobian matrix ∂c/∂x