-
Notifications
You must be signed in to change notification settings - Fork 6
/
004_010.jl
37 lines (31 loc) · 1.05 KB
/
004_010.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
32
33
34
35
36
37
# 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_expr_004_010(
optimizer,
objective_tol,
primal_tol,
dual_tol,
termination_target = TERMINATION_TARGET_LOCAL,
primal_target = PRIMAL_TARGET_LOCAL,
)
# Test Goals:
# - non-linear objective and linear, quadratic constraints
# - functions tan, abs, *
model = Model(optimizer)
@variable(model, -1 <= x <= 1)
@variable(model, y)
@variable(model, z, Int)
@objective(model, Min, tan(x) + y + x * z + 0.5 * abs(y))
@constraint(model, x^2 + y^2 + z^2 <= 10)
@constraint(model, -1.2 * x - y <= z / 1.35)
optimize!(model)
check_status(model, FEASIBLE_PROBLEM, termination_target, primal_target)
check_objective(model, -4.576881309190901, tol = objective_tol)
return check_solution(
[x, y, z],
[-0.9969558935432884, -0.077968812655046, 3],
tol = primal_tol,
)
end