-
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.
Co-authored-by: tmigot <[email protected]>
- Loading branch information
1 parent
c724446
commit 2c14b02
Showing
4 changed files
with
35 additions
and
35 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
export hs201 | ||
|
||
function hs201(; n::Int=default_nvar, type::Type{T} = 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 | ||
export hs201 | ||
|
||
function hs201(; n::Int = default_nvar, type::Type{T} = 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 |
---|---|---|
@@ -1,8 +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.] | ||
f(x) = 100 * (x[2] - x[1]^3)^2 + (1 - x[1])^2 | ||
x0 = T[-1.2, 1.0] | ||
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 |
---|---|---|
@@ -1,25 +1,25 @@ | ||
# 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, 9) | ||
|
||
#Définition de la fonction objectif | ||
@objective(model, Min, 4*(x1-5)^2+(x2-6)^2) | ||
|
||
return model | ||
end | ||
# 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, 9) | ||
|
||
#Définition de la fonction objectif | ||
@objective(model, Min, 4 * (x1 - 5)^2 + (x2 - 6)^2) | ||
|
||
return model | ||
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