JuMP: Print value of subset of variables at each iteration

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

JuMP: Print value of subset of variables at each iteration

Asbjørn Nilsen Riseth
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


--
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 [hidden email].
Visit this group at https://groups.google.com/group/julia-opt.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: JuMP: Print value of subset of variables at each iteration

Miles Lubin
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.

On Wednesday, October 19, 2016 at 4:11:12 AM UTC-4, Asbjørn Nilsen Riseth wrote:
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


--
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 [hidden email].
Visit this group at https://groups.google.com/group/julia-opt.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: JuMP: Print value of subset of variables at each iteration

Asbjørn Nilsen Riseth
Ah, not as straightforward as I hoped. Thanks, I might look into the Ipopt callbacks.


On Mon, 24 Oct 2016 00:52 Miles Lubin, <[hidden email]> wrote:
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.


On Wednesday, October 19, 2016 at 4:11:12 AM UTC-4, Asbjørn Nilsen Riseth wrote:
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


--
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 [hidden email].
Visit this group at https://groups.google.com/group/julia-opt.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
Visit this group at https://groups.google.com/group/julia-opt.
For more options, visit https://groups.google.com/d/optout.
Loading...