diff --git a/src/ADNLPProblems/hs201.jl b/src/ADNLPProblems/hs201.jl new file mode 100644 index 00000000..2cfd6637 --- /dev/null +++ b/src/ADNLPProblems/hs201.jl @@ -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 \ No newline at end of file diff --git a/src/PureJuMP/hs201.jl b/src/PureJuMP/hs201.jl new file mode 100644 index 00000000..395c314e --- /dev/null +++ b/src/PureJuMP/hs201.jl @@ -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 \ No newline at end of file