-
Notifications
You must be signed in to change notification settings - Fork 0
(WIP) Test script sIPOPT #1
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
base: master
Are you sure you want to change the base?
Conversation
I am trying to figure out how to ask MOI to ignore the fact that parameters are parameters and just treat them as variables in the calculation of the I.e., I want to, after solving the problem and getting the primal-dual solution from the optimizer, basically ignore the parameter constraints, From what I understand, the problem is this IF: |
testing_barrier.jl
Outdated
|
||
# Parameters | ||
@variable(model, p ∈ MOI.Parameter(1.0)) | ||
@variable(model, p2 ∈ MOI.Parameter(2.0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not p == 1.0
instead to use the MOI.EqualTo
set?
I don't think you need to consider slacks. You should be able to do everything in the space of the original problem, aside from any variables/constraints you might need to add to handle parameters. |
nlp_utilities.jl
Outdated
for (i, con) in enumerate(cons[ineq_locations]) | ||
bound_duals[num_vars+i] = dual.(con) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that you're using JuMP's inequality multipliers for both the slack bound multipliers and the slack equality multipliers (in the Hessian). I believe this is correct, up to potentially a sign change.
So as long as it's well-tested, I have no problem with using the slack reformulation, although I would personally find it simpler to just use the original problem's primal variables and inequality constraints.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is almost done, I think I will use the reformulation, test it, and then change to using the original problem (but now knowing my tests make sense).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments on parameters vs. fixed variables.
nlp_utilities_test.jl
Outdated
@variable(model, p ∈ MOI.Parameter(1.0)) | ||
@variable(model, p2 ∈ MOI.Parameter(2.0)) | ||
@variable(model, p3 ∈ MOI.Parameter(100.0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not that familiar with variable in Parameter
declarations. This seems similar to declaring the variable then calling fix(p, value)
, with the following differences:
- We use
FixRef
andis_fixed
for the fixed variable andParameterRef
andis_parameter
for the parameter variable - The dual can be obtained for a
FixRef
constraint, but not for aParameterRef
constraint. set_parameter_value
andparameter_value
can be used to set and get a parameter's value, regardless of whether the model has been modified since a solve.
Any other differences I should be aware of?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joaquimg might have more knowledge on this.
Based on sIPOPT paper https://optimization-online.org/wp-content/uploads/2011/04/3008.pdf.
EQ (23 -24).
Order of sensitivities:
M
MatrixNotice that given some variables and slacks don't have lower or upper bound (or neither), we have:
-I
: A matrix of minus ones and zeros that has the number of rows equal to the number of standard primal variables (# primal variables + # slack), and the number of columns is just the number of the subset that has lower bounds. The inverse ofV_L
.I
andV_U
but for the upper bound.