-
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.
* HS241 to 245
- Loading branch information
Showing
15 changed files
with
331 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,9 @@ | ||
export hs241 | ||
|
||
function hs241(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} | ||
function f(x) | ||
return (x[1]^2 + x[2]^2 + x[3]^2 - 1)^2 + (x[1]^2 + x[2]^2 + (x[3] - 2)^2 - 1)^2 + (x[1] + x[2] + x[3] - 1)^2 + (x[1] + x[2] - x[3] + 1)^2 + (x[1]^3 + 3 * x[2]^2 + (5 * x[3] - x[1] + 1)^2 - 36)^2 | ||
end | ||
x0 = T[1, 2, 0] | ||
return ADNLPModels.ADNLPModel(f, x0, name = "hs241"; 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,12 @@ | ||
export hs242 | ||
|
||
function hs242(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} | ||
t = [ (10 + i) // 100 for i=1:10] | ||
function f(x::AbstractVector{Ti}; t = Ti.(t)) where {Ti} | ||
return sum( ((exp(-x[1] * t[i]) - exp(-x[2] * t[i])) - x[3] * (exp(-t[i]) - exp(-10 * t[i])))^2 for i=1:10) | ||
end | ||
x0 = T[2.5, 10, 10] | ||
lvar = T[0, 0, 0] | ||
uvar = T[10, 10, 10] | ||
return ADNLPModels.ADNLPModel(f, x0, lvar, uvar, name = "hs242"; 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 @@ | ||
export hs243 | ||
|
||
function hs243(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} | ||
A = Rational{Int}[0.14272; -0.184918; -0.521869; -0.685306] | ||
B = Rational{Int}[ | ||
2.95137 4.87407 -2.0506 | ||
4.87407 9.39321 -3.93181 | ||
-2.0506 -3.93189 2.64745 | ||
] | ||
D = Rational{Int}[1.75168; -1.35195; -0.479048; -0.3648] | ||
G = Rational{Int}[ | ||
-0.564255 0.392417 -0.404979 | ||
0.927589 -0.0735083 0.535393 | ||
0.658799 -0.636666 -0.681091 | ||
-0.869487 0.586387 0.289826 | ||
] | ||
|
||
function f(x; A = A, B = B, D = D, G = G) | ||
F = A + G * x + 1 // 2 * x' * B * x * D | ||
return F' * F | ||
end | ||
x0 = T[0.1, 0.1, 0.1] | ||
|
||
return ADNLPModels.ADNLPModel(f, x0, name = "hs243"; 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,9 @@ | ||
export hs244 | ||
|
||
function hs244(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} | ||
function f(x) | ||
return sum((exp(-x[1] * (10 + i) / 100) - x[3] * exp(-x[2] * (10 + i) / 100) - (exp(-one(eltype(x)) * (10 + i) / 100) - 5 * exp(-one(eltype(x)) * (10 + i) / 10)))^2 for i=1:10) | ||
end | ||
x0 = T[1, 2, 1] | ||
return ADNLPModels.ADNLPModel(f, x0, name = "hs244"; 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,9 @@ | ||
export hs245 | ||
|
||
function hs245(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} | ||
function f(x) | ||
return sum((exp(-x[1] * i / 10) - exp(-x[2] * i / 10) - x[3] * (exp(- one(eltype(x)) * i / 10) - exp(- one(eltype(x)) * i)))^2 for i=1:10) | ||
end | ||
x0 = T[0, 10, 20] | ||
return ADNLPModels.ADNLPModel(f, x0, name = "hs245"; 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 @@ | ||
hs241_meta = Dict( | ||
:nvar => 3, | ||
:variable_nvar => false, | ||
:ncon => 0, | ||
:variable_ncon => false, | ||
:minimize => true, | ||
:name => "hs241", | ||
: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_hs241_nvar(; n::Integer = default_nvar, kwargs...) = 3 | ||
get_hs241_ncon(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs241_nlin(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs241_nnln(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs241_nequ(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs241_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 @@ | ||
hs242_meta = Dict( | ||
:nvar => 3, | ||
:variable_nvar => false, | ||
:ncon => 0, | ||
:variable_ncon => false, | ||
:minimize => true, | ||
:name => "hs242", | ||
:has_equalities_only => false, | ||
:has_inequalities_only => false, | ||
:has_bounds => true, | ||
: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_hs242_nvar(; n::Integer = default_nvar, kwargs...) = 3 | ||
get_hs242_ncon(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs242_nlin(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs242_nnln(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs242_nequ(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs242_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 @@ | ||
hs243_meta = Dict( | ||
:nvar => 3, | ||
:variable_nvar => false, | ||
:ncon => 0, | ||
:variable_ncon => false, | ||
:minimize => true, | ||
:name => "hs243", | ||
:has_equalities_only => false, | ||
:has_inequalities_only => false, | ||
:has_bounds => false, | ||
:has_fixed_variables => false, | ||
:objtype => :other, | ||
:contype => :unconstrained, | ||
:best_known_lower_bound => 0.7966, | ||
:best_known_upper_bound => 0.7966, | ||
:is_feasible => true, | ||
:defined_everywhere => missing, | ||
:origin => :unknown, | ||
) | ||
get_hs243_nvar(; n::Integer = default_nvar, kwargs...) = 3 | ||
get_hs243_ncon(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs243_nlin(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs243_nnln(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs243_nequ(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs243_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 @@ | ||
hs244_meta = Dict( | ||
:nvar => 3, | ||
:variable_nvar => false, | ||
:ncon => 0, | ||
:variable_ncon => false, | ||
:minimize => true, | ||
:name => "hs244", | ||
: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_hs244_nvar(; n::Integer = default_nvar, kwargs...) = 3 | ||
get_hs244_ncon(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs244_nlin(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs244_nnln(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs244_nequ(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs244_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 @@ | ||
hs245_meta = Dict( | ||
:nvar => 3, | ||
:variable_nvar => false, | ||
:ncon => 0, | ||
:variable_ncon => false, | ||
:minimize => true, | ||
:name => "hs245", | ||
: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_hs245_nvar(; n::Integer = default_nvar, kwargs...) = 3 | ||
get_hs245_ncon(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs245_nlin(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs245_nnln(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs245_nequ(; n::Integer = default_nvar, kwargs...) = 0 | ||
get_hs245_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 241. | ||
# | ||
# Source: | ||
# Problem 241 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 hs241 | ||
|
||
"HS241 model" | ||
function hs241(args...; kwargs...) | ||
nlp = Model() | ||
x0 = [1, 2, 0] | ||
@variable(nlp, x[i = 1:3], start = x0[i]) | ||
|
||
@NLobjective(nlp, Min, (x[1]^2 + x[2]^2 + x[3]^2 - 1)^2 + (x[1]^2 + x[2]^2 + (x[3] - 2)^2 - 1)^2 + (x[1] + x[2] + x[3] - 1)^2 + (x[1] + x[2] - x[3] + 1)^2 + (x[1]^3 + 3 * x[2]^2 + (5 * x[3] - x[1] + 1)^2 - 36)^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,28 @@ | ||
# Hock and Schittkowski problem number 242. | ||
# | ||
# Source: | ||
# Problem 242 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 hs242 | ||
|
||
"HS242 model" | ||
function hs242(args...; kwargs...) | ||
nlp = Model() | ||
x0 = [2.5, 10, 10] | ||
lvar = [0, 0, 0] | ||
uvar = [10, 10, 10] | ||
@variable(nlp, uvar[i] ≥ x[i = 1:3] ≥ lvar[i], start = x0[i]) | ||
|
||
t = [ (10 + i) / 100 for i=1:10] | ||
@NLobjective(nlp, Min, sum( ((exp(-x[1] * t[i]) - exp(-x[2] * t[i])) - x[3] * (exp(-t[i]) - exp(-10 * t[i])))^2 for i=1:10)) | ||
|
||
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,39 @@ | ||
# Hock and Schittkowski problem number 243. | ||
# | ||
# Source: | ||
# Problem 243 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 hs243 | ||
|
||
"HS243 model" | ||
function hs243(args...; kwargs...) | ||
nlp = Model() | ||
x0 = [0.1, 0.1, 0.1] | ||
@variable(nlp, x[i = 1:3], start = x0[i]) | ||
|
||
A = [0.14272; -0.184918; -0.521869; -0.685306] | ||
B = [ | ||
2.95137 4.87407 -2.0506 | ||
4.87407 9.39321 -3.93181 | ||
-2.0506 -3.93189 2.64745 | ||
] | ||
D = [1.75168; -1.35195; -0.479048; -0.3648] | ||
G = [ | ||
-0.564255 0.392417 -0.404979 | ||
0.927589 -0.0735083 0.535393 | ||
0.658799 -0.636666 -0.681091 | ||
-0.869487 0.586387 0.289826 | ||
] | ||
|
||
@NLobjective(nlp, Min, sum( (A[j] + sum(G[j, k] * x[k] for k=1:3) + 0.5 * sum(x[l] * sum(B[l, k] * x[k] for k=1:3) for l=1:3) * D[j] )^2 for j=1:4)) | ||
|
||
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,25 @@ | ||
# Hock and Schittkowski problem number 244. | ||
# | ||
# Source: | ||
# Problem 244 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 hs244 | ||
|
||
"HS244 model" | ||
function hs244(args...; kwargs...) | ||
nlp = Model() | ||
x0 = [1, 2, 1] | ||
@variable(nlp, x[i = 1:3], start = x0[i]) | ||
|
||
@NLobjective(nlp, Min, sum((exp(-x[1] * (10 + i) / 100) - x[3] * exp(-x[2] * (10 + i) / 100) - (exp(-(10 + i) / 100) - 5 * exp(-(10 + i) / 10)))^2 for i=1:10)) | ||
|
||
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,25 @@ | ||
# Hock and Schittkowski problem number 245. | ||
# | ||
# Source: | ||
# Problem 245 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 hs245 | ||
|
||
"HS245 model" | ||
function hs245(args...; kwargs...) | ||
nlp = Model() | ||
x0 = [0, 10, 20] | ||
@variable(nlp, x[i = 1:3], start = x0[i]) | ||
|
||
@NLobjective(nlp, Min, sum((exp(-x[1] * i / 10) - exp(-x[2] * i / 10) - x[3] * (exp(- i / 10) - exp(- i)))^2 for i=1:10)) | ||
|
||
return nlp | ||
end |