Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kowalikosborne problem from "Testing Unconstrained Optimization Software" #15 #144

Merged
merged 3 commits into from
Apr 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/ADNLPProblems/kowosb.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export kowosb

function kowosb(args...; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T}
function f(x)
n = 4
m = 11
y = T[0.1957, 0.1947, 0.1735, 0.1600, 0.0844, 0.0627, 0.0456, 0.0342, 0.0323, 0.0235, 0.0246]
u = T[4, 2, 1, 0.5, 0.25, 0.167, 0.125, 0.1, 0.833, 0.0714, 0.0625]

return sum((y[i] - (x[1]*(u[i]^2 + u[i]*x[2]))/(u[i]^2 + u[i]*x[3] + x[4]))^2 for i = 1:m)
end
x0 = T[0.25, 0.39, 0.415, 0.39]
return ADNLPModels.ADNLPModel(f, x0, name = "kowosb"; kwargs...)
end
25 changes: 25 additions & 0 deletions src/Meta/kowosb.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
kowosb_meta = Dict(
:nvar => 4,
:variable_nvar => false,
:ncon => 0,
:variable_ncon => false,
:minimize => true,
:name => "kowosb",
:has_equalities_only => false,
:has_inequalities_only => false,
:has_bounds => false,
:has_fixed_variables => false,
:objtype => :other,
:contype => :unconstrained,
:best_known_lower_bound => -Inf,
:best_known_upper_bound => 0.026497849149796696,
:is_feasible => true,
:defined_everywhere => missing,
:origin => :unknown,
)
get_kowosb_nvar(; n::Integer = default_nvar, kwargs...) = 4
get_kowosb_ncon(; n::Integer = default_nvar, kwargs...) = 0
get_kowosb_nlin(; n::Integer = default_nvar, kwargs...) = 0
get_kowosb_nnln(; n::Integer = default_nvar, kwargs...) = 0
get_kowosb_nequ(; n::Integer = default_nvar, kwargs...) = 0
get_kowosb_nineq(; n::Integer = default_nvar, kwargs...) = 0
21 changes: 21 additions & 0 deletions src/PureJuMP/kowosb.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Source: Problem 15 in
# J.J. More', B.S. Garbow and K.E. Hillstrom,
# "Testing Unconstrained Optimization Software",
# ACM Transactions on Mathematical Software, vol. 7(1), pp. 17-41, 1981.

# classification SUR2-MN-4-0
export kowosb

function kowosb(args...; n::Int = default_nvar, kwargs...)
nlp = Model()

x0 = [0.25, 0.39, 0.415, 0.39]
@variable(nlp, x[i=1:4], start=x0[i])

m = 11
y = [0.1957, 0.1947, 0.1735, 0.1600, 0.0844, 0.0627, 0.0456, 0.0342, 0.0323, 0.0235, 0.0246]
u = [4, 2, 1, 0.5, 0.25, 0.167, 0.125, 0.1, 0.833, 0.0714, 0.0625]

@NLobjective(nlp, Min, sum((y[i] - (x[1]*(u[i]^2 + u[i]*x[2]))/(u[i]^2 + u[i]*x[3] + x[4]))^2 for i = 1:m))
return nlp
end