© 2013 OptiRisk India (P) Ltd, All rights reserved
Bala. Padmakumar
Director & CEO
OptiRisk India
Ph: +91 98406 18472/ +91 44 4501 8472
Web: http://www.optiriskindia.com
Email : optimize@optiriskindia.com
2© 2013 OptiRisk India (P) Ltd, All rights reserved
XYZ Chemical Ltd manufactures three chemicals, namely CH-A, CH-B, and CH-C. All
three chemicals have to go through three processes namely MIXING, CONVERSION,
and BAGGING. Each process has finite daily capacity, which are given in the below
table. Each chemical requires different processing time, which are also given in the below
table.
Process
Production minutes per Kg of
product
Capacity of
production in
minutes per dayCH-A CH-B CH-C
MIXING
CONVERSION
BAGGING
2
3
1
2
1
4
1
1
0
400
450
390
Contribution /Kg Rs. 30 Rs. 55 Rs. 23
The company can sell whatever it produces (there is no constraint on demand). The
company’s management wants to find out how much of each chemical it should produce
to maximize the contribution (profit).
3© 2013 OptiRisk India (P) Ltd, All rights reserved
Decision Variables:
= Number of Kgs of chemical p produced each day. p = 1, …, P
= Number of minutes per day available at process s.
ConstraintsConstraints
px
Constraints:
sC
= Number of minutes required by product p at production stage s. s = 1, …, S
 
= Profit per unit of product p
Parameters:
psa ,
pv
Objective Function:
z = Maximize total daily profit
4© 2013 OptiRisk India (P) Ltd, All rights reserved
∑=
P
p
pp xv
1
∑=
≤
P
p
spps Cxa
1
,
0≥px for p = 1, …, P=Max num of products
for s = 1, …, S=Max num of processes
Subject to:
Maximize z =
Objective function
Maximize total contribution (profit)
Constraint
Process Capacity
Constraints
Non negativity
Constraint
Production quantity
must be non negative
5© 2013 OptiRisk India (P) Ltd, All rights reserved
Subject to:
Maximize z =
Objective function
Maximize total contribution(profit)
Constraint
Process Capacity
Constraints
Non negativity
Constraint
Production quantity
must be non negative
321 22 xxx ++
3213 xxx ++
21 4xx +
0,0,0 321 ≥≥≥ xxx
321 235530 xxx ++
≤ 400
≤ 450
≤ 390
Objective function
Maximize Contribution
6© 2013 OptiRisk India (P) Ltd, All rights reserved
/*********************************************
* OPL 12.5 Model
* Author: OptiRisk
* Creation Date: 27-Aug-2013 at 10:02:32 AM
*********************************************/
// Input - indices
{string} Chemicals = ...;
{string} Processes = ...;
// Input parameters
float Capacity[Processes] = ...;
float ProcessTime[Chemicals][Processes] = ...;
float Contribution[Chemicals] = ...;
// Decision Variable
// Production Quantity of each Chemical
dvar float+ ChemicalQty[Chemicals];
// Objective Function
// Maximize total contribution
maximize
sum( p in Chemicals )
Contribution[p] * ChemicalQty[p];
Input Parameters
Decision Variables
Post Processing
Print Results
Constraint
Capacity Constraint
// Constraints
// 1. Capacity Constraints
subject to {
forall( s in Processes )
ctCapacity:
sum( p in Chemicals )
ProcessTime[p][s] * ChemicalQty[p] <= Capacity[s];
}
// Post processing to print results.
execute {
writeln("Maximum Contribution Possible = Rs. ",
cplex.getObjValue());
writeln("n----- RESULT: Optimal Product Mix---------");
// Print the optimal product quantities.
for( var p in Chemicals){
writeln(p, " ---> ", ChemicalQty[p], " Kgs");
}
writeln("n---- END: Optimal Product Mix-------------");
}
7© 2013 OptiRisk India (P) Ltd, All rights reserved
Input Data
Parameters
Index
/*********************************************
* OPL 12.5 Data
* Author: OptiRisk
* Creation Date: 27-Aug-2013 at 10:02:32 AM
*********************************************/
Chemicals = {"CH-A","CH-B","CH-C"};
Processes = {"MIXING", "CONVERSION", "BAGGING"};
// Capacity in minutes of each process
Capacity = [400, 450, 390];
// Processing time for each chemical, for every process
ProcessTime = [[2,3,1],[2,1,4],[1,1,0]];
// Contribution (profit) for each chemical
Contribution = [30, 55, 23];
8© 2013 OptiRisk India (P) Ltd, All rights reserved
9© 2013 OptiRisk India (P) Ltd, All rights reserved
// solution (optimal) with objective 10077.5
Maximum Contribution Possible = Rs. 10077.5
----------- RESULT: Optimal Product Mix---------
CH-A ---> 0 Kgs
CH-B ---> 97.5 Kgs
CH-C ---> 205 Kgs
----------- END: Optimal Product Mix-------------
// solution (optimal) with objective 10077.5
Maximum Contribution Possible = Rs. 10077.5
----------- RESULT: Optimal Product Mix---------
CH-A ---> 0 Kgs
CH-B ---> 97.5 Kgs
CH-C ---> 205 Kgs
----------- END: Optimal Product Mix-------------
10© 2013 OptiRisk India (P) Ltd, All rights reserved
Model Code
ResultsDebug
Project Explorer
Asia Pacific, Africa, Australia &
Middle East:
Europe & America:
No 12, 25th Cross Street
Thiruvalluvar Nagar ,
Thiruvanmiyur,
Chennai –600041, India
OptiRisk R&D House,
One Oxford, Uxbridge,
Middlesex, UB9 4DA,
United Kingdom
Bala. Padmakumar
Ph: +91 98406 18472 / +91 44 4501 8472
Email: optimize@optiriskindia.com
Web: http://www.optiriskindia.com/
11© 2013 OptiRisk India (P) Ltd, All rights reserved
Development Center: Corporate Head Quarters:
No 1/4 ,
Justice Dwarkanath Road,
Kolkata - 700020,
India.

