Could not solve optimization problem with max/min in constraints

@VPBML, as @zdenek_hurak explains, your problem just doesn’t make much sense. You have 6 variables, seven constraints, and there is a single solution with every variable = 2 except yA = 1.

If you relax some of the constraints like yA == 1 to be fixed variable bounds, we can get a solution:

using JuMP, Ipopt
model = Model(Ipopt.Optimizer);
# set_silent(model)
@variable(model, ir1, start = 3.0)
@variable(model, ir2, start = 3.0)
@variable(model, ir3, start = 3.0)
@variable(model, SP, start = 5.0)
@variable(model, yA, start = 1.0)
@variable(model, yF, start = 2.0)
@constraint(model, ir2 == min(ir1, yA*SP))
@constraint(model, ir2 == yF)
@constraint(model, ir3 == max(ir1, yF))
@constraint(model, ir3 == yA*SP)
fix(yA, 1.0)
fix(yF, 2.0)
@constraint(model, SP*yA == yF)
optimize!(model)

Nope. We use the non-smooth formulation z = min(x, y) directly.

2 Likes