-
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
Showing
15 changed files
with
351 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,11 @@ | ||
export hs261 | ||
|
||
function hs261(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} | ||
function f(x) | ||
n = length(x) | ||
return (exp(x[1]) - x[2])^4 + 100 * (x[2] - x[3])^6 + tan(x[3] - x[4])^4 + x[1]^8 + (x[4] - 1)^2 | ||
end | ||
x0 = T[0, 0, 0, 0] | ||
|
||
return ADNLPModels.ADNLPModel(f, x0, name = "hs261"; 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,19 @@ | ||
export hs262 | ||
|
||
function hs262(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} | ||
function f(x) | ||
return - 1 // 2 * x[1] - x[2] - 1 // 2 * x[3] - x[4] | ||
end | ||
x0 = T[1, 1, 1, 1] | ||
lvar = T[0, 0, 0, 0] | ||
uvar = T[Inf, Inf, Inf, Inf] | ||
A = T[ | ||
1 1 1 -2 | ||
-1 -1 -1 -1 | ||
-2//10 -5//10 -1 -2 | ||
-2 -1 -5//10 -2//10 | ||
] | ||
lcon = T[6; -10; -10; -10] | ||
ucon = T[6; Inf; Inf; Inf] | ||
return ADNLPModels.ADNLPModel(f, x0, lvar, uvar, sparse(A), lcon, ucon, name = "hs262"; 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,19 @@ | ||
export hs263 | ||
|
||
function hs263(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} | ||
function f(x) | ||
n = length(x) | ||
return -x[1] | ||
end | ||
x0 = T[10, 10, 10, 10] | ||
function c!(cx, x) | ||
cx[1] = x[2] - x[1]^3 | ||
cx[2] = x[1]^2 - x[2] | ||
cx[3] = x[2] - x[1]^3 - x[3]^2 | ||
cx[4] = x[1]^2 - x[2] - x[4]^2 | ||
return cx | ||
end | ||
lcon = zeros(T, 4) | ||
ucon = T[Inf; Inf; 0; 0] | ||
return ADNLPModels.ADNLPModel!(f, x0, c!, lcon, ucon, name = "hs263"; 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,18 @@ | ||
export hs264 | ||
|
||
function hs264(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} | ||
function f(x) | ||
n = length(x) | ||
return x[1]^2 + x[2]^2 + 2 * x[3]^2 + x[4]^2 - 5 * x[1] - 5 * x[2] - 21 * x[3] + 7 * x[4] | ||
end | ||
x0 = T[0, 0, 0, 0] | ||
function c!(cx, x) | ||
cx[1] = -x[1]^2 - x[2]^2 - x[3]^2 - x[4]^2 - x[1] + x[2] + x[3] + x[4] + 8 | ||
cx[2] = -x[1]^2 - 2 * x[2]^2 - x[3]^2 - 2 * x[4]^2 + x[1] + x[4] + 9 | ||
cx[3] = -2 * x[1]^2 - x[2]^2 - x[3]^2 - 2 * x[1] + x[2] + x[4] + 5 | ||
return cx | ||
end | ||
lcon = T[0, 0, 0] | ||
ucon = T[Inf, Inf, Inf] | ||
return ADNLPModels.ADNLPModel!(f, x0, c!, lcon, ucon, name = "hs264"; 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,17 @@ | ||
export hs265 | ||
|
||
function hs265(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} | ||
function f(x) | ||
n = length(x) | ||
return sum(1 - exp(-10 * x[i] * exp(-x[i + 2])) for i=1:2) | ||
end | ||
x0 = T[0, 0, 0, 0] | ||
lvar = T[0, 0, 0, 0] | ||
uvar = T[1, 1, 1, 1] | ||
A = T[ | ||
1 1 0 0 | ||
0 0 1 1 | ||
] | ||
lcon = ucon = T[1; 1] | ||
return ADNLPModels.ADNLPModel(f, x0, lvar, uvar, sparse(A), lcon, ucon, name = "hs265"; 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,25 @@ | ||
hs261_meta = Dict( | ||
:nvar => 4, | ||
:variable_nvar => false, | ||
:ncon => 0, | ||
:variable_ncon => false, | ||
:minimize => true, | ||
:name => "hs261", | ||
:has_equalities_only => false, | ||
:has_inequalities_only => false, | ||
:has_bounds => false, | ||
:has_fixed_variables => false, | ||
:objtype => :other, | ||
:contype => :unconstrained, | ||
:best_known_lower_bound => 0, | ||
:best_known_upper_bound => 0, | ||
:is_feasible => true, | ||
:defined_everywhere => missing, | ||
:origin => :unknown, | ||
) | ||
get_hs261_nvar(; n::Integer = default_nvar, kwargs...) = 4 | ||
get_hs261_ncon(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs261_nlin(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs261_nnln(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs261_nequ(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs261_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,25 @@ | ||
hs262_meta = Dict( | ||
:nvar => 4, | ||
:variable_nvar => false, | ||
:ncon => 4, | ||
:variable_ncon => false, | ||
:minimize => true, | ||
:name => "hs262", | ||
:has_equalities_only => false, | ||
:has_inequalities_only => false, | ||
:has_bounds => true, | ||
:has_fixed_variables => false, | ||
:objtype => :other, | ||
:contype => :linear, | ||
:best_known_lower_bound => -10, | ||
:best_known_upper_bound => -10, | ||
:is_feasible => true, | ||
:defined_everywhere => missing, | ||
:origin => :unknown, | ||
) | ||
get_hs262_nvar(; n::Integer = default_nvar, kwargs...) = 4 | ||
get_hs262_ncon(; n::Integer = default_nvar, kwargs...) = 4 | ||
get_hs262_nlin(; n::Integer = default_nvar, kwargs...) = 4 | ||
get_hs262_nnln(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs262_nequ(; n::Integer = default_nvar, kwargs...) = 1 | ||
get_hs262_nineq(; n::Integer = default_nvar, kwargs...) = 3 |
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 @@ | ||
hs263_meta = Dict( | ||
:nvar => 4, | ||
:variable_nvar => false, | ||
:ncon => 4, | ||
:variable_ncon => false, | ||
:minimize => true, | ||
:name => "hs263", | ||
:has_equalities_only => false, | ||
:has_inequalities_only => false, | ||
:has_bounds => false, | ||
:has_fixed_variables => false, | ||
:objtype => :other, | ||
:contype => :general, | ||
:best_known_lower_bound => -1, | ||
:best_known_upper_bound => -1, | ||
:is_feasible => true, | ||
:defined_everywhere => missing, | ||
:origin => :unknown, | ||
) | ||
get_hs263_nvar(; n::Integer = default_nvar, kwargs...) = 4 | ||
get_hs263_ncon(; n::Integer = default_nvar, kwargs...) = 4 | ||
get_hs263_nlin(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs263_nnln(; n::Integer = default_nvar, kwargs...) = 4 | ||
get_hs263_nequ(; n::Integer = default_nvar, kwargs...) = 2 | ||
get_hs263_nineq(; n::Integer = default_nvar, kwargs...) = 2 |
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 @@ | ||
hs264_meta = Dict( | ||
:nvar => 4, | ||
:variable_nvar => false, | ||
:ncon => 3, | ||
:variable_ncon => false, | ||
:minimize => true, | ||
:name => "hs264", | ||
:has_equalities_only => false, | ||
:has_inequalities_only => true, | ||
:has_bounds => false, | ||
:has_fixed_variables => false, | ||
:objtype => :other, | ||
:contype => :general, | ||
:best_known_lower_bound => -44, | ||
:best_known_upper_bound => -44, | ||
:is_feasible => true, | ||
:defined_everywhere => missing, | ||
:origin => :unknown, | ||
) | ||
get_hs264_nvar(; n::Integer = default_nvar, kwargs...) = 4 | ||
get_hs264_ncon(; n::Integer = default_nvar, kwargs...) = 3 | ||
get_hs264_nlin(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs264_nnln(; n::Integer = default_nvar, kwargs...) = 3 | ||
get_hs264_nequ(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs264_nineq(; n::Integer = default_nvar, kwargs...) = 3 |
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 @@ | ||
hs265_meta = Dict( | ||
:nvar => 4, | ||
:variable_nvar => false, | ||
:ncon => 2, | ||
:variable_ncon => false, | ||
:minimize => true, | ||
:name => "hs265", | ||
:has_equalities_only => true, | ||
:has_inequalities_only => false, | ||
:has_bounds => true, | ||
:has_fixed_variables => false, | ||
:objtype => :other, | ||
:contype => :linear, | ||
:best_known_lower_bound => 1 - exp(-10 * exp(-1)), | ||
:best_known_upper_bound => 1 - exp(-10 * exp(-1)), | ||
:is_feasible => true, | ||
:defined_everywhere => missing, | ||
:origin => :unknown, | ||
) | ||
get_hs265_nvar(; n::Integer = default_nvar, kwargs...) = 4 | ||
get_hs265_ncon(; n::Integer = default_nvar, kwargs...) = 2 | ||
get_hs265_nlin(; n::Integer = default_nvar, kwargs...) = 2 | ||
get_hs265_nnln(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs265_nequ(; n::Integer = default_nvar, kwargs...) = 2 | ||
get_hs265_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,25 @@ | ||
# Hock and Schittkowski problem number 261. | ||
# | ||
# Source: | ||
# Problem 261 in | ||
# K. Schittkowski, | ||
# More Test Examples for Nonlinear Programming Codes, | ||
# Lectures Notes in Economics and Mathematical Systems 282, | ||
# Springer Verlag, Heidelberg, 1987. | ||
# | ||
# | ||
# | ||
# T. Migot, Montreal, 2023. | ||
|
||
export hs261 | ||
|
||
"HS261 model" | ||
function hs261(args...; kwargs...) | ||
nlp = Model() | ||
x0 = [0, 0, 0, 0] | ||
@variable(nlp, x[i = 1:4], start = x0[i]) | ||
|
||
@NLobjective(nlp, Min, (exp(x[1]) - x[2])^4 + 100 * (x[2] - x[3])^6 + tan(x[3] - x[4])^4 + x[1]^8 + (x[4] - 1)^2) | ||
|
||
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,31 @@ | ||
# Hock and Schittkowski problem number 262. | ||
# | ||
# Source: | ||
# Problem 262 in | ||
# K. Schittkowski, | ||
# More Test Examples for Nonlinear Programming Codes, | ||
# Lectures Notes in Economics and Mathematical Systems 282, | ||
# Springer Verlag, Heidelberg, 1987. | ||
# | ||
# | ||
# | ||
# T. Migot, Montreal, 2023. | ||
|
||
export hs262 | ||
|
||
"HS262 model" | ||
function hs262(args...; kwargs...) | ||
nlp = Model() | ||
x0 = [1, 1, 1, 1] | ||
lvar = [0, 0, 0, 0] | ||
@variable(nlp, x[i = 1:4] ≥ lvar[i], start = x0[i]) | ||
|
||
@NLobjective(nlp, Min, -0.5 * x[1] - x[2] - 0.5 * x[3] - x[4]) | ||
|
||
@constraint(nlp, x[1] + x[2] + x[3] - 2 * x[4] - 6 == 0) | ||
@constraint(nlp, 10 - x[1] - x[2] - x[3] - x[4] >= 0) | ||
@constraint(nlp, 10 - 0.2 * x[1] - 0.5 * x[2] - x[3] - 2 * x[4] >= 0) | ||
@constraint(nlp, 10 - 2 * x[1] - x[2] - 0.5 * x[3] - 0.2 * x[4] >= 0) | ||
|
||
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,29 @@ | ||
# Hock and Schittkowski problem number 263. | ||
# | ||
# Source: | ||
# Problem 263 in | ||
# K. Schittkowski, | ||
# More Test Examples for Nonlinear Programming Codes, | ||
# Lectures Notes in Economics and Mathematical Systems 282, | ||
# Springer Verlag, Heidelberg, 1987. | ||
# | ||
# | ||
# | ||
# T. Migot, Montreal, 2023. | ||
|
||
export hs263 | ||
|
||
"HS263 model" | ||
function hs263(args...; kwargs...) | ||
nlp = Model() | ||
x0 = [10, 10, 10, 10] | ||
@variable(nlp, x[i = 1:4], start = x0[i]) | ||
|
||
@NLobjective(nlp, Min, -x[1]) | ||
@NLconstraint(nlp, x[2] - x[1]^3 >= 0) | ||
@NLconstraint(nlp, x[1]^2 - x[2] >= 0) | ||
@NLconstraint(nlp, x[2] - x[1]^3 - x[3]^2 == 0) | ||
@NLconstraint(nlp, x[1]^2 - x[2] - x[4]^2 == 0) | ||
|
||
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,28 @@ | ||
# Hock and Schittkowski problem number 264. | ||
# | ||
# Source: | ||
# Problem 264 in | ||
# K. Schittkowski, | ||
# More Test Examples for Nonlinear Programming Codes, | ||
# Lectures Notes in Economics and Mathematical Systems 282, | ||
# Springer Verlag, Heidelberg, 1987. | ||
# | ||
# | ||
# | ||
# T. Migot, Montreal, 2023. | ||
|
||
export hs264 | ||
|
||
"HS264 model: modified Rosen-Suzuki problem" | ||
function hs264(args...; kwargs...) | ||
nlp = Model() | ||
x0 = [0, 0, 0, 0] | ||
|
||
@variable(nlp, x[i = 1:4], start = x0[i]) | ||
|
||
@NLobjective(nlp, Min, x[1]^2 + x[2]^2 + 2 * x[3]^2 + x[4]^2 - 5 * x[1] - 5 * x[2] - 21 * x[3] + 7 * x[4]) | ||
@NLconstraint(nlp, -x[1]^2 - x[2]^2 - x[3]^2 - x[4]^2 - x[1] + x[2] + x[3] + x[4] + 8 >= 0) | ||
@NLconstraint(nlp, -x[1]^2 - 2 * x[2]^2 - x[3]^2 - 2 * x[4]^2 + x[1] + x[4] + 9 >= 0) | ||
@NLconstraint(nlp, -2 * x[1]^2 - x[2]^2 - x[3]^2 - 2 * x[1] + x[2] + x[4] + 5 >= 0) | ||
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,29 @@ | ||
# Hock and Schittkowski problem number 265. | ||
# | ||
# Source: | ||
# Problem 265 in | ||
# K. Schittkowski, | ||
# More Test Examples for Nonlinear Programming Codes, | ||
# Lectures Notes in Economics and Mathematical Systems 282, | ||
# Springer Verlag, Heidelberg, 1987. | ||
# | ||
# | ||
# | ||
# T. Migot, Montreal, 2023. | ||
|
||
export hs265 | ||
|
||
"HS265 model" | ||
function hs265(args...; kwargs...) | ||
nlp = Model() | ||
x0 = [0, 0, 0, 0] | ||
lvar = [0, 0, 0, 0] | ||
uvar = [1, 1, 1, 1] | ||
@variable(nlp, uvar[i] ≥ x[i = 1:4] ≥ lvar[i], start = x0[i]) | ||
|
||
@NLobjective(nlp, Min, sum(1 - exp(-10 * x[i] * exp(-x[i + 2])) for i=1:2)) | ||
@constraint(nlp, x[1] + x[2] - 1 == 0) | ||
@constraint(nlp, x[3] + x[4] - 1 == 0) | ||
|
||
return nlp | ||
end |