Infeasibilities with economic dispatch model

If I print your energy balance constraint:

julia> cEnergyBalance
2-dimensional DenseAxisArray{ConstraintRef{Model, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}, ScalarShape},2,...} with index sets:
    Dimension 1, [1, 2, 3]
    Dimension 2, [1, 2]
And data, a 3×2 Matrix{ConstraintRef{Model, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}, ScalarShape}}:
 cEnergyBalance[1,1] : -vFLOW[1,1] = 100.0  cEnergyBalance[1,2] : vFLOW[1,1] = 150.0
 cEnergyBalance[2,1] : -vFLOW[2,1] = 150.0  cEnergyBalance[2,2] : vFLOW[2,1] = 165.0
 cEnergyBalance[3,1] : -vFLOW[3,1] = 80.0   cEnergyBalance[3,2] : vFLOW[3,1] = 170.0

cEnergyBalance[1,1] says that vFLOW[1,1] has to be -100, but cEnergyBalance[1,2] says that vFLOW[1,1] has to be 150.0. They can’t both be true, so that’s the source of your infeasibility.

I suggest you take another look at your formulation.

1 Like