-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add HS211
- Loading branch information
Showing
3 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |