diff --git a/docs/src/manual/variables.md b/docs/src/manual/variables.md index 5e788d79851..0f30e28f8fa 100644 --- a/docs/src/manual/variables.md +++ b/docs/src/manual/variables.md @@ -239,6 +239,7 @@ julia> unfix(x) julia> is_fixed(x) false ``` + Fixing a variable with existing bounds will throw an error. To delete the bounds prior to fixing, use `fix(variable, value; force = true)`. @@ -256,6 +257,10 @@ julia> fix_value(x) 2.0 ``` +!!! tip + Use [`fix`](@ref) instead of `@constraint(model, x == 2)`. The former modifies + variable bounds, while the latter adds a new linear constraint to the problem. + ## Variable names The name, i.e. the value of the `MOI.VariableName` attribute, of a variable can