(function from pyomo.core.kernel.piecewise_library.transforms_nd)
pyomo.core.kernel.piecewise_library.transforms_nd
Models a multi-variate piecewise linear function.
This function takes a D-dimensional triangulation and a list of function values associated with the points of the triangulation and transforms this input data into a block of variables and constraints that enforce a piecewise linear relationship between an D-dimensional vector of input variable and a single output variable. In the general case, this transformation requires the use of discrete decision variables.
tri (scipy.spatial.Delaunay) –
A triangulation over the discretized variable domain. Can be generated using a list of variables using the utility function util.generate_delaunay(). Required attributes:
util.generate_delaunay()
points: An (npoints, D) shaped array listing the D-dimensional coordinates of the discretization points. simplices: An (nsimplices, D+1) shaped array of integers specifying the D+1 indices of the points vector that define each simplex of the triangulation.
points: An (npoints, D) shaped array listing the D-dimensional coordinates of the discretization points.
simplices: An (nsimplices, D+1) shaped array of integers specifying the D+1 indices of the points vector that define each simplex of the triangulation.
values (numpy.array) – An (npoints,) shaped array of the values of the piecewise function at each of coordinates in the triangulation points array.
input – A D-length list of variables or expressions bound as the inputs of the piecewise function.
output – The variable constrained to be the output of the piecewise linear function.
bound (str) –
The type of bound to impose on the output expression. Can be one of:
’lb’: y <= f(x) ’eq’: y = f(x) ’ub’: y >= f(x)
’lb’: y <= f(x)
’eq’: y = f(x)
’ub’: y >= f(x)
repn (str) –
The type of piecewise representation to use. Can be one of:
’cc’: convex combination
containing any new variables, constraints, and other components used by the piecewise representation
TransformedPiecewiseLinearFunctionND