# JuMP: Ipopt, ECOS, ErrorMsg: no method matching setvartype

**URL:** <https://discourse.julialang.org/t/jump-ipopt-ecos-errormsg-no-method-matching-setvartype/7705>\
**Category:** Optimization (Mathematical)\
**Tags:** question\
**Created:** [December 12, 2017, 10:47am UTC](https://discourse.julialang.org/t/jump-ipopt-ecos-errormsg-no-method-matching-setvartype/7705 "2017-12-12T10:47:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anton\_Hinneck](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/anton_hinneck/32/22716_2.png) [@Anton\_Hinneck](https://discourse.julialang.org/u/Anton_Hinneck)\
**Post date:** [December 12, 2017, 10:47am UTC](https://discourse.julialang.org/t/jump-ipopt-ecos-errormsg-no-method-matching-setvartype/7705/1 "2017-12-12T10:47:07Z")

</div>

Hi, I have been programming a MILP for university. The model is feasible and was already solved using GLPK, CBC, Gurobi and CPLEX. The results are as expected and were carefully examined already. However, I have an issue solving the model using ECOS and Ipopt. Everytime, during the call in JuMP solve(myModel) I get the following errors, dependent on the solver I am trying to use:

```julia
    LoadError: LoadError: MethodError: no method matching setvartype!
    (::ECOS.ECOSMathProgModel, ::Array{Symbol,1})

```

or

```julia
    LoadError: LoadError: MethodError: no method matching setvartype!
    (::Ipopt.IpoptMathProgModel, ::Array{Symbol,1})

```

The source code, regarding the solvers is rather simple and looks like this:

```julia
    using ECOS
    myModel = Model(solver=ECOSSolver())

```

or

```julia
    using Ipopt
    myModel = Model(solver=IpoptSolver())

```

I am puzzled. I figured the problem might be related to the variables I am using, which look like this:

```julia
    @variable(myModel, h[set_1] >= 0, Int);
    @variable(myModel, i[set_1] >= 0, Int);
    @variable(myModel, j[set_1] >= 0);
    @variable(myModel, k[set_1] >= 0);
    @variable(myModel, l[set_1] >= 1, Int);
    @variable(myModel, m[set_1, set_2], Bin);
    @variable(myModel, T >= 0, Int);

    ## FIX VARIABLES
    #--------------------------------------------------------------------------

    for(i,value) in enumerate(set_1)

        if param_1[value] >= 0

            JuMP.fix(h[value],param_1[value])
            JuMP.fix(i[value],param_1[value]+param_2[value])

            JuMP.fix(j[value],param_1[value])
            JuMP.fix(k[value],param_1[value]+param_2[value])

            JuMP.fix(l[value],1)

            println(Symbol("Variables regarding ",value," fixed."))
        end
    end

```

Anyways, I hope somebody encountered the issue before. Maybe, that I don’t understand something that is fundamental. I am using the Atom editor. Thanks for your help.

* * *

**Problem solved!**

I had posted the question on [Stackoverflow](https://stackoverflow.com/questions/47730330/jump-ipopt-ecos-errormsg-no-method-matching-setvartype), as well.

---

<div class="post-metadata">

**Author:** ![Anton\_Hinneck](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/anton_hinneck/32/22716_2.png) [@Anton\_Hinneck](https://discourse.julialang.org/u/Anton_Hinneck)\
**Post date:** [December 12, 2017, 12:55pm UTC](https://discourse.julialang.org/t/jump-ipopt-ecos-errormsg-no-method-matching-setvartype/7705/2 "2017-12-12T12:55:35Z")

</div>

I consulted the JuMP Installation Guide and saw, that Ipopt and ECOS do not support MILPs …

---

<div class="post-metadata">

**Author:** ![miles.lubin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/miles.lubin/32/279_2.png) [@miles.lubin](https://discourse.julialang.org/u/miles.lubin)\
**Post date:** [December 12, 2017, 5:02pm UTC](https://discourse.julialang.org/t/jump-ipopt-ecos-errormsg-no-method-matching-setvartype/7705/3 "2017-12-12T17:02:33Z")

</div>

That’s correct. The unfriendly error message means that the solver does not support integer variables. JuMP 0.19 will provide better infrastructure for reporting that the solver doesn’t support the problem that the user wrote down.

By the way, if you [cross-post](https://stackoverflow.com/questions/47730330/jump-ipopt-ecos-errormsg-no-method-matching-setvartype), please update both posts with links to the other to avoid duplicate effort in answering.

---

<div class="post-metadata">

**Author:** ![Anton\_Hinneck](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/anton_hinneck/32/22716_2.png) [@Anton\_Hinneck](https://discourse.julialang.org/u/Anton_Hinneck)\
**Post date:** [December 12, 2017, 5:31pm UTC](https://discourse.julialang.org/t/jump-ipopt-ecos-errormsg-no-method-matching-setvartype/7705/4 "2017-12-12T17:31:08Z")

</div>

Thanks for your answer. I updated both posts.
