diff --git a/docs/src/tutorials/linear/tips_and_tricks.jl b/docs/src/tutorials/linear/tips_and_tricks.jl index 6a34550a348..c0bcc0d4714 100644 --- a/docs/src/tutorials/linear/tips_and_tricks.jl +++ b/docs/src/tutorials/linear/tips_and_tricks.jl @@ -209,7 +209,7 @@ model = Model(); # **Example** Either $x_1 \leq 1$ or $x_2 \leq 2$. model = Model(); -@variable(model, x[1:2]) +@variable(model, 0 <= x[1:2] <= 10) @variable(model, y[1:2], Bin) M = 100 @constraint(model, x[1] <= 1 + M * y[1]) @@ -260,7 +260,7 @@ model = Model(); # **Example** $x_1 + x_2 \leq 1$ if $z = 1$. model = Model(); -@variable(model, x[1:2]) +@variable(model, 0 <= x[1:2] <= 10) @variable(model, z, Bin) M = 100 @constraint(model, sum(x) <= 1 + M * (1 - z)) @@ -268,7 +268,7 @@ M = 100 # **Example** $x_1 + x_2 \leq 1$ if $z = 0$. model = Model(); -@variable(model, x[1:2]) +@variable(model, 0 <= x[1:2] <= 10) @variable(model, z, Bin) M = 100 @constraint(model, sum(x) <= 1 + M * z)