scipy.optimize.LinearConstraint.
residual#
- LinearConstraint.residual(x)[source]#
- Calculate the residual between the constraint function and the limits - For a linear constraint of the form: - lb <= A@x <= ub - the lower and upper residuals between - A@xand the limits are values- sland- sbsuch that:- lb + sl == A@x == ub - sb - When all elements of - sland- sbare positive, all elements of the constraint are satisfied; a negative element in- slor- sbindicates that the corresponding element of the constraint is not satisfied.- Parameters:
- x: array_like
- Vector of independent variables 
 
- Returns:
- sl, sbarray-like
- The lower and upper residuals