Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

appsi_highs fails with quadratic objective

56 views
Skip to first unread message

mikkel.a...@gmail.com

unread,
Oct 22, 2024, 9:20:29 AM10/22/24
to Pyomo Forum
Hi.

I'm trying to run my large scale energy system model (1.5 mill rows x 1 mill cols) with a quadratic objective function (and linear constraints ...'QCP') using appsi_highs solver interface. My modified model will run very well with QCP (running twice as fast and producing more reliable results) using the Pyomo/GAMS interface. 

However, appsi_highs seems to fail for me with QCP (it runs fine with LP). The error message with QCP is:

"DegreeError: Highs interface does not support expressions of degree None"

Am I just unlucky that QCP is not (yet) implemented in appsi_highs or HiGHS itself?
Or did I make a mistake, or is there some sort of way that I can make appsi_highs run my QCP model?
I've pasted in below a simplified code example that reproduces the problem.

I'll be grateful for any help or hints or direction to people who might be able to help me ... or just a confirmation that QCP is indeed not an option with HiGHS + Pyomo.

Thanks + cheers, 
Mikkel

Versions:
HiGHS: 1.7.2
Pyomo: 6.8.0
Python: 3.11.0

import pyomo.environ as pyo

model.PRODUC = pyo.Var(domain=pyo.NonNegativeReals)
model.DEMAND = pyo.Var(domain=pyo.NonNegativeReals)

model.OBJ = pyo.Objective(expr = 500*model.PRODUC - 2000*model.DEMAND - 100*model.DEMAND*model.DEMAND)
model.BAL = pyo.Constraint(expr = model.PRODUC == model.DEMAND)
model.MAX = pyo.Constraint(expr = model.DEMAND <= 200)

opt = pyo.SolverFactory('appsi_highs')
opt.solve(model)



Ahmad Heidari

unread,
Mar 17, 2025, 4:48:36 PMMar 17
to Pyomo Forum
Hello Mikkel,

I hope you are doing well.

Yes, unfortunately, the solver can't deal with the non-linear (convex objective function, though). 

You can use gurobi, or ipopt where gurobi has a free academic license, and ipopt is free of charge based on its license. 

opt = pyo.SolverFactory('gurobi')
opt.solve(model)
print('Product:', pyo.value(model.PRODUC))
print('Obj:', pyo.value(model.OBJ))
#------------------------------
Product: 200.0 Obj: -4300000.0

Arnaud Baguet

unread,
Mar 22, 2025, 12:19:48 AMMar 22
to Pyomo Forum
Hi Mikkel,

I have raised a PR that will solve this issue. Let me know if you have any questions:

Kind regards,
Arnaud



Reply all
Reply to author
Forward
0 new messages