characterize_function

(function from pyomo.core.kernel.piecewise_library.util)

pyomo.core.kernel.piecewise_library.util.characterize_function(breakpoints, values)[source]

Characterizes a piecewise linear function described by a list of breakpoints and function values.

Parameters:
  • breakpoints (list) – The list of breakpoints of the piecewise linear function. It is assumed that the list of breakpoints is in non-decreasing order.

  • values (list) – The values of the piecewise linear function corresponding to the breakpoints.

Returns:

a function characterization code and

the list of slopes.

Return type:

(int, list)

Note

The function characterization codes are

  • 1: affine

  • 2: convex

  • 3: concave

  • 4: step

  • 5: other

If the function has step points, some of the slopes may be None.