You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a non-linear objective which is supported by the Hypatia solver (I think because my objective function can be rewritten to something linear and replaced with multiple "Logarithm cone" constraints, see equation (51a) of https://github.com/jump-dev/Hypatia.jl/wiki/files/coneref.pdf ). I know my program can be solved by Hypatia because Convex.jl seems to have no problem with it:
using Convex, Hypatia
winning_probabilities =Dict(
[0,0] =>0.0134,
[1,0] =>0.063,
[0,1] =>0.4836,
[1,1] =>0.44,
)
prices = [0.42, 0.8]
n =length(prices)
cash =Variable(1, Positive())
f =Variable(n, Positive())
objective =sum(p *log(cash + s'*(f./prices)) for (s,p) in winning_probabilities)
sum_one = cash +sum(f) ==1
problem =maximize(objective, sum_one)
solve!(problem, Hypatia.Optimizer)
However it seems JuMP doesn't like my objective and gives me an error:
using JuMP
model =Model(Hypatia.Optimizer)
@variable(model, cash, lower_bound=0, upper_bound=1)
@variable(model, f[1:n], lower_bound=0, upper_bound=1)
@constraint(model, cash +sum(f) ==1)
@objective(model, Max, sum(p *log(cash + s'*(f./prices)) for (s,p) in winning_probabilities))
# ERROR: The solver does not support an objective function of type MathOptInterface.ScalarNonlinearFunction.
I'm not sure if this is the right place to report this. If it is not, I apologize.
The text was updated successfully, but these errors were encountered:
I'm closing this issue because this is the expected behavior.
Convex implements disciplined convex programming. It can reformulate nonlinear programs into conic form if and only if they use the built-in atoms and satisfy the axioms of DCP. The problem you pass to Convex is reformulated into conic form before being passed to Hypatia.
JuMP does not implement DCP. It does not reformulate nonlinear expressions into conic form. Hypatia does not support scalar nonlinear functions, so it errors. If you want to use Hypatia with JuMP you must manually reformulate the problem into conic form.
I have a non-linear objective which is supported by the
Hypatia
solver (I think because my objective function can be rewritten to something linear and replaced with multiple "Logarithm cone" constraints, see equation (51a) of https://github.com/jump-dev/Hypatia.jl/wiki/files/coneref.pdf ). I know my program can be solved byHypatia
becauseConvex.jl
seems to have no problem with it:However it seems JuMP doesn't like my objective and gives me an error:
I'm not sure if this is the right place to report this. If it is not, I apologize.
The text was updated successfully, but these errors were encountered: