JuMP: Print value of subset of variables at each iteration

57 views
Skip to first unread message

Asbjørn Nilsen Riseth

unread,
Oct 19, 2016, 4:11:12 AM10/19/16
to julia-opt
Is there a way to print out the value of a subset of my variables at each iteration, when using Ipopt? (increasing print_level gets messy)
I assume callbacks is the way to go. Is that correct, or are there easier ways to approach this?

E.g.
using JuMP
m = Model()
@variable(m, x, start = 0.0)
@variable(m, y, start = 0.0)

@NLobjective(m, Min, (1-x)^2 + 100(y-x^2)^2)

solve(m)
# Print the value of x at each iteration


Miles Lubin

unread,
Oct 23, 2016, 7:52:09 PM10/23/16
to julia-opt
You should look into Ipopt's info callback, which is not currently exposed through JuMP. Worst case you can hack JuMP to print out a part of the solution vector when JuMP is called by Ipopt for derivative evaluations.

Asbjørn Nilsen Riseth

unread,
Oct 24, 2016, 3:07:40 AM10/24/16
to julia-opt
Ah, not as straightforward as I hoped. Thanks, I might look into the Ipopt callbacks.


--
You received this message because you are subscribed to a topic in the Google Groups "julia-opt" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/julia-opt/gbM1_9HZ-Ow/unsubscribe.
To unsubscribe from this group and all its topics, send an email to julia-opt+...@googlegroups.com.
Visit this group at https://groups.google.com/group/julia-opt.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages