opf_legacy_user_cost_fcn

opf_legacy_user_cost_fcn(x, cp)

opf_legacy_user_cost_fcn() - Evaluates legacy user costs and derivatives.

[F, DF, D2F] = OPF_LEGACY_USER_COST_FCN(X, CP)

Evaluates the legacy user-defined costs and derivatives.

Inputs:
  X : cell array with vectors of optimization variables
  CP : legacy user-defined cost parameter struct such as returned by
       OPT_MODEL.GET_COST_PARAMS

Outputs:
  F  : sum of generator polynomial costs
  DF : (optional) gradient (column vector) of polynomial costs
  D2F : (optional) Hessian of polynomial costs

Examples:
    f = opf_legacy_user_cost_fcn(x, cp);
    [f, df] = opf_legacy_user_cost_fcn(x, cp);
    [f, df, d2f] = opf_legacy_user_cost_fcn(x, cp);