File tree Expand file tree Collapse file tree 3 files changed +57
-0
lines changed Expand file tree Collapse file tree 3 files changed +57
-0
lines changed Original file line number Diff line number Diff line change 1+ export hs201
2+
3+ function hs201 (; n:: Int = default_nvar, type:: Type{T} = Float64, kwargs... ) where {T}
4+ f (x) = 4 * (x[1 ] - 5 )^ 2 + (x[2 ] - 6 )^ 2
5+ x0 = T[8 , 9 ]
6+ return ADNLPModels. ADNLPModel (f, x0, name= " hs201" ; kwargs... )
7+ end
Original file line number Diff line number Diff line change 1+ hs201_meta = Dict (
2+ :nvar => 2 ,
3+ :variable_nvar => false ,
4+ :ncon => 0 ,
5+ :variable_ncon => false ,
6+ :minimize => true ,
7+ :name => " hs201" ,
8+ :has_equalities_only => false ,
9+ :has_inequalities_only => false ,
10+ :has_bounds => false ,
11+ :has_fixed_variables => false ,
12+ :objtype => :other ,
13+ :contype => :unconstrained ,
14+ :best_known_lower_bound => - Inf ,
15+ :best_known_upper_bound => 45.0 ,
16+ :is_feasible => true ,
17+ :defined_everywhere => missing ,
18+ :origin => :unknown ,
19+ )
20+ get_hs201_nvar (; n:: Integer = default_nvar, kwargs... ) = 2
21+ get_hs201_ncon (; n:: Integer = default_nvar, kwargs... ) = 0
22+ get_hs201_nlin (; n:: Integer = default_nvar, kwargs... ) = 0
23+ get_hs201_nnln (; n:: Integer = default_nvar, kwargs... ) = 0
24+ get_hs201_nequ (; n:: Integer = default_nvar, kwargs... ) = 0
25+ get_hs201_nineq (; n:: Integer = default_nvar, kwargs... ) = 0
Original file line number Diff line number Diff line change 1+ # Hock and Schittkowski problem number 201.
2+ #
3+ # Source:
4+ # Problem 201 in
5+ # K. Schittkowski,
6+ # More Test Examples for Nonlinear Programming Codes,
7+ # Lectures Notes in Economics and Mathematical Systems 282,
8+ # Springer Verlag, Heidelberg, 1987.
9+ #
10+ export hs201
11+ " HS201 model"
12+ function hs201 (args... ; n:: Int = default_nvar, kwargs... )
13+ model = Model ()
14+
15+ # Déclaration des variables
16+ @variable (model, x1)
17+ set_start_value (x1, 8 )
18+ @variable (model, x2)
19+ set_start_value (x2, 9 )
20+
21+ # Définition de la fonction objectif
22+ @objective (model, Min, 4 * (x1- 5 )^ 2 + (x2- 6 )^ 2 )
23+
24+ return model
25+ end
You can’t perform that action at this time.
0 commit comments