In the 0.19 documentation on this page it says:
Most often, modifications involve changing the “right-hand side” of a linear constraint. This presents a challenge for JuMP because it leads to ambiguities. For example, what is the right-hand side term of
@constraint(model, 2x + 1 <= x - 3)? This applies more generally to any constant term in a function appearing in the objective or a constraint.
To avoid these ambiguities, JuMP includes the ability to fix variables to a value using the
fixfunction. Fixing a variable sets its lower and upper bound to the same value. Thus, changes in a constant term can be simulated by adding a dummy variable and fixing it to different values. Here is an example:
julia> @variable(model, const_term) const_term julia> @constraint(model, con, 2x <= const_term) con : 2 x - const_term <= 0.0 julia> fix(const_term, 1.0)
const_termis fixed, it is still a decision variable. Thus,
const_term * xis bilinear. Fixed variables are not replaced with constants when communicating the problem to a solver.
In my problem I have vector constraints like
const_term * x and I would like to repeatedly solve for different values of
The program is linear for any fixed value of
const_term and (as stated above), if I try to use
const_term the program is recognized as quadratic/bilinear by Gurobi, which leads to problems.
What is a good workaround for solving a repeatedly parameterized problem in JuMP where the coefficients in the constraints change?