-
Notifications
You must be signed in to change notification settings - Fork 48
/
hs81.jl
31 lines (26 loc) · 841 Bytes
/
hs81.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
# Hock and Schittkowski problem number 81.
#
# Source:
# Problem 81 in
# W. Hock and K. Schittkowski,
# Test examples for nonlinear programming codes,
# Lectures Notes in Economics and Mathematical Systems 187,
# Springer Verlag, Heidelberg, 1981.
#
# classification GPR-AN-5-3
#
# A. Montoison, Montreal, 05/2018.
export hs81
"HS81 model"
function hs81(args...; kwargs...)
nlp = Model()
x0 = [-2, 2, 2, -1, -1]
lvar = [-2.3, -2.3, -3.2, -3.2, -3.2]
uvar = [2.3, 2.3, 3.2, 3.2, 3.2]
@variable(nlp, lvar[i] ≤ x[i = 1:5] ≤ uvar[i], start = x0[i])
@NLconstraint(nlp, sum(x[i]^2 for i = 1:5) - 10 == 0)
@NLconstraint(nlp, x[2] * x[3] - 5 * x[4] * x[5] == 0)
@NLconstraint(nlp, x[1]^3 + x[2]^3 + 1 == 0)
@NLobjective(nlp, Min, exp(prod(x[i] for i = 1:5)) - 0.5 * (x[1]^3 + x[2]^3 + 1)^2)
return nlp
end