Access all variables occurring in a pyomo constraint
问题 I am working on an algorithm in python that needs to modify concrete (mixed-integer nonlinear) pyomo models. In particular, I need to know which variables are present in a general algebraic constraint . E.g. for a constraint model.con1 = Constraint(expr=exp(model.x_1) + 2*model.x_2 <= 2) I would like to make a a query (like model.con1.variables ) which returns (a list of) the variables ( [model.x_1,model.x_2] ). In this documentation I find that for linear constraints, the parameter variables