Please help me with this assignment:

It is December 2023, and you are doing vacation work at Roofers SA PTY Limited, a South African industry specialising in the manufacturing of roof tiles. You have been assigned to optimise the production of their black ceramic roof tile product on one of their production lines. This product is sold in batches of 13 tiles, covering one square meter and weighing 48 kg.

Roofers SA can operate either a normal, 8-hour shift or an extended, 12-hour shift for a month at a time. An 8-hour shift costs R100 000 per month and can produce up to 6 000 batches per month. A 12-hour shift costs R150 000 per month and can produce up to 8 000 batches per month. The company can also choose not to produce any black ceramic tiles for a month, in which case there is no shift cost. (If the production line is not used for this product, it can be used by other teams to manufacture other products.) Raw materials for one batch cost R0.50. If production exceeds 7 000, an additional team needs to be deployed to help out at an additional cost of R30 000. If the company produces anything in a particular month, it must produce at least 2 000 batches.

Changing from an 8-hour shift in one month to a 12-hour shift in the next month costs an additional 000 in setup costs. Changing from a month where there was no production to a month where there is production incurs an additional R25 000 setup cost extra cost is incurred in changing from a 12-hour shift in one month to an 8-hour shift in the next month or changing from a month of production to no production in the following month. Currently, the production line for this product is operating a normal shift.

Holding stock is risky because it can get stolen and costs R2 per batch per month. Assume the cost of inventory for any particular month is related to the amount in stock at the end of that month. There are currently 850 batches in stock, and the inventory cost for the current stock does not need to be taken into consideration at the start of month 1. The amount in stock at the end of month 12 should be at least 3,000 units. The demand for the company’s product in each of the next 12 months is forecast to be as shown below:

Month 1: Demand is = 8 000

Month 2: Demand is = 6 500

Month 3: Demand is = 6 500

Month 4: Demand is = 2 100

Month 5: Demand is = 3 500

Month 6: Demand is = 6 500

Month 7: Demand is = 2 000

Month 8: Demand is = 6 800

Month 9: Demand is = 8 300

Month 10: Demand is = 8 000

Month 11: Demand is = 8 000

Month 12: Demand is = 2 000

Here is my attempt at modelling:

# Define variables

var x{1…12} integer >= 0; # Number of batches produced in each month

var y binary; # 1 if an 8-hour shift is used in a month, 0 otherwise

var z binary; # 1 if a 12-hour shift is used in a month, 0 otherwise

var s binary; # 1 if no production is carried out in a month, 0 otherwise

var d{1…12} integer >= 0; # Demand for each month

var totalcost : integer;

# Define constraints

subject to capacity {i in 1…12}: x[i] <= (6000*y + 8000*z); # Total number of batches produced in a month cannot exceed the maximum capacity of the production line

subject to team {i in 1…12}: x[i] <= 7000*(1-z) + (7000+3000*s)*(z); # If production exceeds 7000 batches per month, an additional team needs to be deployed at an additional cost of R30 000

subject to minimum {i in 1…12}: x[i] >= d[i]*(y+z+s); # The total number of batches produced in a month must be at least equal to the demand for that month

subject to stock {i in 1…11}: sum{j in 1…i} x[j] + 850 - sum{j in i+1…12} x[j] >= 3000; # The amount in stock at the end of month 12 should be at least 3000 units

# Define objective function

minimize cost: totalcost;

data;

param d :=

1 8000

2 6500

3 6500

4 2100

5 3500

6 6500

7 2000

8 6800

9 8300

10 8000

11 8000

12 2000;

# Calculate the objective function incrementally

let {

totalcost := sum (100000*y + 150000*z + (x[1]+850)*2)) 12;*z + (x[i]+850)

}

for {i in 2…12} {

let {

totalcost := (100000y + 150000

*2) + (15000*abs(y-y[i-1]) + 25000

*s*abs(z-z[i-1]) + (25000+25000*s)*abs(s-s[i-1]));

}

}

# Solve the model

option solver cplex;

solve;

# Display results

printf “Production schedule:\n”;

for {i in 1…12}

{

printf “Month %d: %d batches\n”, i, round(x[i]);

}

printf “Shift schedule:\n”;

printf “8-hour shift: %d months\n”, round(y);

printf “12-hour shift: %d months\n”, round(z);

printf “No production: %d months\n”, round(s);

printf “Total Cost: %d\n”, round(total_cost);