Correct syntax for Ipopt and JuMP request?

Hello, I’m attempting to maximize f(x, y) = c_1xy^\gamma - c_2y using Ipopt, JuMP and Julia 1.4.2. Both x and y have upper and lower bounds. I need to suppress Ipopt output as the routine is running in a loop.

This

model = Model(Ipopt.Optimizer, print_level = 0)

gives an error that

MethodError: no method matching Model(; print_level=0).

This

model = Model(with_optimizer(Ipopt.Optimizer), print_level = 0)

give the error that

Ipopt is not defined.

What is the correct syntax?

If Ipopt won’t let me suppress output, is there a more appropriate solver?

Thanks for looking!

Any of these seem to work:

model = Model(() -> Ipopt.Optimizer(print_level=0))
model = Model(with_optimizer(Ipopt.Optimizer, print_level=0))
model = Model(optimizer_with_attributes(Ipopt.Optimizer, "print_level"=>0))

I’m not sure if there is a preferred way?

1 Like

The second one is deprecated. The other two are good!

1 Like