Juniper.jl icon indicating copy to clipboard operation
Juniper.jl copied to clipboard

Use a custom linear relaxation for fpump

Open this-josh opened this issue 3 years ago • 1 comments

Implementation of #254

this-josh avatar Nov 15 '22 11:11 this-josh

@Wikunia here is the implementation I have, as mentioned in #255 I'm not convinced it it a good approach. It works as such:

       # build MINLP
        _nl_solver = optimizer_with_attributes(Ipopt.Optimizer, "print_level" => 0)

        juniper_opt = optimizer_with_attributes(Juniper.Optimizer, "nl_solver" => _nl_solver, "mip_solver" => HiGHS.Optimizer)
        model = Model(juniper_opt)
        @variable(model, a, integer=true)
        @constraint(model, 0<=model[:a] <= 10)
        @NLconstraint(model, model[:a] * abs(model[:a]) >=3)
        @objective(model, Min, model[:a])
        juniper_opt = optimizer_with_attributes(Juniper.Optimizer, "nl_solver" => _nl_solver, "mip_solver" => HiGHS.Optimizer, "time_limit"=>64)
    
        # build MILP
        mip = Model(juniper_opt)
        @variable(mip, a, integer=true)
        @constraint(mip, mip[:a] * mip[:a] ==0)
        @constraint(mip, mip[:a] <= 10)
        @objective(mip, Min, mip[:a])
        set_silent(mip)
        set_optimizer_attribute(model, "mip_model", mip)

        optimize!(mip)
        # set the MINLP to have the MILP model
        set_optimizer_attribute(model, "mip_model", mip)
        optimize!(model)

Note six test_linear_transform tests are failing but they are also failing on main.

this-josh avatar Nov 15 '22 11:11 this-josh