get_numeric_incidence_matrix
(function from pyomo.contrib.incidence_analysis.interface
)
- pyomo.contrib.incidence_analysis.interface.get_numeric_incidence_matrix(variables, constraints)[source]
Return the “numeric incidence matrix” (Jacobian) of Pyomo variables and constraints.
Each matrix value is the derivative of a constraint body with respect to a variable. Rows correspond to constraints and columns correspond to variables. Entries are included even if the value of the derivative is zero. Only active constraints and unfixed variables that participate in these constraints are included.
- Parameters:
variables (List of Pyomo VarData objects)
constraints (List of Pyomo ConstraintData objects)
- Returns:
COO matrix. Rows are indices into the user-provided list of constraints, columns are indices into the user-provided list of variables.
- Return type:
scipy.sparse.coo_matrix