Skip to content

Commit c724446

Browse files
authored
Add HS211 (#346)
* Add HS211
1 parent 2ab618b commit c724446

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed

src/ADNLPProblems/hs211.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export hs211
2+
3+
function hs211(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T}
4+
f(x) = 100*(x[2] - x[1]^3)^2 + (1 - x[1])^2
5+
x0 = T[-1.2, 1.]
6+
nlp = ADNLPModels.ADNLPModel(f, x0, name = "hs211"; kwargs...)
7+
return nlp
8+
end

src/Meta/hs211.jl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
hs211_meta = Dict(
2+
:nvar => 2,
3+
:variable_nvar => false,
4+
:ncon => 0,
5+
:variable_ncon => false,
6+
:minimize => true,
7+
:name => "hs211",
8+
:has_equalities_only => false,
9+
:has_inequalities_only => false,
10+
:has_bounds => false,
11+
:has_fixed_variables => false,
12+
:objtype => :other,
13+
:contype => :unconstrained,
14+
:best_known_lower_bound => -Inf,
15+
:best_known_upper_bound => 750.0,
16+
:is_feasible => true,
17+
:defined_everywhere => missing,
18+
:origin => :unknown,
19+
)
20+
get_hs211_nvar(; n::Integer = default_nvar, kwargs...) = 2
21+
get_hs211_ncon(; n::Integer = default_nvar, kwargs...) = 0
22+
get_hs211_nlin(; n::Integer = default_nvar, kwargs...) = 0
23+
get_hs211_nnln(; n::Integer = default_nvar, kwargs...) = 0
24+
get_hs211_nequ(; n::Integer = default_nvar, kwargs...) = 0
25+
get_hs211_nineq(; n::Integer = default_nvar, kwargs...) = 0

src/PureJuMP/hs211.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Hock and Schittkowski problem number 211.
2+
#
3+
# Source:
4+
# Problem 211 in
5+
# K. Schittkowski,
6+
# More Test Examples for Nonlinear Programming Codes,
7+
# Lectures Notes in Economics and Mathematical Systems 282,
8+
# Springer Verlag, Heidelberg, 1987.
9+
#
10+
export hs211
11+
12+
"HS211 model"
13+
function hs211(; n::Int = default_nvar, kwargs...)
14+
nlp = Model()
15+
@variable(nlp, x1, start = -1.2)
16+
@variable(nlp, x2, start = 1)
17+
18+
@objective(nlp, Min, 100*(x2 - x1^3)^2 + (1 - x1)^2)
19+
return nlp
20+
end

0 commit comments

Comments
 (0)