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: GitHub - joehuchette/PiecewiseLinearOpt.jl: Solve optimization problems containing piecewise linear functions? The author, @joehuchette, may be able to help you with this.

1 Like

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

https://github.com/lanl-ansi/PowerModels.jl

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

https://github.com/lanl-ansi/PowerModels.jl/blob/master/src/core/objective.jl#L195

1 Like

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,

https://github.com/lanl-ansi/PowerModels.jl/issues/287

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:

https://github.com/GridMod/RTS-GMLC/blob/master/RTS_Data/SourceData/HR_data/Fit_HRs.R