Piecewise Linearlization of Quadratic functions


Dear colleagues,

I have managed to implement the unit commitment problem with JuMP adding the time varying constrains that I mentioned in my last post. I was using the Cbc solver and I would like to know if JuMP has a function that automatically linearize a quadratic function, something similar to https://cran.r-project.org/web/packages/segmented/segmented.pdf.

Has anyone done this before?


Maybe this is useful: https://github.com/joehuchette/PiecewiseLinearOpt.jl? The author, @joehuchette, may be able to help you with this.


@tfk17lstm, have you had a look at PowerModels.jl?

An implementation of convex PWL costs, as defined in Matpower, is implemented here,


Hi @ccoffrin I have checked but the problem is that my function is non-convex so I think that I will get an error.


Good to know your functions are non-convex. I’ve added feature request here,

Incase you would like to track it.

Note that the primary reason PowerModels does not currently support non-convex functions is that scalability of the model can be a significant challenge.


Yeah I agree with you. But my dispatch model is for less than 10 machines (I am developing a solution from the producer perspective) and the machines are equal (of course the IO curves are different due to degradation and ambient parameters) so I believe the problem can be solved.

I will try with another solver and quadratic objectives and if not I will try to implement this: