-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path003_016.jl
31 lines (25 loc) · 898 Bytes
/
003_016.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Copyright (c) 2021 MINLPTests.jl contributors
#
# Use of this source code is governed by an MIT-style license that can be found
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
function nlp_mi_003_016(
optimizer,
objective_tol,
primal_tol,
dual_tol,
termination_target = TERMINATION_TARGET_LOCAL,
primal_target = PRIMAL_TARGET_LOCAL,
)
# Test Goals:
# - objective with offset
model = Model(optimizer)
@variable(model, 0 <= x <= 4, Int)
@variable(model, 0 <= y <= 4, Int)
@objective(model, Max, x + pi)
@NLconstraint(model, y >= exp(x - 2) - 1.5)
@NLconstraint(model, y <= sin(x)^2 + 2)
optimize!(model)
check_status(model, FEASIBLE_PROBLEM, termination_target, primal_target)
check_objective(model, 6.141592682680717, tol = objective_tol)
return check_solution([x, y], [3, 2], tol = primal_tol)
end