The production planning problem

Describes a linear programming problem.

Consider a Belgian company Volsay, which specializes in producing ammoniac gas (NH3) and ammonium chloride (NH4Cl). Volsay has at its disposal 50 units of nitrogen (N), 180 units of hydrogen (H), and 40 units of chlorine (Cl). The company makes a profit of 40 Euros for each sale of an ammoniac gas unit and 50 Euros for each sale of an ammonium chloride unit. Volsay would like a production plan maximizing its profits given its available stocks.

The following OPL statement formalizes this problem.

A simple production problem (volsay.mod)

dvar float+ Gas;
dvar float+ Chloride;


maximize
  40 * Gas + 50 * Chloride;
subject to {
  ctMaxTotal:     
    Gas + Chloride <= 50;
  ctMaxTotal2:    
    3 * Gas + 4 * Chloride <= 180;
  ctMaxChloride:  
    Chloride <= 40;
}

This statement declares two real decision variables, gas and chloride, representing the production of ammoniac gas and ammonium chloride. These variables are of type float. The objective function

maximize
  40 * Gas + 50 * Chloride;

states that the profit must be maximized. The constraints ensure that the production plan does not exceed the available stocks of nitrogen, hydrogen, and chlorine, respectively. The constraint gas + chloride <= 50 represents the capacity constraint for nitrogen, since each unit of ammoniac gas and of ammonium chloride uses one unit of nitrogen. The next two constraints, for hydrogen and chlorine respectively, are similar in nature. As mentioned at the beginning of this section, a solution to an optimization problem is typically an assignment of values to the variables that satisfies the constraints and optimizes the objective function.

Note that in A simple production problem (volsay.mod), the constraints are identified with so-called “labels”. It is recommended to label constraints in a model. See Constraints in the Language Reference Manual for details.

A solution to volsay.mod

For the Volsay production-planning problem, OPL returns the optimal solution


Final Solution with objective 2300.0000:
  gas = 20.0000;
  chloride = 30.0000;