-
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.
- Loading branch information
1 parent
db7c813
commit 726f1ac
Showing
2 changed files
with
31 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,7 @@ | ||
export hs201 | ||
|
||
function hs201(; n::Int=default_nvar, type::Val{T}=Val(Float64), kwargs...) where {T} | ||
f(x) = 4 * (x[1] - 5)^2 + (x[2] - 6)^2 | ||
x0 = T[8, 9] | ||
return ADNLPModels.ADNLPModel(f, x0, name="hs201"; kwargs...) | ||
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,24 @@ | ||
# Hock and Schittkowski problem number 201. | ||
# | ||
# Source: | ||
# Problem 201 in | ||
# K. Schittkowski, | ||
# More Test Examples for Nonlinear Programming Codes, | ||
# Lectures Notes in Economics and Mathematical Systems 282, | ||
# Springer Verlag, Heidelberg, 1987. | ||
# | ||
export hs201 | ||
"HS201 model" | ||
function hs201(args...; n::Int = default_nvar, kwargs...) | ||
model = Model() | ||
|
||
#Déclaration des variables | ||
@variable(model, x1) | ||
set_start_value(x1, 8) | ||
@variable(model, x2) | ||
set_start_value(x2, 8) | ||
|
||
#Définition de la fonction objectif | ||
@NLobjective(model, Min, 4*(x1-5)^2+(x2-6)^2) | ||
return model | ||
end |