In addition to the question here I would like to know how to obtain the coefficients of an arbitrary polynomial constraint of a pyomo model. So, for
m= ConcreteModel()
m.x_1 = Var()
m.x_2 = Var()
m.x_3 = Var(within = Integers)
m.x_4 = Var(within = Integers)
m.c= Constraint(expr=2*m.x_1**2 + 5*m.x_1*m.x_2 + m.x_4 <= 2)
I would like to have
coeff[c] = [2, 5, 1].