I'm trying to use pyscipopt to solve a linear programming problem, but am unable to fit the piecewise linear function as a constraint.
The constraint is expressed as follows:
I've tried to write it as the following:
cfm = quicksum( max(quicksum(cf[i][t] * q[i] - L[t] for i in range(I)), 0) for t in range(T) / quicksum(L[t] for t in range(T)) <= cfm_max
Where cfm_max = 0.15, in this case.
But it is probably very wrong since it returns a NotImplementedError
. I've seen examples in piecewise.py
found together with the package, but their usage seems different enough to not work in my case.
Would appreciate any help, thanks.
I think this can be written as:
where
y[t]
are non-negative variables. This is now completely linear (no division, no max()).