-
Notifications
You must be signed in to change notification settings - Fork 8
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
Quadratic functions in the constraints are not picked up by MathOptNLPModel #173
Comments
The |
If you want to get the NLPModel of a JuMP model, I would query the internal field of the Optimizer. We could add an MOI attribute to make it easy to access without the need to query an internal field of |
I think we started some work on this with @amontoison a while ago #102 (connected to #50 ) |
Just an update, related to #174, more general nonlinear constraints are also not supported |
MWE: using JuMP, NLPModelsJuMP, Percival
model = Model()
@variable(model, x[1:2])
@objective(model, Min, (x[1] - 1)^2 + 4 * (x[2] - x[1]^2)^2)
@constraint(model, x[1]^2 + x[2]^2 == 1)
@constraint(model, x[1]^4 + x[2]^4 == 1)
@constraint(model, x[1] * exp(x[2]) == 1)
nlp = MathOptNLPModel(model) # Warns Function MathOptInterface.ScalarQuadraticFunction{Float64} is not supported.
# And shows no constraints
output = percival(nlp) # Warns Problem does not have general constraints; calling tron
output.solution # Shows close to [1;1] |
@blegat @abelsiqueira I don't understand how they are stored because I don't have any error when I create the MathOptNLPModel. Don't we need to do something in this function here for |
You allow nonlinear functions thanks to Lines 379 to 381 in 3dd5054
but you don't do anything with it. Lines 395 to 410 in 3dd5054
|
@blegat It's you that allowed nonlinear functions 😉 You modified this line: |
Yes, indeed, I remember now. The current strategy is to put all the nonlinear function in the |
More specifically,
warns with
And indeed, there are no constraints in the model. Solving the problem via JuMP using
NLPModels.Optimizer
works.cc. @blegat, if you can help us again.
The text was updated successfully, but these errors were encountered: