-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path001_010.jl
33 lines (27 loc) · 984 Bytes
/
001_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
# 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_expr_001_010(
optimizer,
objective_tol,
primal_tol,
dual_tol,
termination_target = TERMINATION_TARGET_LOCAL,
primal_target = PRIMAL_TARGET_LOCAL,
)
# Test Goals:
# - mix of variable start values
# - non-linear objective without constraints
# - minimization objective
# - functions ^, exp, cos
model = Model(optimizer)
@variable(model, x, start = 1)
@variable(model, y, start = 2.12)
@variable(model, z >= 1)
@objective(model, Min, x * exp(x) + cos(y) + z^3 - z^2)
optimize!(model)
check_status(model, FEASIBLE_PROBLEM, termination_target, primal_target)
check_objective(model, -1.3678794486503105, tol = objective_tol)
return check_solution([x, y, z], [-1, pi, 1], tol = primal_tol)
end