# Correct syntax for Ipopt and JuMP request?

**URL:** <https://discourse.julialang.org/t/correct-syntax-for-ipopt-and-jump-request/42743>\
**Category:** Optimization (Mathematical)\
**Tags:** question, jump, optimization\
**Created:** [July 8, 2020, 4:18pm UTC](https://discourse.julialang.org/t/correct-syntax-for-ipopt-and-jump-request/42743 "2020-07-08T16:18:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zazizoma](https://avatars.discourse-cdn.com/v4/letter/z/5f8ce5/32.png) [@zazizoma](https://discourse.julialang.org/u/zazizoma)\
**Post date:** [July 8, 2020, 4:18pm UTC](https://discourse.julialang.org/t/correct-syntax-for-ipopt-and-jump-request/42743/1 "2020-07-08T16:18:01Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![greg\_plowman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/greg_plowman/32/8100_2.png) [@greg\_plowman](https://discourse.julialang.org/u/greg_plowman)\
**Post date:** [July 8, 2020, 9:19pm UTC](https://discourse.julialang.org/t/correct-syntax-for-ipopt-and-jump-request/42743/2 "2020-07-08T21:19:35Z")

</div>

Any of these seem to work:

```julia
model = Model(() -> Ipopt.Optimizer(print_level=0))

```

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

```

```julia
model = Model(optimizer_with_attributes(Ipopt.Optimizer, "print_level"=>0))

```

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

---

<div class="post-metadata">

**Author:** ![joaquimg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joaquimg/32/223_2.png) [@joaquimg](https://discourse.julialang.org/u/joaquimg)\
**Post date:** [July 8, 2020, 10:49pm UTC](https://discourse.julialang.org/t/correct-syntax-for-ipopt-and-jump-request/42743/3 "2020-07-08T22:49:54Z")

</div>

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