Can i get a complete example program in pyomo for optimizing quadratic objective functions with constraints with cplex solver? or an example for mixed integer quadratic programming python in pyomo
2 Answers
From the looks of it, this is more a pure pyomo question than one having anything to do with CPLEX. The closest I can find is example4.py (in the pyomo github). This pyomo example only has a quadratic objective function, but it looks like it should be straightforward to modify the constraint_rule
method to include a quadratic constraint.

- 4,447
- 2
- 22
- 31
-
OP might means how to convert CPLEX sparse constraints matrix that will be accepted by pyomo, including setting which variable is integer and whic is not. – Muhammad Yasirroni Sep 13 '21 at 04:22
Yes, you can modify the model applying duality (Dual Theorem) so you will be able to get a linear objective function with a quadratic constraint. But if you are looking for a double quadratic model, i.e. a quadratic objective function with a quadratic constraint function, you should ensure that one of them is strictly concave and the other strictly convex in order to get only one solution.
Hope help
PS: sorry if I'm late.

- 19
- 2