Product Mix Optimization Case Study - OPL/ CPLEX Code

  • 1.
    © 2013 OptiRiskIndia (P) Ltd, All rights reserved Bala. Padmakumar Director & CEO OptiRisk India Ph: +91 98406 18472/ +91 44 4501 8472 Web: http://www.optiriskindia.com Email : optimize@optiriskindia.com
  • 2.
    2© 2013 OptiRiskIndia (P) Ltd, All rights reserved XYZ Chemical Ltd manufactures three chemicals, namely CH-A, CH-B, and CH-C. All three chemicals have to go through three processes namely MIXING, CONVERSION, and BAGGING. Each process has finite daily capacity, which are given in the below table. Each chemical requires different processing time, which are also given in the below table. Process Production minutes per Kg of product Capacity of production in minutes per dayCH-A CH-B CH-C MIXING CONVERSION BAGGING 2 3 1 2 1 4 1 1 0 400 450 390 Contribution /Kg Rs. 30 Rs. 55 Rs. 23 The company can sell whatever it produces (there is no constraint on demand). The company’s management wants to find out how much of each chemical it should produce to maximize the contribution (profit).
  • 3.
    3© 2013 OptiRiskIndia (P) Ltd, All rights reserved Decision Variables: = Number of Kgs of chemical p produced each day. p = 1, …, P = Number of minutes per day available at process s. ConstraintsConstraints px Constraints: sC = Number of minutes required by product p at production stage s. s = 1, …, S   = Profit per unit of product p Parameters: psa , pv Objective Function: z = Maximize total daily profit
  • 4.
    4© 2013 OptiRiskIndia (P) Ltd, All rights reserved ∑= P p pp xv 1 ∑= ≤ P p spps Cxa 1 , 0≥px for p = 1, …, P=Max num of products for s = 1, …, S=Max num of processes Subject to: Maximize z = Objective function Maximize total contribution (profit) Constraint Process Capacity Constraints Non negativity Constraint Production quantity must be non negative
  • 5.
    5© 2013 OptiRiskIndia (P) Ltd, All rights reserved Subject to: Maximize z = Objective function Maximize total contribution(profit) Constraint Process Capacity Constraints Non negativity Constraint Production quantity must be non negative 321 22 xxx ++ 3213 xxx ++ 21 4xx + 0,0,0 321 ≥≥≥ xxx 321 235530 xxx ++ ≤ 400 ≤ 450 ≤ 390
  • 6.
    Objective function Maximize Contribution 6©2013 OptiRisk India (P) Ltd, All rights reserved /********************************************* * OPL 12.5 Model * Author: OptiRisk * Creation Date: 27-Aug-2013 at 10:02:32 AM *********************************************/ // Input - indices {string} Chemicals = ...; {string} Processes = ...; // Input parameters float Capacity[Processes] = ...; float ProcessTime[Chemicals][Processes] = ...; float Contribution[Chemicals] = ...; // Decision Variable // Production Quantity of each Chemical dvar float+ ChemicalQty[Chemicals]; // Objective Function // Maximize total contribution maximize sum( p in Chemicals ) Contribution[p] * ChemicalQty[p]; Input Parameters Decision Variables
  • 7.
    Post Processing Print Results Constraint CapacityConstraint // Constraints // 1. Capacity Constraints subject to { forall( s in Processes ) ctCapacity: sum( p in Chemicals ) ProcessTime[p][s] * ChemicalQty[p] <= Capacity[s]; } // Post processing to print results. execute { writeln("Maximum Contribution Possible = Rs. ", cplex.getObjValue()); writeln("n----- RESULT: Optimal Product Mix---------"); // Print the optimal product quantities. for( var p in Chemicals){ writeln(p, " ---> ", ChemicalQty[p], " Kgs"); } writeln("n---- END: Optimal Product Mix-------------"); } 7© 2013 OptiRisk India (P) Ltd, All rights reserved
  • 8.
    Input Data Parameters Index /********************************************* * OPL12.5 Data * Author: OptiRisk * Creation Date: 27-Aug-2013 at 10:02:32 AM *********************************************/ Chemicals = {"CH-A","CH-B","CH-C"}; Processes = {"MIXING", "CONVERSION", "BAGGING"}; // Capacity in minutes of each process Capacity = [400, 450, 390]; // Processing time for each chemical, for every process ProcessTime = [[2,3,1],[2,1,4],[1,1,0]]; // Contribution (profit) for each chemical Contribution = [30, 55, 23]; 8© 2013 OptiRisk India (P) Ltd, All rights reserved
  • 9.
    9© 2013 OptiRiskIndia (P) Ltd, All rights reserved // solution (optimal) with objective 10077.5 Maximum Contribution Possible = Rs. 10077.5 ----------- RESULT: Optimal Product Mix--------- CH-A ---> 0 Kgs CH-B ---> 97.5 Kgs CH-C ---> 205 Kgs ----------- END: Optimal Product Mix------------- // solution (optimal) with objective 10077.5 Maximum Contribution Possible = Rs. 10077.5 ----------- RESULT: Optimal Product Mix--------- CH-A ---> 0 Kgs CH-B ---> 97.5 Kgs CH-C ---> 205 Kgs ----------- END: Optimal Product Mix-------------
  • 10.
    10© 2013 OptiRiskIndia (P) Ltd, All rights reserved Model Code ResultsDebug Project Explorer
  • 11.
    Asia Pacific, Africa,Australia & Middle East: Europe & America: No 12, 25th Cross Street Thiruvalluvar Nagar , Thiruvanmiyur, Chennai –600041, India OptiRisk R&D House, One Oxford, Uxbridge, Middlesex, UB9 4DA, United Kingdom Bala. Padmakumar Ph: +91 98406 18472 / +91 44 4501 8472 Email: optimize@optiriskindia.com Web: http://www.optiriskindia.com/ 11© 2013 OptiRisk India (P) Ltd, All rights reserved Development Center: Corporate Head Quarters: No 1/4 , Justice Dwarkanath Road, Kolkata - 700020, India.

Editor's Notes

  • #2 Add this  Conference on “ Warehousing &amp; Cold Chain Infrastructure” 28 June 2013, Hotel Hilton, Chennai