5.1 Some Examples

The five following examples are modeled in logic0 in the modeling language LPL.

Example 1: We would like to decide whether a particular depot should be built or not. The decision to build or not to build can be modeled by a binary variable δ: δ = 1 mean “to build an depot” and δ = 0 mean‘s “not to build the depot”. Now this depends on whether there is a quantity z > 0 delivered from this depot. This means: “if there is a certain quantity delivered from a depot then the depot should be built, that is, supposing the upper bound of z is M > 0 (see rule 50a):

z >  0 → δ = 1   istranslatedto  z ≤  M δ

If equivalence is required, then

                                 {
z >  0 ↔ δ = 1   istranslatedto     z ≤ M  δ
                                   z ≥ ϵδ;

Example 2: Model the following statement: “If a product is manufactured at all then there is an additional setup (or fixed) cost.” Suppose that z 0 represents the quantity of a product manufactured at a marginal cost per unit of c1. If the product is manufactured at all there is a additional unique setup cost of c2. Hence, two cases need to be distinguished:

  1. Either nothing is manufactured, then z = 0 and total cost = 0.

  2. Or something is manufactured, then z > 0 and total cost = c1z + c2

To model this situation, a Boolean (indicator) variable δ is introduced which is true if “something is manufactured” (z > 0), if nothing is manufactured the δ is false. Now the indicator variable can be linked with the quantity z by the implication (meaning “if the quantity z is strictly larger than 0 then something is manufactured”):

                     --
z > 0 →  δ    or     δ → z ≤  0

Applying rule 50a gives the linear constraint: z U(z) δ

The cost function is formulated as: cost = c1z + c2δ

To verify the resulting model, the values of δ are checked:

(1) if δ = 1 (true) then one has: z U(z) , cost = c1z + c2

(2) If δ = 0 (false) then one has: z 0 , cost = 0

In this case in LPL it is even not needed to introduce a binary variable. The constraint can be formulated as:

c1z + c2(z >  0)

The z > 0 is automatically replaced by an additional binary variable.

Example 3: Two quantities must be link logically. For example: “If product A is included in the blend then also at least a quantity b of product B must be included”. That is: zA > 0 zB b

To model this situation, an indicator variable δ is introduced with the meaning “A is included in the blend” that is: zA > 0 δ. And the requirement “if product A is included in blend then also at least b of product B must be included” can be modeled as: δ zB b

The two constraints can be translated to mathematical inequalities by applying the two Rules 51a and 53a, giving:

zA ≤   U(zA ) ⋅ δ
zB ≥   L(zB + b) ⋅ δ

To verify the resulting model, check for the values of δ:

(1) If δ = 1 (true) then zA U(zA) , zB b  (supposingL(zB) = 0)

(2) If δ = 0 (false) then ZA 0 , zB 0

Example 4: A constraint A must hold if and only if the indicator variable is true. For example: 2v + 3w 1 δ. Hence they are:

2v + 3w  ≤ 1 →  δ     δ → 2v + 3w  ≤ 1

Applying two rules, one gets (supposing L(v) = L(w) = 0 , U(v) = U(w) = 1 , ϵ = 0.001):

2v + 3w + 4δ ≤ 5   ,  2v + 3w +  1.001 δ ≥ 1.001

Example 5: Model the following constraint, supposing L(x) = L(y) = 0, U(x) = U(y) = 10, and ϵ = 0.0001:

3x + 4y ≤  5 ∨  2x + 3y ≥ 4  ↔  x + 2y ≥  3 ∨  2x + 4y ≤ 5

The details are given in the text logic0. Note that these examples are from [7] and [6].