Demystify non-linear optimization: Episode 2

Options
edited January 2023

Episode 2: Changeover optimization

In Episode 1, we discussed how to configure optimizer to evaluate IF-THEN logic and multiplication of two binary variables. In this episode, we will be discussing how to solve a changeover issue for the beverage manufacturer. Changeover on a production line happens when the production switches from one product to another product. In some cases, it can also be defined as a production switch from one type of product to another type of product. In order to solve this, we will be using the binary variable assignment used in

Episode 1 and a new technique of multiplication of a binary variable with a continuous variable. We will also be exploring turning on or off constraints based on conditions.

The beverage manufacturer produces three products Orangy, Appy, and Grapy across their two production lines. Their requirement has evolved, and they want to achieve production schedule by day and shift. They have production five days in the week, Monday to Friday. On each day, they can run a maximum of two shifts. Each shift typically has a maximum of 8 hours of run time including any time for changeovers. Any changeover in Line A takes 30 minutes while Line B takes 60 minutes. In each shift, only one product can be produced. Production needs to be in sequence; i.e., there can’t be any skipping of days or shifts. However, if there is not enough demand, production can be run for less than a week.

Their objective is to have minimum unsatisfied demand by product while also having minimum changeover downtime possible.

Analysis and solution outline

The basic variables we need to solve this are similar to the ones used in Episode 1: production quantity, production hours, and unmet demand. However, production quantity and hours need to have the dimensions of product, lines, days, and shifts. Two lists to be created: days and shifts. The list days should have days from Monday to Friday and the list shifts have two items: shift 1 and shift 2. Based on the production quantity, we need to determine the production schedule in binary form.

The tricky bit in this problem statement is to find out when the changeover occurs. In order to find a changeover, we need to identify when production is changing from one product to another. The first step to do this is to subtract the schedule in the previous shift from the current shift schedule. By doing this, we will get a variable that ranges from -1 to 1. For example: in Line A and Monday-Shift 1, Orangy is produced and Monday-Shift 2, Appy is produced. If we do the subtraction of the schedule variable, we will get 1 against Shift 2 for Appy and -1 for Shift 2 for Orangy. However, we need to get rid of the -1 as it is not a changeover. In order to do this, we need to multiply the schedule with this intermediate changeover variable.

(Note: Changeover on Monday-Shift 1; i.e.; the first shift is always 0)

 Schedule Mon – Shift 1 Mon – Shift 2 Orangy 1 Appy 1

 Intermediate Changeover Mon – Shift 1 Mon – Shift 2 Orangy -1 Appy 1

 Schedule * Intermediate Changeover Mon – Shift 1 Mon – Shift 2 Orangy Appy 1

In order to calculate intermediate changeover, we need a system module that holds which day and shift are previous to the current day and shift. The schedule variable can be determined using the logic used in Episode 1.

The intermediate changeover variable can be determined as: Intermediate Changeover – (Schedule – Schedule [Lookup: Previous Day, Lookup: Previous Shift]) = 0

In order to calculate the Schedule * Intermediate Changeover (Z), we need to use the technique of multiplying the binary variable (X) with a continuous variable (Y). If the continuous variable Y is bounded by A and B, then the formulation would be:

1. Z – AX >= 0
2. Z – BX <= 0
3. Z – Y – BX >= -B
4. Z – Y – AX <= -A
5. Z – Y + BX <= B

For simplicity, store values of A and B in a system module and use it in the construct above.

All the above variables have dimensions of product, line, day, and shift. Changeover time is evaluated at a line level by day and shift. As the next step, evaluate the variable Changeover by adding the variable Schedule * Intermediate Changeover. Changeover time is evaluated by multiplying the changeover variable with the changeover time input by line. Finally, add the production time and changeover time to find the total time used in a shift and constrain the same by the capacity of the line-day-shift.

As there is no previous shift for Monday-Shift 1, we do not want it changeover to get evaluated on that day and shift. You can do that by using an OR condition in the constraint. The first part of OR can only have inputs but no variables. You can have multiple OR conditions but only one of them can be dependent on variables. An example can be: ISBLANK('SYS03: Day Shift Properties'.Previous Day) OR <<Rest of the constraint>>

The final thing is to ensure that the production happens sequentially. In order to do this, we will use the schedule variable and the system settings of the previous day and shift. An example can be: ISBLANK('SYS03: Day Shift Properties'.Previous Day) OR 'V04: Schedule'[LOOKUP: 'SYS03: Day Shift Properties'.Previous Day, LOOKUP: 'SYS03: Day Shift Properties'.Previous Shift] - 'V04: Schedule' >= 0

Tagged: