Skip to content

Commit

Permalink
Add HS211 (#346)
Browse files Browse the repository at this point in the history
* Add HS211
  • Loading branch information
tmigot authored Sep 7, 2024
1 parent 2ab618b commit c724446
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/ADNLPProblems/hs211.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export hs211

function hs211(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T}
f(x) = 100*(x[2] - x[1]^3)^2 + (1 - x[1])^2
x0 = T[-1.2, 1.]
nlp = ADNLPModels.ADNLPModel(f, x0, name = "hs211"; kwargs...)
return nlp
end
25 changes: 25 additions & 0 deletions src/Meta/hs211.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
hs211_meta = Dict(
:nvar => 2,
:variable_nvar => false,
:ncon => 0,
:variable_ncon => false,
:minimize => true,
:name => "hs211",
:has_equalities_only => false,
:has_inequalities_only => false,
:has_bounds => false,
:has_fixed_variables => false,
:objtype => :other,
:contype => :unconstrained,
:best_known_lower_bound => -Inf,
:best_known_upper_bound => 750.0,
:is_feasible => true,
:defined_everywhere => missing,
:origin => :unknown,
)
get_hs211_nvar(; n::Integer = default_nvar, kwargs...) = 2
get_hs211_ncon(; n::Integer = default_nvar, kwargs...) = 0
get_hs211_nlin(; n::Integer = default_nvar, kwargs...) = 0
get_hs211_nnln(; n::Integer = default_nvar, kwargs...) = 0
get_hs211_nequ(; n::Integer = default_nvar, kwargs...) = 0
get_hs211_nineq(; n::Integer = default_nvar, kwargs...) = 0
20 changes: 20 additions & 0 deletions src/PureJuMP/hs211.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Hock and Schittkowski problem number 211.
#
# Source:
# Problem 211 in
# K. Schittkowski,
# More Test Examples for Nonlinear Programming Codes,
# Lectures Notes in Economics and Mathematical Systems 282,
# Springer Verlag, Heidelberg, 1987.
#
export hs211

"HS211 model"
function hs211(; n::Int = default_nvar, kwargs...)
nlp = Model()
@variable(nlp, x1, start = -1.2)
@variable(nlp, x2, start = 1)

@objective(nlp, Min, 100*(x2 - x1^3)^2 + (1 - x1)^2)
return nlp
end

0 comments on commit c724446

Please sign in to comment.