add_decreasing_constraints

(function from pyomo.contrib.cspline_external.cspline_parameters)

pyomo.contrib.cspline_external.cspline_parameters.add_decreasing_constraints(m, tol=0)[source]

If the objective form of the parameter calculation is used, the data and the spline don’t need to match exactly, and we can add constraints on the derivatives that they are negative at the knots.

This doesn’t necessarily mean the cubic spline function is always decreasing, since the segments are cubic, but you can either check the resulting curve or pair it with convex or concave constraints.