-
Notifications
You must be signed in to change notification settings - Fork 48
/
hs262.jl
31 lines (26 loc) · 814 Bytes
/
hs262.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 262.
#
# Source:
# Problem 262 in
# K. Schittkowski,
# More Test Examples for Nonlinear Programming Codes,
# Lectures Notes in Economics and Mathematical Systems 282,
# Springer Verlag, Heidelberg, 1987.
#
#
#
# T. Migot, Montreal, 2023.
export hs262
"HS262 model"
function hs262(args...; kwargs...)
nlp = Model()
x0 = [1, 1, 1, 1]
lvar = [0, 0, 0, 0]
@variable(nlp, x[i = 1:4] ≥ lvar[i], start = x0[i])
@NLobjective(nlp, Min, -0.5 * x[1] - x[2] - 0.5 * x[3] - x[4])
@constraint(nlp, x[1] + x[2] + x[3] - 2 * x[4] - 6 == 0)
@constraint(nlp, 10 - x[1] - x[2] - x[3] - x[4] >= 0)
@constraint(nlp, 10 - 0.2 * x[1] - 0.5 * x[2] - x[3] - 2 * x[4] >= 0)
@constraint(nlp, 10 - 2 * x[1] - x[2] - 0.5 * x[3] - 0.2 * x[4] >= 0)
return nlp
end