# Ipopt Set Attribute

**URL:** https://discourse.julialang.org/t/ipopt-set-attribute/59982
**Category:** Optimization (Mathematical)
**Created:** [April 25, 2021, 9:56am UTC](https://discourse.julialang.org/t/ipopt-set-attribute/59982 "2021-04-25T09:56:33Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![user1200](https://avatars.discourse-cdn.com/v4/letter/u/b2d939/32.png) [@user1200](https://discourse.julialang.org/u/user1200)
#### Post date: [April 25, 2021, 9:56am UTC](https://discourse.julialang.org/t/ipopt-set-attribute/59982/1 "2021-04-25T09:56:33Z")

</div>

Hello  
I got little issue with

> model = Model(with\_optimizer(Ipopt.Optimizer, tol=1e-9))  
> #or  
> set\_optimizer\_attribute(model, “constr\_viol\_tol”, 0)  
> #throws this error when called optimize!

> It is a valid option, but it is of type **Number** , not of type **Integer**. Please check the documentation for options.

When looking to Ipopt documentation its passing wrong type

so tried  
aa = convert(Number, 10)  
typeof(aa)

> Int64

Is there some way how can I fix it ? 🙂

Version of Julia is 1.5.3  
Thanks alot 🥦

---

<div class="post-metadata">

### Author: ![user1200](https://avatars.discourse-cdn.com/v4/letter/u/b2d939/32.png) [@user1200](https://discourse.julialang.org/u/user1200)
#### Post date: [April 25, 2021, 12:56pm UTC](https://discourse.julialang.org/t/ipopt-set-attribute/59982/2 "2021-04-25T12:56:12Z")

</div>

Using 0.0 helped 🙂

---

<div class="post-metadata">

### Author: ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)
#### Post date: [April 25, 2021, 9:52pm UTC](https://discourse.julialang.org/t/ipopt-set-attribute/59982/3 "2021-04-25T21:52:17Z")

</div>

Unfortunately the message coming from Ipopt isn’t very clear. But yes, you passed an integer `0` when Ipopt wanted a Float64 `0.0`.

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [April 26, 2021, 11:30am UTC](https://discourse.julialang.org/t/ipopt-set-attribute/59982/4 "2021-04-26T11:30:43Z")

</div>

I think that gracefully converting inputs is reasonable in user-facing API, perhaps open an issue at Ipopt.jl.

---

<div class="post-metadata">

### Author: ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)
#### Post date: [April 28, 2021, 9:28pm UTC](https://discourse.julialang.org/t/ipopt-set-attribute/59982/5 "2021-04-28T21:28:14Z")

</div>

Ipopt.jl passes options as given by the user. We don’t store a map of every Ipopt option name to the type, so we can’t do conversion.
