Skip to content

Pyomo can't solve cubic or higher order polynomials with Gurobi 11 #3249

Open
@jhpb7

Description

@jhpb7

Summary

Since version 11, gurobi can solve cubic or higher order polynomials without linearisation. However, this feature is not compatibel with pyomo yet. Would be great if this could be added.

Description

I use pyomo 6.4.2 and gurobi 11.0.0 and ran this code

import pyomo.environ as pyo

m = pyo.ConcreteModel()
m.x = pyo.Var()

@m.Objective()
def obj(m):
    return m.x**3

opt = pyo.SolverFactory('gurobi_persistent')
opt.options["NonConvex"] = 2
opt.options['FuncNonlinear'] = 1
opt.set_instance(m)

results = opt.solve(tee=True)

and it throws
DegreeError: GurobiDirect does not support expressions of degree None. expr: x**3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions