import arhiplexpy

model = arhiplexpy.Model()
 
x1 = model.add_variable(var_type=arhiplexpy.variable_type.continuous, var_name='x1')
x2 = model.add_variable(var_type=arhiplexpy.variable_type.continuous, var_name='x2')
model.add_constraint( x1 + x2 <= 2, 'C1')
model.set_objective( -6 * x1  + 2 * x1**2 - 2 * x1 * x2 + 2 *x2 * x2, arhiplexpy.objective_sense.minimize)

res = model.solve()

print(res)

print('Objective func value : ', res.get_objective_value())
