Re: [julia-opt] Re: Getting Contraint Violations

51 views
Skip to first unread message

Miles Lubin

unread,
Nov 15, 2016, 2:01:53 PM11/15/16
to julia-opt
You can ask for the value of each constraint at any given point by using eval_g. See http://www.juliaopt.org/JuMP.jl/0.14/nlp.html#querying-derivatives-from-a-jump-model.

On Tue, Nov 15, 2016 at 12:49 PM, Huckleberry Febbo <fe...@umich.edu> wrote:
Any insight on this would be helpful. Thanks!


On Thursday, October 27, 2016 at 5:14:23 PM UTC-4, Huckleberry Febbo wrote:
I am solving a nonlinear optimization problem using JuMP with IPOPT and I am running into a problem where the solver says:
"WARNING: Not solved to optimality, status: Infeasible"

It is very similar to a problem that is feasible and I am not sure what the issue is with this problem. So, I started to try and look at the constraints violation at this infeasible point, but I could not figure it out with a nonlinear constraint. Frist I tried the ``getvalue()'' function but that did not work and the documentation did not say that ``getvalue()`` works with nonlinear expressions.

 I tried a few other things as well that did not pan out. Is there an easy way query to evaluate the nonlinear constraint expressions at the current solution?

--
You received this message because you are subscribed to the Google Groups "julia-opt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to julia-opt+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/julia-opt.
For more options, visit https://groups.google.com/d/optout.

Huckleberry Febbo

unread,
Nov 16, 2016, 6:59:38 PM11/16/16
to julia-opt
Great, thanks.

Is there a list of the variables in the order that they where added?

I would like to avoid having to do this:

values = zeros(2)
values[linearindex(x)] = 2.0
values[linearindex(y)] = 3.0

since I have close to 1000 variables that are changing depending on my problem, I would like to do this automatically. For instance, let's call the total design variable ``DV`` and so in this case:

DV = [2,3]

Then, one could use this like:

objval = MathProgBase.eval_f(d, DV)

I imagine that you had to convert the variables into a single vector in order to use IPOPT for instance. Is this vector of values available at the JuMP or MathProg interface level in julia?

Joey Huchette

unread,
Nov 16, 2016, 7:52:46 PM11/16/16
to juli...@googlegroups.com
You can recover the i-th variable with Variable(model, i).

Joey





--
You received this message because you are subscribed to the Google Groups "julia-opt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to julia-opt+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages