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

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:

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

or

    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:

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

or

    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:

    @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, as well.

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

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, please update both posts with links to the other to avoid duplicate effort in answering.

Thanks for your answer. I updated both posts.