1# -*- coding: utf-8 -*-
2"""Problem A in paper 'Outer approximation algorithms for separable nonconvex mixed-integer nonlinear programs'
3
4Ref:
5Kesavan P, Allgor R J, Gatzke E P, et al. Outer approximation algorithms for separable nonconvex mixed-integer nonlinear programs[J]. Mathematical Programming, 2004, 100(3): 517-535.
6
7Problem type:   nonconvex MINLP
8        size:   3  binary variable
9                2  continuous variables
10                6  constraints
11
12"""
13from pyomo.environ import *
14
15
16class Nonconvex1(ConcreteModel):
17    def __init__(self, *args, **kwargs):
18        """Create the problem."""
19        kwargs.setdefault('name', 'Nonconvex1')
20        super(Nonconvex1, self).__init__(*args, **kwargs)
21        m = self
22
23        m.x1 = Var(within=Reals, bounds=(0, 10))
24        m.x2 = Var(within=Reals, bounds=(0, 10))
25        m.y1 = Var(within=Binary, bounds=(0, 1), initialize=0)
26        m.y2 = Var(within=Binary, bounds=(0, 1), initialize=0)
27        m.y3 = Var(within=Binary, bounds=(0, 1), initialize=0)
28
29        m.objective = Objective(expr=2 * m.x1 + 3 * m.x2 + 1.5 * m.y1 +
30                                2 * m.y2 - 0.5 * m.y3, sense=minimize)
31
32        m.c1 = Constraint(expr=m.x1 * m.x1 + m.y1 == 1.25)
33        m.c2 = Constraint(expr=m.x2 ** 1.5 + 1.5 * m.y2 == 3)
34        m.c4 = Constraint(expr=m.x1 + m.y1 <= 1.6)
35        m.c5 = Constraint(expr=1.333 * m.x2 + m.y2 <= 3)
36        m.c6 = Constraint(expr=-m.y1 - m.y2 + m.y3 <= 0)
37        m.optimal_value = 7.667
38