Anda di halaman 1dari 223

CHAPTER INDEX

Sr No.
Topic
1
Optimisation & Scheduling of Batch
Process Plants
2
Introduction to Batch Scheduling - 1
3
4

Faculty
Dr. M. S. Rao, Professor, Department
of Chemical Engineering, DDU
Dr. M. S. Rao, Professor, Department
of Chemical Engineering, DDU
Introduction to Batch Scheduling - 2 Dr. M. S. Rao, Professor, Department
of Chemical Engineering, DDU
Overview of Planning and Scheduling Dr. Munawar A. Shaik, Assistant
: Short term Scheduling for Batch
Professor Department of Chemical
Plants Discrete Time Model
Engineering, IIT, Delhi
Short term Scheduling for Batch
Dr. Munawar A. Shaik, Assistant
Plants : Slot based and Global -event Professor Department of Chemical
based Continuous time Models
Engineering, IIT, Delhi
Short term Scheduling for Batch
Dr. Munawar A. Shaik, Assistant
Plants : Unit-Specific Event-based
Professor Department of Chemical
Continuous time Models
Engineering, IIT, Delhi
Short term Scheduling of Continuous Dr. Munawar A. Shaik, Assistant
Plants : Industrial Case Study of
Professor Department of Chemical
FMCG.
Engineering, IIT, Delhi
Cyclic Scheduling of Continuous
Dr. Munawar A. Shaik, Assistant
Plants
Professor Department of Chemical
Engineering, IIT, Delhi
Advance Scheduling of Pulp and
Dr. Munawar A. Shaik, Assistant
Paper Plant
Professor Department of Chemical
Engineering, IIT, Delhi

This is page i
Printer: Opaque this

Optimization and Scheduling of Batch


Process Plants
Dr. M.Srinivasarao
16/06/2010

ii
ABSTRACT This book contains information necessary to introduce concept of optimisation to the biginers. Advanced optimisation techniques necessary for the practicing engineering with a special emphasis of MINLP is
discussed. Discussion on schduling of batch plants and recent advences in
the area of schduling of batch plants are also presented. Dynamic optimisation and global optimisation techniques are also introduced in this book.

This is page iii


Printer: Opaque this

Contents

1 Introduction
1.1 Applications of Optimisation problems .
1.2 Types of Optimization and Optimisation
1.2.1 Static Optimization . . . . . . .
1.2.2 Dynamic Optimization . . . . . .

.
.
.
.

.
.
.
.

1
1
3
3
4

2 Conventional optimisation techniques


2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2 Search Methods . . . . . . . . . . . . . . . . . . . . . . . .
2.2.1 Method of Uniform search . . . . . . . . . . . . . .
2.2.2 Method of Uniform dichotomous search . . . . . .
2.2.3 Method of sequential dichotomos search . . . . . .
2.2.4 Fibonacci search Technique . . . . . . . . . . . . .
2.3 UNCONSTRAINED OPTIMIZATION . . . . . . . . . . .
2.3.1 Golden Search Method . . . . . . . . . . . . . . . .
2.3.2 Quadratic Approximation Method . . . . . . . . .
2.3.3 Steepest Descent Method . . . . . . . . . . . . . .
2.3.4 Newton Method . . . . . . . . . . . . . . . . . . .
2.4 CONSTRAINED OPTIMIZATION . . . . . . . . . . . . .
2.4.1 Lagrange Multiplier Method . . . . . . . . . . . . .
2.4.2 Penalty Function Method . . . . . . . . . . . . . .
2.5 MATLAB BUILT-IN ROUTINES FOR OPTIMIZATION

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

7
7
7
7
9
9
11
12
12
13
15
16
17
17
18
19

. . . . . .
Problems
. . . . . .
. . . . . .

.
.
.
.

.
.
.
.

.
.
.
.

iv

Contents

3 Linear Programming
3.1 The Simplex Method . . . . . . . . . . . . . . . . .
3.2 Infeasible Solution . . . . . . . . . . . . . . . . . .
3.3 Unbounded Solution . . . . . . . . . . . . . . . . .
3.4 Multiple Solutions . . . . . . . . . . . . . . . . . .
3.4.1 Matlab code for Linear Programming (LP)

.
.
.
.
.

21
23
27
29
30
30

4 Nonlinear Programming
4.1 Convex and Concave Functions . . . . . . . . . . . . . . . .

33
36

5 Discrete Optimization
5.1 Tree and Network Representation . . . . . . . . . . . . . . .
5.2 Branch-and-Bound for IP . . . . . . . . . . . . . . . . . . .

39
41
42

6 Integrated Planning and Scheduling of processes


6.1 Introduction . . . . . . . . . . . . . . . . . . . . . .
6.2 Plant optimization hierarchy . . . . . . . . . . . .
6.3 Planning . . . . . . . . . . . . . . . . . . . . . . . .
6.4 Scheduling . . . . . . . . . . . . . . . . . . . . . . .
6.5 Plantwide Management and Optimization . . . . .
6.6 Resent trends in scheduling . . . . . . . . . . . . .

47
47
47
50
51
56
58

6.6.1
6.6.2
6.6.3

.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

State-Task Network (STN): . . . . . . . . . . . . . .


Resource Task Network (RTN): . . . . . . . . . . .
Optimum batch schedules and problem formulations
(MILP),MINLP B&B: . . . . . . . . . . . . . . . . .
Multi-product batch plants: . . . . . . . . . . . . . .
Waste water minimization (Equalization tank super
structure): . . . . . . . . . . . . . . . . . . . . . . . .
Selection of suitable equalization tanks for controlled
ow: . . . . . . . . . . . . . . . . . . . . . . . . . . .

60
62

7 Dynamic Optimization
7.1 Dynamic programming . . . . . . . . . . . . . . . . . . . . .

71
73

8 Global Optimisation Techniques


8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . .

75
75

6.6.4
6.6.5
6.6.6

8.2
8.3

Simulated Annealing . .
8.2.1 Introduction . .
GA . . . . . . . . . . . .
8.3.1 Introduction . .
8.3.2 Denition . . . .
8.3.3 Coding . . . . .
8.3.4 Fitness . . . . . .
8.3.5 Operators in GA

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

63
65
66
68

75
75
77
77
78
78
79
79

Contents

8.4

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

81
81
82
85
86
86
87
87
90
91
95
95

9 A GAMS Tutorial
9.1 Introduction . . . . . . . . . . . . . . . . . . . . . .
9.2 Structure of a GAMS Model . . . . . . . . . . . . .
9.3 Sets . . . . . . . . . . . . . . . . . . . . . . . . . .
9.4 Data . . . . . . . . . . . . . . . . . . . . . . . . . .
9.4.1 Data Entry by Lists . . . . . . . . . . . . .
9.4.2 Data Entry by Tables . . . . . . . . . . . .
9.4.3 Data Entry by Direct Assignment . . . . .
9.5 Variables . . . . . . . . . . . . . . . . . . . . . . .
9.6 Equations . . . . . . . . . . . . . . . . . . . . . . .
9.6.1 Equation Declaration . . . . . . . . . . . .
9.6.2 GAMS Summation (and Product) Notation
9.6.3 Equation Denition . . . . . . . . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

99
99
102
103
105
105
106
107
108
108
109
109
109

Objective Function . . . . . . . . . . . . . . . . . . . . . . .
Model and Solve Statements . . . . . . . . . . . . . . . . . .
Display Statements . . . . . . . . . . . . . . . . . . . . . . .
9.9.1 The .lo, .l, .up, .mDatabase . . . . . . . . . . . . .
9.9.2 Assignment of Variable Bounds and/or Initial Values
9.9.3 Transformation and Display of Optimal Values . . .
9.10 GAMS Output . . . . . . . . . . . . . . . . . . . . . . . . .
9.10.1 Echo Prints . . . . . . . . . . . . . . . . . . . . . . .
9.11 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . .

111
111
112
112
113
113
114
115
116

8.5

Dierential Evolution . . . . . . . . . .
8.4.1 Introduction . . . . . . . . . . .
8.4.2 DE at a Glance . . . . . . . . . .
8.4.3 Applications of DE . . . . . . . .
Interval Mathematics . . . . . . . . . . .
8.5.1 Introduction . . . . . . . . . . .
8.5.2 Interval Analysis . . . . . . . . .
8.5.3 Real examples . . . . . . . . . .
8.5.4 Interval numbers and arithmetic
8.5.5 Global optimization techniques .
8.5.6 Constrained optimization . . . .
8.5.7 References . . . . . . . . . . . . .

9.7
9.8
9.9

A The First Appendix

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

119

vi

Contents

This is page vii


Printer: Opaque this

Preface

Optimization has pervaded all spheres of human endeavor and process industris are not an expection. Impact of optimisation has increased in last
ve decades. Modern society lives not only in an environment of intense
competition but is also constrained to plan its growth in a sustainable
manner with due concern for conservation of resources. Thus, it has become imperative to plan, design, operate, and manage resources and assets
in an optimal manner. Early approaches have been to optimize individual
activities in a standalone manner, however, the current trend is towards an
integrated approach: integrating synthesis and design, design and control,
production planning, scheduling, and control. The functioning of a system
may be governed by multiple performance objectives. Optimization of such
systems will call for special strategies for handling the multiple objectives
to provide solutions closer to the systems requirement.
Optimization theory had evolved initially to provide generic solutions to
optimization problems in linear, nonlinear, unconstrained, and constrained
domains. These optimization problems were often called mathematical programming problems with two distinctive classications, namely linear and
nonlinear programming problems. Although the early generation of programming problems were based on continuous variables, various classes
of assignment and design problems required handling of both integer and
continuous variables leading to mixed integer linear and nonlinear programming problems (MILP and MINLP). The quest to seek global optima
has prompted researchers to develop new optimization approaches which
do not get stuck at a local optimum, a failing of many of the mathematical programming methods. Genetic algorithms derived from biology and

viii

Preface

simulated annealing inspired by optimality of the annealing process are


two such potent methods which have emerged in recent years. The developments in computing technology have placed at the disposal of the user
a wide array of optimization codes with varying degrees of rigor and sophistication. The challenges to the user are manyfold. How to set up an
optimization problem? What is the most suitable optimization method to
use? How to perform sensitivity analysis? An intrepid user may also want
to extend the capabilities of an existing optimization method or integrate
the features of two or more optimization methods to come up with more
e cient optimization methodologies.
Substantial progress was made in the 1950s and 1960s with the development of algorithms and computer codes to solve large mathematical programming problems. The number of applications of these tools in the 1970s
was less then expected, however, because the solution procedures formed
only a small part of the overall modeling eort. A large part of the time
required to develop a model involved data preparation and transformation
and report preparation. Each model required many hours of analyst and
programming time to organize the data and write the programs that would
transform the data into the form required by the mathematical programming optimizers. Furthermore, it was di cult to detect and eliminate errors
because the programs that performed the data operations were only accessible to the specialist who wrote them and not to the analysts in charge of
the project.
GAMS was developed to improve on this situation by: ) Providing a
high-level language for the compact representation of large and complex
models b) Allowing changes to be made in model specications simply
and safely c) Allowing unambiguous statements of algebraic relationships. d)Permitting model descriptions that are independent of solution
algorithms. This learning matrial gives a brief introduction to this programming language by providing an introductory chapter.
Here is a detailed summary of the contents of the course material.
Chapter 1, Introduction chapter introduces the concept of optimisation
to the rst times to this subject. It also discribes various optimisation
techniques and their classication. Various optimisation problems are also
discussed in this chapter.
Chapter 2, Conventional optimisation techniques are presented in this
chapter. Search methods is presented rst followed by discussoin on contrained and unconstrained optimisation techniques.
Chapter 3, This chapter will introduce one of the widely used technique
that is linear programming. A special emphais is given to simplex method
in this chapter.
Chapter 4, A brief review of nonlinear programming is presented in this
chapter.functions of convex and concave functions and concept of convexication is given in this chapter.

Preface

ix

Chapter 5, Discre optimisation which is extremly important from this


course view point is presented in this chapter.Net work representation and
Barnach and Bound methods are discussed in detail with suitable examples
in this chapter.
Chapter 6, Integrated planning and scheduling of the process are presented in this chapter. Resent advances in the area of scheduling and optimisatio with respct to batch process plants is presented in brief.
Chapter 7,Dynamic optimisation as a concept is indroduced in this chapter. Suitable demonstration exples are presented during the course.
Chapter 8, Various global optimisation techniques are introduced here
in this chapter. A special emphais is given to Gnetic algorthms, simulated
annealing and Diarential evaluation. A detailed introduction discussion is
presented on the topic of interval Mathematics.
Capter 9, A tutorial on A GAMS Tutorial presented in the nal chapter
of this book.

Preface

This is page 1
Printer: Opaque this

1
Introduction

Optimization involves nding the minimum/maximum of an objective function f (x) subject to some constraint x b S. If there is no constraint for
x to satisfy or, equivalently, S is the universe then it is called an unconstrained optimization; otherwise, it is a constrained optimization. In this
chapter, we will cover several unconstrained optimization techniques such
as the golden search method, the quadratic approximation method, the
NelderMead method, the steepest descent method, the Newton method,
the simulated-annealing (SA) method, and the genetic algorithm (GA). As
for constrained optimization, we will only introduce the MATLAB built-in
routines together with the routines for unconstrained optimization. Note
that we dont have to distinguish maximization and minimization because
maximizing f (x) is equivalent to minimizing -f (x) and so, without loss of
generality, we deal only with the minimization problems.

1.1 Applications of Optimisation problems


Optimization problems arise in almost all elds where numerical information is processed (science, engineering, mathematics, economics, commerce,
etc.). In science, optimization problems arise in data tting, variational
principles, solution of dierential and integral equations by expansion methods, etc. Engineering applications are in design problems, which usually
have constraints in the sense

1. Introduction

that variables cannot take arbitrary values. For example, while designing a bridge, an engineer will be interested in minimizing the cost, while
maintaining a certain minimum strength for the structure. Optimizing the
surface area for a given volume of a reactor is another example of constrained optimization. While most formulations of optimization problems
require the global minimum to be found, mosi of the methods are only able
to nd a local minimum. A function has a local minimum, at a point where
it assumes the lowest value in a small neighbourhood of the point, which
is not at the boundary of that neighbourhood.
To nd a global minimum we normally try a heuristic approach where
several local minima are found by repeated trials with dierent starting
values or by using dierent techniques. The dierent starting values may
be obtained by perturbing the local minimizers by appropriate amounts.
The smallest of all known local minima is then assumed to be the global
minimum. This procedure is obviously unreliable, since it is impossible to
ensure that all local minima have been found. There is always the possibility that at some unknown local minimum, the function assumes an even
smaller value. Further, there is no way of verifying that the point so obtained is indeed a global minimum, unless the value of the function at the
global minimum is known independently. On the other hand, if a point i
s claimed to be the solution of a system of non-linear equations, then it
can, in principle, be veried by substituting in equations to check whether
all the equations are satised or not. Of course, in practice, the round-o
error introduces some uncertainty, but that can be overcome.
Owing to these reasons, minimization techniques are inherently unreliable and should be avoided if the problem can be reformulated to avoid
optimization. However, there are problems for which no alternative solution method is known and we have to use these techniques. The following
are some examples.
1. Not much can be said about the existence and uniqueness of either
the
2. It is possible that no minimum of either type exists, when the function
is
3. Even if the function is bounded from below, the minimum may not
exist
4. Even if a minimum exists, it may not be unique; for exarnple,Xx) =
sin x global or the local minimum of a function of several variables.
not bounded from below [e.g.,Ax) = XI. [e.g.,Ax) = e"]. has an innite
number of both local and global minima.
5. Further, innite number of local minimum may exist, even when there
is no global minimum [e.g.,Ax) = x + 2 sin x].
6. If the function or its derivative is not continuous, then the situation
could be even more complicated. For example,Ax) = & has a global minimum at x = 0, which is not a local minimum [i.e.,Ax) = 01.

1.2 Types of Optimization and Optimisation Problems

Optimization in chemical process industries infers the selection of equipment and operating conditions for the production of a given material so
that the prot will be maximum. This could be interpreted as meaning
the maximum output of a particular substance for a given capital outlay,
or the minimum investment for a specied production rate. The former
is a mathematical problem of evaluating the appropriate values of a set
of variables to maximize a dependent variable, whereas the latter may be
considered to be one of locating a minimum value. However, in terms of
prot, both types of problems are maximization problems, and the solution of both is generally accomplished by means of an economic balance
(trade-@ between the capital and operating costs. Such a balance can be
represented as shown in Fig.(??), in which the capital, the operating cost,
and the total cost are plotted againstf, which is some function of the size
of the equipment. It could be the actual size of the equipment; the number of pieces of equipment, such as the number of stirred tank reactors in
a reactor battery; the frames in a lter press; some parameter related to
the size of the equipment, such as the reux ratio in a distillation unit; or
the solvent-to-feed ratio in a solvent extraction process. Husain and Gangiah (1976) reported some of the optimization techniques that are used for
chemical engineering applications.

1.2 Types of Optimization and Optimisation


Problems
Optimization in the chemical eld can be divided into two classes:
1. Static optimization
2. Dynamic optimization

1.2.1 Static Optimization


Static optimization is the establishment of the most suitable steady-state
operation conditions of a process. These include the optimum size of equipment and production levels, in addition to temperatures, pressures, and ow
rates. These can be established by setting up the best possible mathematical model of the process, which is maximized by some suitable technique
to give the most favourable operating conditions. These conditions would
be nominal conditions and would not take into account the uctuations in
the process about these nominal conditions.
With steady-state optimization (static Optimization), as its name implies, the process is assumed to be under steady-state conditions, and
may instantaneously be moved to a new steady state, if changes in load
conditions demand so, with the aid of a conventional or an optimization

1. Introduction

computer. Steady-state optimization is applicable to continuous processes,


which attain a new steady state after a change in manipulated inputs within
an acceptable time interval. The goal of static optimization is to develop
and realize an optimum modelfor the process in question.

1.2.2 Dynamic Optimization


Dynamic optimization the establishment of the best procedure for correcting the uctuations in a process used in the static optimization analysis.
It requires knowledge of the dynamic characteristics of the equipment and
also necessitates predicting the best way in which a change in the process
conditions can be corrected. In reality, it is an extension of the automatic
control analysis of a process.
As mentioned earlier, static optimization is applicable to continuous
processes which attain a new steady state after a change in manipulated
inputs within an acceptable time interval. With unsteady-state (dynamic)
optimization, the objective is not only to maintain a process at an optimum
level under steady-state conditions, but also to seek the best path for its
transition from one steady state to another. The optimality function then
becomes a time function, and the objective is to maximize or minimize the
time-averaged performance criterion. Although similar to steadystate optimization in some respects, dynamic optimization is more elaborate because
it involves a time-averaged function rather than individual quantities. The
goal of control in this case is to select at any instant of time a set of manipulated variablesthat will cause the controlled system to behave in an
optimum manner in the face of any set of disturbances.
Optimum behaviour is dened as a set of output variables ensuring the
maximization of a certain objective or return function, or a change in the
output variables over a denite time interval such that a predetermined
functional value of these output variables is maximized or minimized.
As mentioned earlier, the goal of static optimization is to develop and
realize an optimum model for the process in question, whereas dynamic
optimization seeks to develop and realize an optimum control system for
the process. In other words, static optimization is an optimum model for
the process, whereas dynamic optimization is the optimum control system
for the process.
Optimization is categorized into the following ve groups:
1)Analytical methods
(a) Direct search (without constraints)
(b) Lagrangian multipliers (with constraints)
(c) Calculus of variations (examples include the solution of the Euler
equation, optimum temperature conditions for reversible exothermic reactions in plug-ow beds, optimum temperature conditions for chemical reactors in the case of constraints on temperature range, Multilayer adiabatic
reactors, etc.)

1.2 Types of Optimization and Optimisation Problems

(d) Pontryagins maximum principle (automatic control)


2. Mathematical programming:
(a) Geometric programming (algebraic functions)
(b) Linear programming (applications include the manufacture of products for maximum return from dierent raw materials, optimum
utilization of equipment, transportation problems, etc.)
(c) Dynamic programming (multistage processes such as distillation, extraction, absorption, cascade reactors, multistage adiabatic beds, interacting chain of reactors, etc.; Markov processes, etc.)
3. Gradient methods:
(a) Method of steepest descent (ascent)
(b) Sequential simplex method (applications include all forms of problems such as optimization of linear and non-linear functions
with and without linear and non-linear constraints, complex chemical
engineering processes, single and cascaded interacting reactors)
4. Computer control and model adaptation:
5. Statistical optimization: All forms (complex chemical engineering systems)
(a) Regression analysis (non-deterministic systems)
(b) Correlation analysis (experimental optimization and designs: Brandon Though, for completeness, all the methods of optimization are listed
above, let us restrict our discussion to some of the most important and
widely used methods of optimization.
Optimization problems can be divided into the following broad categories depending on the type of decision variables, objective function(s),
and constraints.
Linear programming (LP): The objective function and constraints are
linear. The decision variables involved are scalar and continuous.
Nonlinear programming (NLP): The objective function and/or constraints are nonlinear. The decision variables are scalar and continuous.
Integer programming (IP): The decision variables are scalars and integers.
Mixed integer linear programming (MILP): The objective function and
constraints are linear. The decision variables are scalar; some of them are
integers whereas others are continuous variables.
Mixed integer nonlinear programming (MINLP): A nonlinear programming problem involving integer as well as continuous decision variables.
Discrete optimization: Problems involving discrete (integer) decision
variables. This includes IP, MILP, and MINLPs.
Optimal control: The decision variables are vectors.
Stochastic programming or stochastic optimization: Also termed optimization under uncertainty. In these problems, the objective function
and/or the constraints have uncertain (random) variables. Often involves
the above categories as subcategories.

1. Introduction

Multiobjective optimization: Problems involving more than one objective. Often involves the above categories as subcategories.

This is page 7
Printer: Opaque this

2
Conventional optimisation techniques

2.1 Introduction
In this chapter, we will introduce you some of the very well known conventional optimisation techniques. A very brief review of search methods
followed by gradient based methods are presented. The compilation is no
way exhaustive. Matlab programs for some of the optimisation techniques
are also presented in this chapter.

2.2 Search Methods


Many a times the mathematical model for evaluation of the objective function is not available. To evaluate the value of the objective funciton an
experimental run has to be conducted. Search procedures are used to determine the optimal value of the variable decision variable.

2.2.1 Method of Uniform search


Let us assume that we want to optimise the yield y and only four experiments are allowed due to certain plant conditions. An unimodel function
can be represented as shown in the gure where the peak is at 4.5. This
maximum is what we are going to nd. The question is how close we can
react to this optimum by systematic experimentation.

2. Conventional optimisation techniques

Optimum
Is in this
area
0

FIGURE 2.1. Method of uniform search

10

2.2 Search Methods

The most obvious way is to place the four experiments equidistance over
the interval that is at 2,4,6 and 8. We can see from the gure that the value
at 4 is higher than the value of y at 2. Since we are dealing with a unimodel
function the optimal value can not lie between x=0 and x=2. By similar
reasoning the area between x=8 and 10 can be eleminated as well as that
between 6 and 8. the area remaining is area between 2 and 6.
If we take the original interval as L and the F as fraction of original
interval left after performing N experiments then N experiments devide
the interval into N+1 intervals. Width of each interval is NL+1 OPtimum
can be specied in two of these intervals.That leaves 40% area in the given
example
F

=
=

2L
1
2
=
N +1 L
N +1
2
= 0:4
4+1

2.2.2 Method of Uniform dichotomous search


The experiments are performed in pairs and these pairs are spaced evenly
over the entire intervel. For the problem these pairs are specied as 3.33
and 6.66. From the gure it can be seen that function around 3.33 it can be
observed that the optimum does not lie between 0 and 3.33 and similarly
it does not lie between 6.66 and 10. The total area left is between 3.33 and
6.66. The original region is devided into N2 + 1 intervals of the width NL+1
2
The optimum is location in the width of one interval There fore

=
=

L
1
2
=
N +2
+1 L
2
= 0:33
4+2
N
2

2.2.3 Method of sequential dichotomos search


The sequential search is one where the investigator uses the information
availble from the previous experiments before performing the next experiment. Inour exaple perform the search around the middle of the search
space. From the infromation available discard the region between 5 and 10.
Then perform experiment between 2.5 and discard the region between 0
and 2.5 the region lect out is between 2.5 and 5 only. This way the fraction
left out after each set of experiments become half that of the region left
out. it implies that

10

2. Conventional optimisation techniques

Optimum
Is in this
area
0

10

10

Optimum
Is in this
area
0

2.2 Search Methods

=
=

11

1
N

22
1
= 0:25
22

2.2.4 Fibonacci search Technique


A more e cient sequential search technique is Fibonacci techniquie. The
Fibonacci series is considered as Note that the nuber in the sequence is
sum of previous two numbers.

xn = xn
n
2

+ xn

The series is 1 2 3 5 8 10 ... To perform the search a pair of experiments


are performed equidistance from each end of the interval. The distance d1
is determined from the follwing expression.
d1 =

FN
FN

Where N is number of experiments and L is total length. IN our problem


L is 10, N is 4 and FN 2 is 2 and FN =5 . First two experiments are run 4
units away from each end. From the result the area between 6 and 10 can
be eliminated.
d1 =

2
10 = 4
5

The area remaining is between 0 and 6 the new length will be 6 and new
value of d2 is obtained by substituting N-1 for N
d2 =

FN
FN

3
1

L=

F1
1
L= 6=2
F3
3

The next pair of experiments are performed around 2 and the experiment at 4 need not be performed as we have allready done it. This is the
advantage of Fibonacci search the remaining experiment can be performed
as dicocomos search to identify the optimal reagion around 4. This terns
out to be the region between 4 and 6. The fraction left out is
F =

1
1
1
=
= = 0:2
FN
F4
5

12

2. Conventional optimisation techniques

2.3 UNCONSTRAINED OPTIMIZATION


2.3.1 Golden Search Method
This method is applicable to an unconstrained minimization problem such
that the solution interval [a, b] is known and the objective function f (x) is
unimodal within the interval; that is, the sign of its derivative f (x) changes
at most once in [a, b] so that f (x) decreases/increases monotonically for
[a, xo]/[xo, b], where xo is the solution that we are looking for. The socalled golden search procedure is summarized below and is cast into the
routine opt_gs().We made a MATLAB program nm711.m, which uses
this routine to nd the minimum point of the
objective function
f (x) =

4)2

(x2
8

(2.1)

GOLDEN SEARCH PROCEDURE


Step 1. Pick up the two points
p c = a + (1 - r)h and d = a + rh inside
the interval [a, b], where r = ( 5 - 1)/2 and h = b - a.
Step 2. If the values of f (x) at the two points are almost equal [i.e., f (a)
f (b)] and the width of the interval is su ciently small (i.e., h 0), then
stop the iteration to exit the loop and declare xo = c or xo = d depending
on whether f (c) < f(d) or not. Otherwise, go to Step 3.
Step 3. If f (c) < f(d), let the new upper bound of the interval b to d;
otherwise, let the new lower bound of the interval a to c. Then, go to Step
1.
function [xo,fo] = opt_gs(f,a,b,r,TolX,TolFun,k)
h = b - a; rh = r*h; c = b - rh; d = a + rh;
fc = feval(f,c); fd = feval(f,d);
if k <= 0 j (abs(h) < TolX & abs(fc - fd) < TolFun)
if fc <= fd, xo = c; fo = fc;
else xo = d; fo = fd;
end
if k == 0, fprintf(Just the best in given # of iterations), end
else
if fc < fd, [xo,fo] = opt_gs(f,a,d,r,TolX,TolFun,k - 1);
else [xo,fo] = opt_gs(f,c,b,r,TolX,TolFun,k - 1);
end
end
%nm711.m to perform the golden search method
f711 = inline((x.*x-4).^2/8-1,x);
a = 0; b = 3; r =(sqrt(5)-1)/2; TolX = 1e-4; TolFun = 1e-4;
MaxIter = 100;
[xo,fo] = opt_gs(f711,a,b,r,TolX,TolFun,MaxIter)
Note the following points about the golden search procedure.

2.3 UNCONSTRAINED OPTIMIZATION

13

At every iteration, the new interval width is


b

c=b

(a + (1

r)(b

a)) = rhord

a = a + rh

a = rh

so that it becomes r times the old interval width (b - a = h).


The golden ratio r is xed so that a point c1 = b1 - rh1 = b - r2h in the
new interval [c, b] conforms with d = a + rh = b - (1 - r)h, that is,
r2

r; r2 + r 1 = 0;
p
p
1+ 1+4
1+ 5
=
2
2

(2.2)
(2.3)

2.3.2 Quadratic Approximation Method


The idea of this method is to (a) approximate the objective function f
(x) by a quadratic function p2(x) matching the previous three (estimated
solution) points and (b) keep updating the three points by replacing one
of them with the minimum point of p2(x). More specically, for the three
points
{(x0, f0), (x1, f1), (x2, f2)} with x0 < x1 < x2
we nd the interpolation polynomial p2(x) of degree 2 to t them and
replace one of them with the zero of the derivative that is, the root of p2
(x) = 0 :
x = x3 =

fo x21
2 [o (x1

x22 + f1 x22
x2 ) + f1 (x2

x20 + f2 x20
x0 ) + f2 (x0

x21
x1 )]

(2.4)

In particular, if the previous estimated solution points are equidistant


with an equal distance h (i.e., x2 - x1 = x1 - x0 = h), then this formula
becomes

x = x3 =

fo x21
2 [o (x1

x22 + f1 x22
x2 ) + f1 (x2

x20 + f2 x20
x0 ) + f2 (x0

x21
j x1=x+h
x1 )] x2=x1+h

(2.5)

We keep updating the three points this way until jx2 - x0j
0 and/or
jf (x2) - f (x0)j
0, when we stop the iteration and declare x3 as the
minimum point. The rule for updating the three points is as follows.
1. In case x0 < x3 < x1, we take {x0, x3, x1} or {x3, x1, x2} as the new
set of three points depending on whether f (x3) < f(x1) or not.
2. In case x1 < x3 < x2, we take {x1, x3, x2} or {x0, x1, x3} as the new
set of three points depending on whether f (x3) f (x1) or not.
This procedure, called the quadratic approximation method, is cast into
the MATLAB routine opt_quad(), which has the nested (recursive call)
structure. We made the MATLAB program nm712.m, which uses this

14

2. Conventional optimisation techniques

routine to nd the minimum point of the objective function (7.1.1) and


also uses the MATLAB built-in routine fminbnd() to nd it for crosscheck.
(cf) The MATLAB built-in routine fminbnd()corresponds to fmin()
in the MATLAB of version.5.x.
function [xo,fo] = opt_quad(f,x0,TolX,TolFun,MaxIter)
%search for the minimum of f(x) by quadratic approximation
method
if length(x0) > 2, x012 = x0(1:3);
else
if length(x0) == 2, a = x0(1); b = x0(2);
else a = x0 - 10; b = x0 + 10;
end
x012 = [a (a + b)/2 b];
end
f012 = f(x012);
[xo,fo] = opt_quad0(f,x012,f012,TolX,TolFun,MaxIter);
function [xo,fo] = opt_quad0(f,x012,f012,TolX,TolFun,k)
x0 = x012(1); x1 = x012(2); x2 = x012(3);
f0 = f012(1); f1 = f012(2); f2 = f012(3);
nd = [f0 - f2 f1 - f0 f2 - f1]*[x1*x1 x2*x2 x0*x0; x1 x2 x0];
x3 = nd(1)/2/nd(2); f3 = feval(f,x3); %Eq.(7.1.4)
if k <= 0 j abs(x3 - x1) < TolX j abs(f3 - f1) < TolFun
xo = x3; fo = f3;
if k == 0, fprintf(Just the best in given # of iterations), end
else
if x3 < x1
if f3 < f1, x012 = [x0 x3 x1]; f012 = [f0 f3 f1];
else x012 = [x3 x1 x2]; f012 = [f3 f1 f2];
end
else
if f3 <= f1, x012 = [x1 x3 x2]; f012 = [f1 f3 f2];
else x012 = [x0 x1 x3]; f012 = [f0 f1 f3];
end
end
[xo,fo] = opt_quad0(f,x012,f012,TolX,TolFun,k - 1);
end
%nm712.m to perform the quadratic approximation method
clear, clf
f711 = inline((x.*x - 4).^2/8-1, x);
a = 0; b = 3; TolX = 1e-5; TolFun = 1e-8; MaxIter = 100;
[xoq,foq] = opt_quad(f711,[a b],TolX,TolFun,MaxIter)
%minimum point and its function value
[xob,fob] = fminbnd(f711,a,b) %MATLAB built-in function

2.3 UNCONSTRAINED OPTIMIZATION

15

2.3.3 Steepest Descent Method


This method searches for the minimum of an N-dimensional objective function in the direction of a negative gradient
g(x) =

@f (x) @f (x) @f (x)


::::
@x1 @x2
@xN

rf (x) =

(2.6)

with the step-size k (at iteration k) adjusted so that the function value
is minimized along the direction by a (one-dimensional) line search technique like the quadratic approximation method. The algorithm of the steepest descent method is summarized in the following box and cast into the
MATLAB routine opt_steep().
We made the MATLAB program nm714.m to minimize the objective
function (7.1.6) by using the steepest descent method.
STEEPEST DESCENT ALGORITHM
Step 0. With the iteration number k = 0, nd the function value f0 = f
(x0) for the initial point x0.
Step 1. Increment the iteration number k by one, nd the step-size k 1
along the direction of the negative gradient -gk-1 by a (one-dimensional)
line search like the quadratic approximation method.
k 1

= ArgM in f (xk

gk 1
)
jjgk 1jj

(2.7)

Step 2. Move the approximate minimum by the step-size k-1 along the
direction of the negative gradient -gk-1 to get the next point
xk = xk

1gk

1=jjgk

1jj

Step 3. If xk
xk-1 and f (xk) f (xk-1), then declare xk to be the
minimum and terminate the procedure. Otherwise, go back to step 1.
function [xo,fo] = opt_steep(f,x0,TolX,TolFun,alpha0,MaxIter)
% minimize the ftn f by the steepest descent method.
%input: f = ftn to be given as a string f
% x0 = the initial guess of the solution
%output: x0 = the minimum point reached
% f0 = f(x(0))
if nargin < 6, MaxIter = 100; end %maximum # of iteration
if nargin < 5, alpha0 = 10; end %initial step size
if nargin < 4, TolFun = 1e-8; end %jf(x)j < TolFun wanted
if nargin < 3, TolX = 1e-6; end %jx(k)- x(k - 1)j<TolX wanted
x = x0; fx0 = feval(f,x0); fx = fx0;
alpha = alpha0; kmax1 = 25;
warning = 0; %the # of vain wanderings to nd the optimum
step size

16

2. Conventional optimisation techniques

for k = 1: MaxIter
g = grad(f,x); g = g/norm(g); %gradient as a row vector
alpha = alpha*2; %for trial move in negative gradient direction
fx1 = feval(f,x - alpha*2*g);
for k1 = 1:kmax1 %nd the optimum step size(alpha) by line
search
fx2 = fx1; fx1 = feval(f,x-alpha*g);
if fx0 > fx1+TolFun & fx1 < fx2 - TolFun %fx0 > fx1 < fx2
den = 4*fx1 - 2*fx0 - 2*fx2; num = den - fx0 + fx2; %Eq.(7.1.5)
alpha = alpha*num/den;
x = x - alpha*g; fx = feval(f,x); %Eq.(7.1.9)
break;
else alpha = alpha/2;
end
end
if k1 >= kmax1, warning = warning + 1; %failed to nd optimum step size
else warning = 0;
end
if warning >= 2j(norm(x - x0) < TolX&abs(fx - fx0) < TolFun),
break; end
x0 = x; fx0 = fx;
end
xo = x; fo = fx;
if k == MaxIter, fprintf(Just best in %d iterations,MaxIter),
end
%nm714
f713 = inline(x(1)*(x(1) - 4 - x(2)) + x(2)*(x(2)- 1),x);
x0 = [0 0], TolX = 1e-4; TolFun = 1e-9; alpha0 = 1; MaxIter
= 100;
[xo,fo] = opt_steep(f713,x0,TolX,TolFun,alpha0,MaxIter)

2.3.4 Newton Method


Like the steepest descent method, this method also uses the gradient to
search for the minimum point of an objective function. Such gradient-based
optimization methods are supposed to reach a point at which the gradient
is (close to) zero. In this context, the optimization of an objective function
f (x) is equivalent to nding a zero of its gradient g(x), which in general is a
vector-valued function of a vector-valued independent variable x. Therefore,
if we have the gradient function g(x) of the objective function f (x), we can
solve the system of nonlinear equations g(x) = 0 to get the minimum of f
(x) by using the Newton method.
The matlabcode for the same is provided below
xo = [3.0000 2.0000], ans = -7

2.4 CONSTRAINED OPTIMIZATION

17

%nm715 to minimize an objective ftn f(x) by the Newton method.


clear, clf
f713 = inline(x(1).^2 - 4*x(1) - x(1).*x(2) + x(2).^2 - x(2),x);
g713 = inline([2*x(1) - x(2) - 4 2*x(2) - x(1) - 1],x);
x0 = [0 0], TolX = 1e-4; TolFun = 1e-6; MaxIter = 50;
[xo,go,xx] = newtons(g713,x0,TolX,MaxIter);
xo, f713(xo) %an extremum point reached and its function
value
The Newton method is usually more e cient than the steepest descent
method if only it works as illustrated above, but it is not guaranteed to
reach the minimum point. The decisive weak point of the Newton method
is that it may approach one of the extrema having zero gradient, which is
not necessarily a (local) minimum, but possibly a maximum or a saddle
point.

2.4 CONSTRAINED OPTIMIZATION


In this section, only the concept of constrained optimization is introduced.

2.4.1 Lagrange Multiplier Method


A class of common optimization problems subject to equality constraints
may be nicely handled by the Lagrange multiplier method. Consider an
optimization problem with M equality constraints.
M inf (x)

(2.8)

h1 (x)
h2 (x)
h(x) = h3 (x) = 0
:
h4 (x)
According to the Lagrange multiplier method, this problem can be converted to the following unconstrained optimization problem:
M inl(x; ) = f (x) +

h(x) = f (x) +

M
X

m=1

m hjm (x)

The solution of this problem, if it exists, can be obtained by setting the


derivatives of this new objective function l(x, ) with respect to x and to
zero: Note that the solutions for this system of equations are the extrema of
the objective function. We may know if they are minima/maxima, from the

18

2. Conventional optimisation techniques

positive/negative- deniteness of the second derivative (Hessian matrix) of


l(x, ) with respect to x.
Inequality Constraints with the Lagrange Multiplier Method. Even though
the optimization problem involves inequality constraints like gj (x) 0, we
can convert them to equality constraints by introducing the (nonnegative)
slack variables y2j
gj (x) + yj2 = 0

(2.9)

Then, we can use the Lagrange multiplier method to handle it like an


equalityconstrained problem.

2.4.2 Penalty Function Method


This method is practically very useful for dealing with the general constrained optimization problems involving equality/inequality constraints.
It is really attractive for optimization problems with fuzzy or loose constraints that are not so strict with zero tolerance.
The penalty function method consists of two steps. The rst step is to
construct a new objective function by including the constraint terms in such
a way that violating the constraints would be penalized through the large
value of the constraint terms in the objective function, while satisfying the
constraints would not aect the objective function.
The second step is to minimize the new objective function with no constraints by using the method that is applicable to unconstrained optimization problems, but a non-gradient-based approach like the Nelder method.
Why dont we use a gradient-based optimization method? Because the inequality constraint terms vm m(gm(x)) attached to the objective function
are often determined to be zero as long as x stays inside the (permissible)
region satisfying the corresponding constraint (gm(x) 0) and to increase
very steeply (like m(gm(x)) = exp(emgm(x)) as x goes out of the region;
consequently, the gradient of the new objective function may not carry useful information about the direction along which the value of the objective
function decreases.
From an application point of view, it might be a good feature of this
method that we can make the weighting coe cient (wm,vm, and em) on
each penalizing constraint term either large or small depending on how
strictly it should be satised.
The Matlab code for this method is given below
%nm722 for Ex.7.3
% to solve a constrained optimization problem by penalty ftn
method.
clear, clf
f =f722p;
x0=[0.4 0.5]

2.5 MATLAB BUILT-IN ROUTINES FOR OPTIMIZATION

19

TolX = 1e-4; TolFun = 1e-9; alpha0 = 1;


[xo_Nelder,fo_Nelder] = opt_Nelder(f,x0) %Nelder method
[fc_Nelder,fo_Nelder,co_Nelder] = f722p(xo_Nelder) %its results
[xo_s,fo_s] = fminsearch(f,x0) %MATLAB built-in fminsearch()
[fc_s,fo_s,co_s] = f722p(xo_s) %its results
% including how the constraints are satised or violated
xo_steep = opt_steep(f,x0,TolX,TolFun,alpha0) %steepest descent method
[fc_steep,fo_steep,co_steep] = f722p(xo_steep) %its results
[xo_u,fo_u] = fminunc(f,x0); % MATLAB built-in fminunc()
[fc_u,fo_u,co_u] = f722p(xo_u) %its results
function [fc,f,c] = f722p(x)
f=((x(1)+ 1.5)^2 + 5*(x(2)- 1.7)^2)*((x(1)- 1.4)^2 + .6*(x(2).5)^2);
c=[-x(1); -x(2); 3*x(1) - x(1)*x(2) + 4*x(2) - 7;
2*x(1)+ x(2) - 3; 3*x(1) - 4*x(2)^2 - 4*x(2)]; %constraint vector
v=[1 1 1 1 1]; e = [1 1 1 1 1]; %weighting coe cient vector
fc = f +v*((c > 0).*exp(e.*c)); %new objective function

2.5 MATLAB BUILT-IN ROUTINES FOR


OPTIMIZATION
In this section, we introduce some MATLAB built-in unconstrained optimization routinesincluding fminsearch() and fminunc() to the same
problem, expecting that their nuances will be claried. Our intention is
not to compare or evaluate the performances of these sophisticated routines, but rather to give the readers some feelings for their functional
dierences.We also introduce the routine linprog()implementing Linear
Programming (LP) scheme and fmincon() designed for attacking the
(most challenging) constrained optimization problems. Interested readers
are encouraged to run the tutorial routines optdemoor tutdemo, which
demonstrate the usages and performances of the representative built-in optimization routines such as fminunc() and fmincon().
%nm731_1
% to minimize an objective function f(x) by various methods.
clear, clf
% An objective function and its gradient function
f = inline((x(1) - 0.5).^2.*(x(1) + 1).^2 + (x(2)+1).^2.*(x(2)
- 1).^2,x);
g0 = [2*(x(1)- 0.5)*(x(1)+ 1)*(2*x(1)+ 0.5) 4*(x(2)^2 - 1).*x(2)];

20

2. Conventional optimisation techniques

g = inline(g0,x);
x0 = [0 0.5] %initial guess
[xon,fon] = opt_Nelder(f,x0) %min point, its ftn value by opt_Nelder
[xos,fos] = fminsearch(f,x0) %min point, its ftn value by fminsearch()
[xost,fost] = opt_steep(f,x0) %min point, its ftn value by opt_steep()
TolX = 1e-4; MaxIter = 100;
xont = Newtons(g,x0,TolX,MaxIter);
xont,f(xont) %minimum point and its function value by Newtons()
[xocg,focg] = opt_conjg(f,x0) %min point, its ftn value by
opt_conjg()
[xou,fou] = fminunc(f,x0) %min point, its ftn value by fminunc()
For constraint optimisation
%nm732_1 to solve a constrained optimization problem by
fmincon()
clear, clf
ftn=((x(1) + 1.5)^2 + 5*(x(2) - 1.7)^2)*((x(1)-1.4)^2 + .6*(x(2).5)^2);
f722o = inline(ftn,x);
x0 = [0 0.5] %initial guess
A = []; B = []; Aeq = []; Beq = []; %no linear constraints
l = -inf*ones(size(x0)); u = inf*ones(size(x0)); % no lower/upperbound
options = optimset(LargeScale,o); %just [] is OK.
[xo_con,fo_con] = fmincon(f722o,x0,A,B,Aeq,Beq,l,u,f722c,options)
[co,ceqo] = f722c(xo_con) % to see how constraints are.

This is page 21
Printer: Opaque this

3
Linear Programming

Linear programming (LP) problems involve linear objective function and


linear constraints, as shown below in Example below.
Example: Solvents are extensively used as process materials (e.g., extractive agents) or process uids (e.g., CFC) in chemical process industries.
Cost is a main consideration in selecting solvents. A chemical manufacturer
is accustomed to a raw material X1 as the solvent in his plant. Suddenly,
he found out that he can eectively use a blend of X1 and X2 for the same
purpose. X1 can be purchased at $4 per ton, however, X2 is an environmentally toxic material which can be obtained from other manufacturers.
With the current environmental policy, this results in a credit of $1 per ton
of X2 consumed.
He buys the material a day in advance and stores it. The daily availability
of these two materials is restricted by two constraints: (1) the combined
storage (intermediate) capacity for X1 and X2 is 8 tons per day. The daily
availability for X1 is twice the required amount. X2 is generally purchased
as needed. (2) The maximum availability of X2 is 5 tons per day. Safety
conditions demand that the amount of X1 cannot exceed the amount of X2
by more than 4 tons. The manufacturer wants to determine the amount of
each raw material required to reduce the cost of solvents to a minimum.
Formulate the problem as an optimization problem. Solution: Let x1 be the
amount of X1 and x2 be the amount of X2 required per day in the plant.
Then, the problem can be formulated as a linear programming problem as
given below.

22

3. Linear Programming

FIGURE 3.1. Linear progamming Graphical representation

min 4x1

x1 ;x2

x2

(3.1)

Subject to

2x1 + x2
x2
x1 x2
x1
x2

8 storage constraint
5Availability constraint
4 Safety constraint
0
0

(3.2)
(3.3)
(3.4)
(3.5)
(3.6)

As shown above, the problem is a two-variable LP problem, which can be


easily represented in a graphical form. Figure 2.1 shows constraints (2.2)
through (2.4), plotted as three lines by considering the three constraints
as equality constraints. Therefore, these lines represent the boundaries of
the inequality constraints. In the gure, the inequality is represented by
the points on the other side of the hatched lines. The objective function
lines are represented as dashed lines (isocost lines). It can be seen that the
optimal solution is at the point x1 = 0; x2 = 5, a point at the intersection
of constraint (2.3) and one of the isocost lines. All isocost lines intersect
constraints either once or twice. The LP optimum lies at a vertex of the
feasible region, which forms the basis of the simplex method. The simplex
method is a numerical optimization method for solving linear programming
problems developed by George Dantzig in 1947.

3.1 The Simplex Method

23

3.1 The Simplex Method


The graphical method shown above can be used for two-dimensional problems; however, real-life LPs consist of many variables, and to solve these
linear programming problems, one has to resort to a numerical optimization method such as the simplex method. The generalized form of an LP
can be written as follows.
Optimize Z =

n
X

Ci xi

(3.7)

i=1

Subject to
n
X

Ci xi

bj

(3.8)

i=1

j
xj

= 1; 2; 3; :::::; m
2 R

(3.9)
(3.10)

a numerical optimization method involves an iterative procedure. The


simplex method involves moving from one extreme point
on the boundary (vertex) of the feasible region to another along the edges
of the boundary iteratively. This involves identifying the constraints (lines)
on which the solution will lie. In simplex, a slack variable is incorporated
in every constraint to make the constraint an equality. Now, the aim is to
solve the linear equations (equalities) for the decision variables x, and the
slack variables s. The active constraints are then identied based on the
fact that, for these constraints, the corresponding slack variables are zero.
The simplex method is based on the Gauss elimination procedure of
solving linear equations. However, some complicating factors enter in this
procedure: (1) all variables are required to be nonnegative because this
ensures that the feasible solution can be obtained easily by a simple ratio
test (Step 4 of the iterative procedure described below); and (2) we are
optimizing the linear objective function, so at each step we want ensure
that there is an improvement in the value of the objective function (Step
3 of the iterative procedure given below).
The simplex method uses the following steps iteratively.
Convert the LP into the standard LP form.
Standard LP
All the constraints are equations with a nonnegative right-hand side.
All variables are nonnegative.
Convert all negative variables x to nonnegative variables using two
variables (e.g., x = x+-x-); this is equivalent to saying if x = -5
then -5 = 5 - 10, x+ = 5, and x- = 10.

24

3. Linear Programming

FIGURE 3.2. Feasible reagion and slack variables

Convert all inequalities into equalities by adding slack variables (nonnegative) for less than or equal to constraints ( ) and by
subtracting surplus variables for greater than or equal to constraints ( ).
The objective function must be minimization or maximization.
The standard LP involving m equations and n unknowns has m basic
variables and n-m nonbasic or zero variables. This is explained below using
Example
Consider Example in the standard LP form with slack variables, as given
below.
Standard LP:
M T inimize

(3.11)

Subject to

Z + 4x1 x2
2x1 + x2 + s1
x2 + s2
x1 x2 + s3
x1
s1

=
=
=
=

0
8
5
4
0; x2
0; s2

0
0; s3

(3.12)
(3.13)
(3.14)
(3.15)
(3.16)
(3.17)

The feasible region for this problem is represented by the region ABCD
in Figure . Table shows all the vertices of this region and the corresponding
slack variables calculated using the constraints given by Equations (note
that the nonnegativity constraint on the variables is not included).
It can be seen from Table that at each extreme point of the feasible
region, there are n - m = 2 variables that are zero and m = 3 variables that
are nonnegative. An extreme point of the linear program is characterized
by these m basic variables.
In simplex the feasible region shown in Table gets transformed into a
tableau

3.1 The Simplex Method

25

FIGURE 3.3. Simplex tablau

Determine the starting feasible solution. A basic solution is obtained by


setting n - m variables equal to zero and solving for the values of theremaining m variables.
3. Select an entering variable (in the list of nonbasic variables) using the
optimality (dened as better than the current solution) condition; that is,
choose the next operation so that it will improve the objective function.
Stop if there is no entering variable.
Optimality Condition:
Entering variable: The nonbasic variable that would increase the objective function (for maximization). This corresponds to the nonbasic variable
having the most negative coe cient in the objective function equation or
the row zero of the simplex tableau. In many implementations of simplex,
instead of wasting the computation time in nding the most negative coe cient, any negative coe cientin the objective function equation is used.
4. Select a leaving variable using the feasibility condition.
Feasibility Condition:
Leaving variable: The basic variable that is leaving the list of basic
variables and becoming nonbasic. The variable corresponding to the smallest nonnegative ratio (the right-hand side of the constraint divided by the
constraint coe cient of the entering variable).
5. Determine the new basic solution by using the appropriate Gauss
Jordan
Row Operation.
GaussJordon Row Operation:
Pivot Column: Associated with the row operation.
Pivot Row: Associated with the leaving variable.
Pivot Element: Intersection of Pivot row and Pivot Column.
ROW OPERATION
Pivot Row = Current Pivot Row P ivotElement:
All other rows: New Row = Current Row - (its Pivot Column Coe cients x New Pivot Row).
6. Go to Step 2.
To solve the problem discussed above using simplex method Convert
the LP into the standard LP form. For simplicity, we are converting this
minimization problem to a maximization problem with -Z as the objective

26

3. Linear Programming

FIGURE 3.4. Initial tableau for simplex example

function. Furthermore, nonnegative slack variables s1, s2, and s3 are added
to each constraint.
M T inimize

(3.18)

Subject to

Z + 4x1 x2
2x1 + x2 + s1
x2 + s2
x1 x2 + s3
x1
s1

=
=
=
=

0
8
5
4
0; x2
0; s2

0
0; s3

(3.19)
(3.20)
(3.21)
(3.22)
(3.23)
(3.24)

The standard LP is shown in Table 2.3 below where x1 and x2 are nonbasic or zero variables and s1, s2, and s3 are the basic variables. The starting
solution is x1 = 0; x2 = 0; s1 = 8; s2 = 5; s3 = 4 obtained from the RHS
column.
Determine the entering and leaving variables. Is the starting solution
optimum? No, because Row 0 representing the objective function equation
contains nonbasic variables with negative coe cients.
This can also be seen from Figure. In this gure, the current basic solution is shown to be increasing in the direction of the arrow.
Entering Variable: The most negative coe cient in Row 0 is x2. Therefore, the entering variable is x2. This variable must now increase in the
direction of the arrow. How far can this increase the objective function?
Remember
that the solution has to be in the feasible region. Figure shows that the
maximum increase in x2 in the feasible region is given by point D, which
is on constraint (2.3). This is also the intercept of this constraint with the
y-axis, representing x2. Algebraically, these intercepts are the ratios of the
right-hand side of the equations to the corresponding constraint coe cient
of x2. We are interested only in the nonnegative ratios, as they represent

3.2 Infeasible Solution

27

FIGURE 3.5. Basic solution for simplex example

the direction of increase in x2. This concept is used to decide the leaving
variable.
Leaving Variable: The variable corresponding to the smallest nonnegative
ratio (5 here) is s2. Hence, the leaving variable is s2.
So, the Pivot Row is Row 2 and Pivot Column is x2.
The two steps of the GaussJordon Row Operation are given below.
The pivot element is underlined in the Table and is 1.
Row Operation:
Pivot: (0, 0, 1, 0, 1, 0, 5)
Row 0: (1, 4,-1, 0, 0, 0, 0)- (-1)(0, 0, 1, 0, 1, 0, 5) = (1, 4, 0, 0, 1, 0, 5)
Row 1: (0, 2, 1, 1, 0, 0, 8)- (1)(0, 0, 1, 0, 1, 0, 5) = (0, 2, 0, 1,-1, 0, 3)
Row 3: (0, 1,-1, 0, 0, 1, 4)- (-1)(0, 0, 1, 0, 1, 0, 5) = (0, 1, 0, 0, 1, 1, 9)
These steps result in the following table (Table).
There is no new entering variable because there are no nonbasic variables
with a negative coe cient in row 0. Therefore, we can assume that the
solution is reached, which is given by (from the RHS of each row) x1 = 0;
x2 = 5; s1 = 3; s2 = 0; s3 = 9; Z = -5.
Note that at an optimum, all basic variables (x2, s1, s3) have a zero
coe cient in Row 0.

3.2 Infeasible Solution


Now consider the same example, and change the right-hand side of Equation28 instead of 8. We know that constraint (2) represents the storage capacity
and physics tells us that the storage capacity cannot be negative. However,
let us see what we get mathematically.

28

3. Linear Programming

FIGURE 3.6. Infeasible LP

FIGURE 3.7. Initial tableau for infeasible problem

From Figure 2.3, it is seen that the solution is infeasible for this problem.
Applying the simplex Method results in Table 2.5 for the rst step.

Z + 4x1 x2 = 0
2x1 + x2 + s1 =
8 Sorage Constraint
x2 + s2 = 5 Availability Constraint
x1 x2 + s3 = 4 Safety Constraint
x1
0; x2 0

Standard LP

(3.25)
(3.26)
(3.27)
(3.28)
(3.29)

3.3 Unbounded Solution

29

FIGURE 3.8. Second iteration tableau for infesible problem

FIGURE 3.9. Simplex tableau for unbounded solution

Z + 4x1 x2 = 0
2x1 + x2 + s1 =
8 Sorage Constraint
x2 + s2 = 5 Availability Constraint
x1 x2 + s3 = 4 Safety Constraint

(3.30)
(3.31)
(3.32)
(3.33)

The solution to this problem is the same as before: x1 = 0; x2 = 5.


However, this solution is not a feasible solution because the slack variable
(articialvariable dened to be always positive) s1 is negative.

3.3 Unbounded Solution


If constraints on storage and availability are removed in the above example,
the solution is unbounded, as can be seen in Figure 2.4. This means there
are points in the feasible region with arbitrarily large objective function
values (for maximization).

M inimizex1;x2 Z = 4x1 x2
x1 x2 + s3 = 4 Safety Constraint
x1
0; x2 0

(3.34)
(3.35)
(3.36)

The entering variable is x2 as it has the most negative coe cient in


row 0. However, there is no leaving variable corresponding to the binding
constraint (the smallest nonnegative ratio or intercept). That means x2

30

3. Linear Programming

FIGURE 3.10. Simplex problem for unbounded solution

can take as high a value as possible. This is also apparent in the graphical
solution shown in Figure The LP is unbounded when (for a maximization
problem) a nonbasic variable with a negative coe cient in row 0 has a
nonpositive coe cient in each constraint, as shown in the table

3.4 Multiple Solutions


In the following example, the cost of X1 is assumed to be negligible as
compared to the credit of X2. This LP has innite solutions given by the
isocost line (x2 = 5) . The simplex method generally nds one solution
at a time. Special methods such as goal programming or multiobjective
optimization can be used to nd these solutions.

3.4.1 Matlab code for Linear Programming (LP)


The linear programming (LP) scheme implemented by the MATLAB builtin routine
"[xo,fo] = linprog(f,A,b,Aeq,Beq,l,u,x0,options)"
is designed to solve an LP problem, which is a constrained minimization
problem as follows.
M inf (x) = f T x

(3.37)

3.4 Multiple Solutions

31

subject to
Ax

b; Aeqx = beq; andl

(3.38)

%nm733 to solve a Linear Programming problem.


% Min f*x=-3*x(1)-2*x(2) s.t. Ax <= b, Aeq = beq and l <=
x <= u
x0 = [0 0]; %initial point
f = [-3 -2]; %the coe cient vector of the objective function
A = [3 4; 2 1]; b = [7; 3]; %the inequality constraint Ax <= b
Aeq = [-3 2]; beq = 2; %the equality constraint Aeq*x = beq
l = [0 0]; u = [10 10]; %lower/upper bound l <= x <= u
[xo_lp,fo_lp] = linprog(f,A,b,Aeq,beq,l,u)
cons_satised = [A; Aeq]*xo_lp-[b; beq] %how constraints are
satised
f733o=inline(-3*x(1)-2*x(2), x);
[xo_con,fo_con] = fmincon(f733o,x0,A,b,Aeq,beq,l,u)
It produces the solution (column) vector xo and the minimized value
of the objective function f (xo) as its rst and second output arguments
xo and fo, where the objective function and the constraints excluding the
constant term are linear in terms of the independent (decision) variables.
It works for such linear optimization problems more e ciently than the
general constrained optimization routine fmincon().

32

3. Linear Programming

This is page 33
Printer: Opaque this

4
Nonlinear Programming

In nonlinear programming (NLP) problems, either the objective function,


the constraints, or both the objective and the constraints are nonlinear, as
shown below in Example.
Consider a simple isoperimetric problem described in Chapter
1. Given the perimeter (16 cm) of a rectangle, construct the rectangle
with maximum area. To be consistent with the LP formulations of the
inequalities seen earlier, assume that the perimeter of 16 cm is an upper
bound to the real perimeter.
Solution: Let x1 and x2 be the two sides of this rectangle. Then the
problem can be formulated as a nonlinear programming problem with the
nonlinear objective function and the linear inequality constraints given below:
Maximize Z = x1 x x2
x1, x2
subject to
2x1 + 2x2 16 Perimeter Constraint
x1 0; x2 0
Let us start plotting the constraints and the iso-objective (equal-area)
contours in Figure 3.1. As stated earlier in the gure, the three inequalities
are represented by the region on the other side of the hatched lines. The
objective function lines are represented as dashed contours. The optimal
solution is at x1 = 4 cm; x2 = 4 cm. Unlike LP, the NLP solution is not
lying at the vertex of the feasible region, which is the basis of the simplex
method.

34

4. Nonlinear Programming

FIGURE 4.1. Nonlinear programming contour plot

The above example demonstrates that NLP problems are dierent from
LP problems because:
An NLP solution need not be a corner point.
An NLP solution need not be on the boundary (although in this example it is on the boundary) of the feasible region. It is obvious that one
cannot use the simplex for solving an NLP. For an NLP solution, it is necessary to look at the relationship of the objective function to each decision
variable. Consider the previous example. Let us convert the problem into a
onedimensional problem by assuming constraint (isoperimetric constraint)
as an equality. One can eliminate x2 by substituting the value of x2 in
terms of x1 using constraint.
min Z = 8x1

x1;x2

x1

x21

(4.1)
(4.2)

Figure shows the graph of the objective function versus the single decision variable x1. In Figure , the objective function has the highest value
(maximum) at x1 = 4. At this point in the gure, the x-axis is tangent to
the objective
function curve, and the slope dZ/dx1 is zero. This is the rst condition
that is used in deciding the extremum point of a function in an NLP setting.
Is this a minimum or a maximum? Let us see what happens if we convert
this maximization problem into a minimization problem with -Z as the
objective function.
min Z = 8x1
x1

x21

(4.3)

4. Nonlinear Programming

35

FIGURE 4.2. Nonlinear program graphical representation

x1

(4.4)

Figure shows that -Z has the lowest value at the same point, x1 = 4. At
this point in both gures, the x-axis is tangent to the objective function
curve, and slope dZ/dx1 is zero. It is obvious that for both the maximum
and minimum points, the necessary condition is the same. What dierentiates a minimum from a maximum is whether the slope is increasing or
decreasing around the extremum point. In Figure 3.2, the slope is decreasing as you move away from x1 = 4, showing that the solution is a maximum.
On the other hand, in Figure 3.3 the slope is increasing, resulting in a minimum.
Whether the slope is increasing or decreasing (sign of the second derivative) provides a su cient condition for the optimal solution to an NLP.
Many times there will be more than one minia existing. For the case
shown in the gure the number of minim are two more over one being
better than the other.This is another case in which an NLP diers from an
LP, as
In LP, a local optimum (the point is better than any adjacentpoint)
is a global (best of all the feasible points) optimum. With NLP, a solution
can be a local minimum.
For some problems, one can obtain a global optimum. For example,
Figure shows a global maximum of a concave function.
Figure presents a global minimum of a convex function. What is the
relation between the convexity or concavity of a function and
its optimum point? The following section describes convex and concave
functions and their relation to the NLP solution.

36

4. Nonlinear Programming

FIGURE 4.3. Nonlinear programming minimum

4.1 Convex and Concave Functions


A set of points S is a convex set if the line segment joining any two points
in the space S is wholly contained in S. In Figure 3.5, a and b are convex
sets, but c is not a convex set.
Mathematically, S is a convex set if, for any two vectors x1 and x2 in
S, the vector x = x1 +(1- )x2 is also in S for any number between 0
and 1. Therefore, a function f(x) is said to be strictly convex if, for any two
distinct points x1 and x2, the following equation applies.
f( x1 + (1 - )x2) < f(x1) + (1 - )f(x2) (3.7)
Figure 3.6a describes Equation (3.7), which denes a convex function.
This convex function (Figure 3.6a) has a single minimum, whereas the
nonconvex function can have multiple minima. Conversely, a function f(x)
is strictly concave if -f(x) is strictly convex.
As stated earlier, concave function has a single maximum.
Therefore, to obtain a global optimum in NLP, the following conditions
apply.
Maximization: The objective function should be concave and the solution space should be a convex set .
Minimization: The objective function should be convex and the solution
space should be a convex set .
Note that every global optimum is a local optimum, but the converse is
not true. The set of all feasible solutions to a linear programming problem
is a convex set. Therefore, a linear programming optimum is a global optimum. It is clear that the NLP solution depends on the objective function
and the solution space dened by the constraints. The following sections
describe the unconstrained and constrained NLP, and the necessary and
su cient conditions for obtaining the optimum for these problems.

4.1 Convex and Concave Functions

FIGURE 4.4. Nonlinear programming multiple minimum

FIGURE 4.5. Examples of convex and nonconvex sets

37

38

4. Nonlinear Programming

This is page 39
Printer: Opaque this

5
Discrete Optimization

Discrete optimization problems involve discrete decision variables as shown


below in Example Consider the isoperimetric problem solved to be an NLP.
This problem is stated in terms of a rectangle. Suppose we have a choice
among a rectangle, a hexagon, and an ellipse, as shown in Figure
Draw the feasible space when the perimeter is xed at 16 cm and the
objective is to maximize the area.
Solution: The decision space in this case is represented by the points
corresponding to dierent shapes and sizes as shown Discrete optimization
problems can be classied as integer programming (IP) problems, mixed
integer linear programming (MILP), and mixed integer
nonlinear programming (MINLP) problems. Now let us look at the decision variables associated with this isoperimetric problem. We need to decide
which shape and what dimensions to choose. As seen earlier, the dimen-

FIGURE 5.1. Isoperimetric problem discrete decisions

40

5. Discrete Optimization

FIGURE 5.2. Feasible space for discrete isoperimetric problem

sions of a particular gure represent continuous decisions in a real domain,


whereas
selecting a shape is a discrete decision. This is an MINLP as it contains
both continuous (e.g., length) and discrete decision variables (e.g., shape),
and the objective function (area) is nonlinear. For representing discrete decisions associated with each shape, one can assign an integer for each shape
or a binary variable having values of 0 and 1 (1 corresponding to yes and
0 to no). The binary variable representation is used in traditional mathematical programming algorithms for solving problems involving discrete
decision variables.
However, probabilistic methods such as simulated annealing and genetic
algorithms which are based on analogies to a physical process such as the
annealing of metals or to a natural process such as genetic evolution, may
prefer to use dierent integers assigned to dierent decisions.
Representation of the discrete decision space plays an important role in
selecting a particular algorithm to solve the discrete optimization problem.
The following section presents the two dierent representations commonly
used in discrete optimization.

5.1 Tree and Network Representation

41

FIGURE 5.3. Cost of seperations 1000 Rs/year

5.1 Tree and Network Representation


Discrete decisions can be represented using a tree representation or a network representation. Network representation avoids duplication and each
node corresponds to a unique decision. This representation is useful when
one is using methods like discrete dynamic programming. Another advantage of the network representation is that an IP problem that can be represented.
appropriately using the network framework can be solved as an LP. Examples of network models include transportation of supply to
satisfy a demand, ow of wealth, assigning jobs to machines, and project
management. The tree representation shows clear paths to nal decisions;
however, it involves duplication. The tree representation is suitable when
the discrete decisions are represented separately, as in the Branch-andbound method.
This method is more popular for IP than the discrete dynamic programming method in the mathematical programming literature due to its easy
implementation and generalizability. The following example from Hendry
and Hughes (1972) illustrates the two representations.
Example 1 Given a mixture of four chemicals A, B, C, D for which differenttechnologies are used to separate the mixture of pure components. The
costof each technology is given in Table 4.1 below. Formulate the problem
as an optimization problem with tree and network representations.
Solution: Figure 4.3 shows the decision tree for this problem. In this
representation, we have multiple representations of some of the separation
options. For example, the binary separators A/B, B/C, C/D appear twice
in the terminal nodes. We can avoid this duplication by using the network

42

5. Discrete Optimization

FIGURE 5.4. Tree representation

representation shown in Figure . In this representation, we have combined


the branches that lead to the same binary separators. The network representation has 10 nodes, and the tree representation has 13 nodes. The
optimization problem is to nd the path that will separate the mixture into
pure components for a minimum cost. From the two representations, it is
very clear that the decisions involved here are all discrete decisions. This
is a pure integer programming problem. The mathematical programming
method commonly used to solve this problem is the Branch-and-bound
method. This method is described in the next section.

5.2 Branch-and-Bound for IP


Having developed the representation, the question is how to search for the
optimum. One can go through the complete enumeration, but that would
involve evaluating each node of the tree. The intelligent way is to reduce the
search space by implicit enumeration and evaluate as few nodes as possible.
Consider the above example of separation sequencing. The objective is to
minimize the cost of separation. If one looks at the nodes for each branch,
there are an initial node, intermediate nodes, and a terminal node. Each
node is the sum of the costs of all earlier nodes in that branch. Because
this cost increases monotonically as we progress through the initial, intermediate, and nal nodes, we can dene the upper bound and lower bounds
for each branch.

5.2 Branch-and-Bound for IP

43

FIGURE 5.5. Network representation

The cost accumulated at any intermediate node is a lower bound to


the cost of any successor nodes, as the successor node is bound to incur
additional cost.
For a terminal node, the total cost provides an upper bound to the
original problem because a terminal node represents a solution that may or
may not be optimal. The above two heuristics allow us to prune the tree for
cost minimization. If the cost at the current node is greater than or equal
to the upper bound dened earlier either from one of the prior branches
or known to us from experience, then we dont need to go further in that
branch. These are the two common ways to prune the tree based on the
order in which the nodes are enumerated:
Depth-rst: Here, we successively perform one branching on the most
recently created node. When no nodes can be expanded, we backtrack to
a node whose successor nodes have not been examined.
Breadth-rst: Here, we select the node with the lowest cost and expand
all its successor nodes. The following example illustrates these two strategies for the problem specied in Example previously. Find the lowest cost
separation sequence for the problem specied in PreviousExample using
the depth-rst and breadth-rst Branch-and-bound strategies.
Solution: Consider the tree representation shown in Figure for this problem. First, lets examine the depth-rst strategy, as shown in Figure and
enumerated below.
Branch from Root Node to Node 1: Sequence Cost = 50.

44

5. Discrete Optimization

FIGURE 5.6. Tree representation and cost diagram

Branch from Node 1 to Node 2: Sequence Cost = 50 + 228 = 278.


Branch from Node 2 to Node 3: Sequence Cost = 278 + 329 = 607.
Because Node 3 is terminal, current upper bound = 607.
Current best sequence is (1, 2, 3).
Backtrack to Node 2.
Backtrack to Node 1
Branch from Node 1 to Node 4: Sequence Cost = 50 + 40 = 90 < 607.
Branch from Node 4 to Node 5: Sequence Cost = 90 + 50 = 140 <
607.
Because Node 5 is terminal and 140 < 607, current upper bound =
140.
Current best sequence is (1, 4, 5).
Backtrack to Node 4.
Backtrack to Node 1.
Backtrack to Root Node.
Branch from Root Node to Node 6: Sequence Cost = 170.
Because 170 > 140, prune Node 6.
Current best sequence is still (1, 4, 5).
Backtrack to Root Node.
Branch from Root Node to Node 9: Sequence Cost = 110.
Branch from Node 9 to Node 10: Sequence Cost = 110 + 40 = 150.
Branch from Node 9 to Node 12: Sequence Cost = 110 + 69 = 179.
Because 150 > 140, prune Node 10.

5.2 Branch-and-Bound for IP

45

FIGURE 5.7. Deapth rst enumeration

Because 179 > 140, prune Node 12.


Current best sequence is still (1, 4, 5).
Backtrack to Root Node.
Because all the branches from the Root Node have been examined,
stop.
Optimal sequence (1, 4, 5), Minimum Cost = 140.
Note that with the depth-rst strategy, we examined 9 nodes out of 13
that we have in the tree. If the separator costs had been a function of
continuous decision variables, then we would have had to solve either an
LP or an NLP at each node, depending on the problem type. This is the
principle behind the depth-rst Branch-and-bound strategy. The breadthrst strategy enumeration is shown in Figure . The steps are elaborated
below.
Branch from root node to:
Node 1: Sequence cost = 50.
Node 6: Sequence cost = 170.
Node 9: Sequence cost = 110.
Select Node 1 because it has the lowest cost.
Branch Node 1 to:
Node 2: Sequence Cost = 50 + 228 = 278.
Node 4: Sequence Cost = 50 + 40 = 90.
Select Node 4 because it has the lowest cost among 6, 9, 2, 4.
Branch Node 4 to:

46

5. Discrete Optimization

FIGURE 5.8. Breadth rst enumeration

Node 5: Sequence Cost = 90 + 50 = 140.


Because Node 5 is terminal, current best upper bound = 140 with the
current best sequence (1, 4, 5).
Select Node 9 because it has the lowest cost among 6, 9, 2, 5.
Branch Node 9 to:
Node 10: Sequence Cost = 110 + 40 = 150.
Node 12: Sequence Cost = 110 + 69 = 179.
From all the available nodes 6, 2, 5, 10, and 12, Node 5 has the lowest
cost, so stop.
Optimal Sequence (1, 4, 5), Minimum Cost = 140. Note that with the
breadth-rst strategy, we only had to examine 8 nodes
out of 13 nodes in the tree, one node less than the depth-rst strategy. In
general, the breadth-rst strategy requires the examination of fewer nodes
and no backtracking. However, depth-rst requires less storage of nodes
because the maximum number of nodes to be stored at any point is the
number of levels in the tree. For this reason, the depth-rst strategy is
commonly used. Also, this strategy has a tendency to nd the optimal
solution earlier than the breadth-rst strategy. For example, in Example,
we had reached the optimal solution in the rst few steps using the depthrst strategy (seventh step, with ve nodes examined)

This is page 47
Printer: Opaque this

6
Integrated Planning and Scheduling
of processes

6.1 Introduction
In this chapter, we address each part of the manufacturing business hierarchy, and explain how optimization and modeling are key tools that help
link the components together. Also introduce the concept of scheduling and
resent developments related to schduling of batch process.

6.2 Plant optimization hierarchy


Figure (??)shows the relevant levels for the process industries in the optimization hierarchy for business manufacturing. At all levels the use of
optimization techniques can be pervasive although specic techniques are
not explicitly listed in the specic activities shown in the gure. In Figure
(??)the key information sources for the plant decision hierarchy for operations are the enterprise data, consisting of commercial and nancial information, and plant data, usually containing the values of a large number of
process variables. The critical linkage between models and optimization in
all of the ve levels is illustrated in Figure(??). The rst level (planning) sets
production goals that meet supply and logistics constraints, and scheduling
(layer 2) addresses time-varying capacity and sta ng utilization decisions.
The term supply chain refers to the links in a web of relationships involving materials acquisition, retailing (sales), distribution, transportation, and
manufacturing with suppliers. Planning and scheduling usually take place

48

6. Integrated Planning and Scheduling of processes

over relatively long time frames and tend to be loosely coupled to the information ow and analysis that occur at lower levels in the hierarchy. The
time scale for decision making at the highest level (planning) may be on
the order of months, whereas at the lowest level (e.g., process monitoring)
the interaction with the process may be in fractions of a second.
Plantwide management and optimization at level 3 coordinates the network of process units and provides cost-eective setpoints via real-time optimization. The unit management and control level includes process control
[e.g., optimal tuning of proportional-integral-derivative (PID) controllers],
emergency response, and diagnosis, whereas level 5 (process monitoring
and analysis) provides data acquisition and online angysis and reconciliation functions as well as fault detection. Ideally, bidirectional communication occurs between levels, with higher levels setting goals for lower levels
and the lower levels communicating constraints and performance information to the higher levels. Data are collected directly at all levels in the
enterprise. In practice the decision ow tends to be top down, invariably
resulting in mismatches between goals and their realization and the consequent accumulation of inventory. Other more deleterious eects include
reduction of processing capacity, o-specication products, and failure to
meet scheduled deliveries.
Over the past 30 years, business automation systems and plant automation systems have developed along dierent paths, particularly in the way
data are acquired, managed, and stored. Process management and control systems normally use the same databases obtained from various online
measurements of the state of the plant. Each level in Figure (??p1) may
have its own manually entered database, however, some of which are very
large, but web-based data interchange will facilitate standard practices in
the future.
Table (??p1) lists the kinds of models and objective functions used in
the computer-integrated manufacturing (CIM) hierarchy. These models are
used to make decisions that reduce product costs, improve product quality,
or reduce time to market (or cycle time). Note that models employed can
be classied as steady state or dynamic, discrete or continuous, physical
or empirical, linear or nonlinear, and with single or multiple periods. The
models used at dierent levels are not normally derived from a single model
source, and as a result inconsistencies in the model can arise. The chemical processing industry is, however, moving in the direction of unifying the
modeling approaches so that the models employed are consistent and robust, as implied in Figure (??p1). Objective functions can be economically
based or noneconomic, such as least squares.
Planning and Scheduling
Bryant (1993) states that planning is concerned with broad classes of
products and the provision of adequate manufacturing capacity. In contrast, scheduling focuses on details of material ow, manufacturing, and
production, but still may be concerned with o- ine planning. Reactive

6.2 Plant optimization hierarchy

49

scheduling refers to real-time scheduling and the handling of unplanned


changes in demands or resources. The term enterprise resource planning
(ERP) is used today, replacing the term manufacturing resources planning
(MRP); ERP may or may not explicitly include planning and scheduling,
depending on the industry. Planning and scheduling are viewed as distinct
levels in the manufacturing hierarchy as shown in Figure (??p1), but often
a fair amount of overlap exists in the two problem statements, as discussed
later on. The time scale can often be the determining factor in whether a
given problem is a planning or scheduling one: planning is typied by a time
horizon of months or weeks, whereas scheduling tends to be of shorter duration, that is, weeks, days, or hours, depending on the cycle time from raw
materials to nal product. Bryant distinguishes among system operations
planning, plant operations planning, and plant scheduling, using the tasks
listed in Table (??t2). At the systems operations planning level traditional
multiperiod, multilocation linear programming problems must be solved,
whereas at the plant operations level, nonlinear multiperiod models may
be used, with variable time lengths that can be optimized as well (Lasdon
and Baker, 1986).
Baker (1993) outlined the planning and scheduling activities in a renery
as follows:
1. The corporate operations planning model sets target levels and prices
for interrenery transfers, crude and product allocations to each renery, production targets, and inventory targets for the end of each renery
models time horizon.
2. In plant operations planning each renery model produces target operating conditions, stream allocations, and blends across the whole renery,
which determines.
(a) optimal operating conditions, ows, blend recipes, and inventories;
and (b) costs, cost limits, and marginal values to the scheduling and realtime optimization (RTO) models.
3. The scheduling models for each renery convert the preceding information into detailed unit-level directives that provide day-by-day operating
conditions or-set points.
Supply chain management poses di cult decision-making problems because of its wide ranging temporal and geographical scales, and it calls
for greater responsiveness because of changing market factors, customer
requirements, and plant availability. Successful supply chain management
must anticipate customer requirements, commit to customer orders, procure new materials, allocate production
capacity, schedule production, and schedule delivery. According to Bryant
(1993), the costs associated with supply chain issues represent about 10 percent of the sales value of domestically delivered products, and as much as
40 percent internationally.

50

6. Integrated Planning and Scheduling of processes

Managing the supply chain eectively involves not only the manufacturers, but also their trading partners: customers, suppliers, warehousers,
terminal operators, and transportation carriers (air, rail, water, land).
In most supply chains each warehouse is typically controlled according to
some local law such as a safety stock level or replenishment rule. This local
control can cause buildup of inventory at a specic point in the system and
thus propagate disturbances over the time frame of days to months (which
is analogous to disturbances in the range of minutes or hours that occur at
the production control level). Short-term changes that can upset the system
include those that are "selnicted" (price changes, promotions, etc.) or
eects of weather or other cyclical consumer patterns. Accurate demand
forecasting is critical to keeping the supply chain network functioning close
to its optimum when the produce-to-inventory approach is used.

6.3 Planning
A simplied and idealized version of the components involved in the planning step, that is, the components of the supply chain incorporates. S possible suppliers provide raw materials to each of the M manufacturing plants.
These plants manufacture a given product that may be stored or warehoused in W facilities (or may not be stored at all), and these in turn are
delivered to C dierent customers. The nature of the problem depends on
whether the products are made to order or made to inventory; made to order fullls a specic customer order, whereas made to inventory is oriented
to the requirements of the general market demand., with material balance
conditions satised between suppliers, factories, warehouses, and customers
(equality constraints). Inequality constraints would include individual line
capacities in each manufacturing plant, total factory capacity, warehouse
storage limits, supplier limits, and customer demand. Cost factors include
variable manufacturing costs, cost of warehousing, supplier prices, transportation costs (between each sector), and variable customer pricing, which
may be volume and quality-dependent. A practical problem may involve
as many as 100,000 variables and can be solved using mixed-integer linear
programming (MILP).
Most international oil companies that operate multiple reneries analyze
the renery optimization problem over several time periods (e.g., 3 months).
This is because many crudes must be purchased at least 3 months in advance due to transportation requirements (e.g., the need to use tankers
to transport oil from the Middle East). These crudes also have dierent
grades and properties, which must be factored into the product slate for
the renery. So the multitime period consideration is driven more by supply and demand than by inventory limits (which are typically less than 5
days). The LP models may be run on a weekly basis to handle such items

6.4 Scheduling

51

as equipment changes and maintenance, short-term supply issues (and delays in shipments due to weather problems or unloading di culties), and
changes in demand (4 weeks within a 1-month period). Product properties such as the Reid vapor pressure must be changed between summer
and winter months to meet environmental restrictions on gasoline properties. See Pike (1986) for a detailed LP renery example that treats quality
specications and physical properties by using product blending, a dimension that is relevant for companies with varied crude supplies and product
requirements.

6.4 Scheduling
Information processing in production scheduling is essentially the same
as in planning. Both plants and individual process equipment take orders
and make products. or a plant, the customer is usually external, but for
a process (or "work cell" in discrete manufacturing parlance), the order
comes from inside the plant or factory. In a plant, the nal product can
be sold to an external customer; for a process, the product delivered is an
intermediate or partially nished product that goes on to the next stage of
processing (internal customer).
Two philosophies are used to solve production scheduling problems (Puigjaner and Espura, 1998):
1. The top-down approach, which denes appropriate hierarchical coordination mechanisms between thedierent decision levels and decision
structures at each level. These structures force constraints on lower operating levels and require heuristic decision rules for each task. Although
this approach reduces the size and complexity of scheduling problems, it
potentially introduces coordination problems.
2. The bottom-up approach, which develops detailed plant simulation
and optimization models, optimizes them, and translates the results from
the simulations and optimization into practical operating heuristics. This
approach often leads to large models with many variables and equations
that are di cult to solve quickly using rigorous optimization algorithms.
Table (??t3) categorizes the typical problem statement for the manufacturing scheduling and planning problem. In a batch campaign or run,
comprising smaller runs called lots, several batches of product may be produced using the same recipe. To optimize the production process, you need
to determine
1. The recipe that satises product quality requirements.
2. The production rates needed to fulll the timing requirements, including any precedence constraints.
3. Operating variables for plant equipment that are subject to constraints.

52

6. Integrated Planning and Scheduling of processes

4.
5.
6.
7.

Availability of raw material inventories.


Availability of product storage.
The run schedule.
Penalties on completing a production step too soon or too late.

Example 2 MULTIPRODUCT BATCH PLANT SCHEDULING: Batch


operations such as drying, mixing, distillation, and reaction are widely used
in producing food, pharmaceuticals, and specialty products (e.g., polymers).
Scheduling of operations as described in Table 16.3 is crucial in such plants.
A principal feature of batch plants (Ku and Karimi, 1987) is the production
of multiple products using the same set of equipment. Good industrial case
studies of plant scheduling include those by Bunch et al. (1998), McDonald
(1998), and Schulz et al. (1998). For example, Schulz et al. described a
polymer plant that involved four process steps (preparation, reaction, mixing, and nishing) using di erent equipment in each step. When products
are similar in nature, they require the same processing steps and hence pass
through the same series of processing units; often the batches are produced
sequentially. Such plants are called multiproduct plants. Because of di erent processing time requirements, the total time required to produce a set of
batches (also called the makespan or cycle time) depends on the sequence in
whidh they are produced. To maximize plant productivity, the batches should
be produced in a sequence that minimizes the makespan. The plant schedule
corresponding to such a sequence can then be represented graphically in the
form of a Gantt chart (see the following discussion and Figure E16.2b).
The Gantt chart provides a timetable of plant operations showing which
products are produced by which units and at what times. In this example
we consider four products @I, p2, p3, p4) that are to be produced as a series
of batches in a multiproduct plant consisting of three batch reactors in series
(Ku and Karirni, 1992); . The processing times for each batch reactor and
each product are given in Table E16.2. Assume that no intermediate storage
is available between the processing units. If a product nishes its processing
on unit k and unit k + 1 is not free because it is still processing a previous
product, then the completed product must be kept in unit k, until unit k + 1
becomes free. As an example, product pl must be held in unit 1 until unit 2
nishes processing p3. When a product nishes processing on the last unit,
it is sent immediately to product storage. Assume that the times required
to transfer products from one unit to another are negligible compared with
the processing times. The problem for this example is to determine the time
sequence for producing the four products so as to minimize the makespan.
Assume that all the units are initiallyempty (initialized) at time zero and
the manufacture of any product can be delayed an arbitrary amount of time
by holding it in the previous unit.
Solution 3 Let N be the number of products and M be the number of units
in the plant.Let q(called completion time) be the "clock time at which the

6.4 Scheduling

53

jth product in the sequence leaves unit k after completion of its processing,
and let rLkb e the time required to process the jth product in the sequence
on unit k (See Table E16.2). The rst product goes into unit 1 at time
zero, so ClYo= 0. The index j in T ~an,d~C jrk denotes the position of a
product in the sequence. Hence CN is the time at which the last product
leaves the last unit and is the makespan to be minimized. Next, we derive
the set of constraints (Ku and Karimi, 1988; 1990) that interrelate the
Cj,k. First, the jth product in the sequence cannot leave unit k until it is
processed, and in order to be processed on unit k, it must have left unit k
- 1. Therefore the clock time at which it leaves unit k (i.e., q,+) m ust be
equal to or after the time at which it leaves unit k - 1 plus the processing
time in k. Thus the rst set of constraints in the formulation is Similarly,
the jth product cannot leave unit k until product ( j - 1) has been processed
and transferred: Set C= 0. Finally the jth product in the sequence cannot
leave unit k until the downsbeam unit k + 1 is free [i.e., product ( j - 1)
has left]. Therefore Although Equations (a)-(c) represent the complete set
of constraints, some of them are redundant. From Equation (a) Cjr Cj,k+ T ~fo,r~k 1 2 . But from Equation (c), Cj,k-l 2 Cj- l,k, hence Cj,k
1 Cj- l,k + ri,k for k = 2, M. In essence, Equations (a) and (c) imply
Equations (b) for k = 2, M, so Equations (b) for k = 2, M are redundant.
Having derived the constraints for completion times, we next determine the
sequence of operations. In contrast to the CjPkt, he decision variables here
are discrete (binary). Dene Xij as follows. Xi,. = 1 if product i (product
with label pi) is in slot j of the sequence, otherwise it is zero. So X3 = 1
means that product p3 is second in the production sequence, and X3, = 0
means that it is not in the second position. The overall integer constraint
is Similarly every product should occupy only one slot in the sequence: The
Xij that satisfy Equations (d) and (e) always give a meaningful sequence.
Now we must determine the clock times ti for any given set of Xi,j. If
product pi is in slot j, then tj,km~~tbe7i,kandX= i1,j a ndXi,l = Xi = . .
. = Xi ,.~- 1 = X~.. +=l . . . = xi,N= 0, therefore we can use XiFj to pick
the right processing time representing $ by imposing the constraint. To
reduce the number of constraints, we substitute rjtkfr om Equation (f ) into
Equations(a) and (b) to obtain the following formulation (Ku and Karimi,
1988).
Minimize: CNM
Subject to: Equations (c), (d), (e) and
C, r 0 and Xibinary Because the preceding formulation involves binary
(XiJ) as well as continuous variables(Ci) and has no nonlinear functions,
it is a mixed-integer linear programming(MILP) problem and can be solved
using the GAMS MIP solver. Solving for the optimal sequence using Table
E16.2, we obtain XI= X2,4 = X3= X, = 1. This means that pl is in the
rst position in the optimal production sequence, p2 in the fourth, p3 in the
second, and p4 in the third. In other words, the optimal sequence is in the
order pl-p3-p4-p2. In contrast to the XiJ, we must be careful in interpreting

54

6. Integrated Planning and Scheduling of processes

FIGURE 6.1. Gantt chart for the optimal multiproduct plant schedule

the Ci,f,ro m the GAMS output, because C, really means the time at which
the jth product in the sequence (and not product pi) leaves unit k. Therefore
C2 = 23.3 means that the second product (i.e., p3) leaves unit 3 at 23.3
h. Interpreting the others in this way, the schedule corresponding to this
production sequence is conveniently displayed in form of a Gantt chart in
Figure E16.2b, which shows the status of the units at di erent times. For
instance, unit 1 is processing pl during [0, 3.51 h. When pl leaves unit 1
at t = 3.5 h, it starts processing p3. It processes p3 during [3.5,7] h. But
as seen from the chart, it is unable to dischargep3 to unit 2, because unit
2 is still processing pl. So unit 1 holds p3 during [7,7.8] h. When unit 2
discharges p3
to unit 3 at 16.5 h, unit 1 is still processingp4, therefore unit 2 remains
idle during [16.5, 19.81 h. It is common in batch plants to have units blocked
due to busy downstream units or units waiting for upstream units to nish.
This happens because the processing times vary from unit to unit and from
product to product, reducing the time utilization of units in a batch plant.
The nished batches of pl, p3, p4, and p2 are completed at times 16.5 h,
23.3 h, 3 1.3 h, and 34.8 h. The minimum makespan in 34.8 h.
This problem can also be solved by a search method . Because the order of products cannot be changed once they start through the sequence of
units, we need only determine the order in which the products are processed.
Let be a permutation or sequence in which to process the jobs, where p(j)
is the index of the product in position j of the sequence. To evaluate the
makespan of a sequence, we proceed as in Equations (a)-(c) of the mixedinteger programming version of the problem. Let Ci, be the completion time
of product p(j) on unit k. If product p(j) does not have to wat for product
p(j - 1) to nish its processing on unit k, then If it does have to wait, then
Hence Cj,k is the larger of these two values: This equation is solved rst

6.4 Scheduling

55

for Cl,kf or k = 1, . . . ,M , then for C,& for k = 1,2, . . . , M, and so on.


The objective function is simply the completion time of the last job: In a
four-product problem, there are only 4! = 24 possible sequences, so you can
easily write a simple FORTRAN or C program to evaluate the makespan
for an arbitrary sequence, and then call it 24 times and choose the sequence
with the smallest makespan. For larger values of N, one can apply the tabu
search algorithm . Other search procedures (e.g . , evolutionary algorithms
or simulated annealing), can also be developed for this problem. Of course,
these algorithms do not guarantee that an optimal solution will be found.
On the other hand, the time required to solve the mixed-integer programming h u l a t i o n grows rapidly with N, so that approach eventually
becomes impractical. This illustrates that you may be able to develop a simple but e ective search method yourself, and eliminate the need for MILP
optimization software.

The classical solution to a scheduling problem assumes that the required


information is known at the time the schedule is generated and that this a
priori scheduling remains xed for a planning period and is implemented on
the plant equipment. Although this methodology does not compensate for
the many external disturbances and internal disruptions that occur in a real
plant, it is still the strategy most commonly found in industrial practice.
Demand uctuations, process devia tions, and equipment failure all result
in schedule infeasibilities that become apparent during the implementation
of the schedule. To remedy this situation, frequent rescheduling becomes
necessary.
In the rolling horizon rescheduling approach (Baker, 1993), a multiperiod
solution is obtained, but only the rst period is implemented. After one
period has elapsed, we observe the existing inventories, create new demand
forecasts, and solve a new multiperiod problem. This procedure tries to
compensate for the xed nature of the planning model. However, as has
been pointed out by Pekny and Reklaitis (1998), schedules generated in
this fashion generally result in frequent resequencing and reassignment of
equipment and resources, which may induce further changes in successive
schedules rather than smoothing out the production output.
An alternative approach uses a master schedule for planning followed
by a reactive scheduling strategy to accommodate changes by readjusting
the master schedule in a least cost or least change way. The terms able to
promise or available to promise (ATP) indicate whether a given customer,
product, volume, date, or time request can be met for a potential order.
ATP requests might be lled from inventory, unallocated planned production, or spare capacity (assuming additional production). When the production scheduler is content with the current plan, made up of rm orders
and forecast orders, the forecast orders are removed but the planned production is left intact. This produces inventory proles in the model that

56

6. Integrated Planning and Scheduling of processes

represent ATP from inventory and from unallocated planned production


(Baker, 1993; Smith, 1998).
An important simulation tool used in solving production planning and
scheduling problems is the discrete event dynamic system (DEDS), which
gives a detailed picture of the material ows through the production process.
Software for simulating such systems are called discrete event simulators. In
many cases, rules or expert systems are used to incorporate the experience
of scheduling and planning personnel in lieu of a purely optimization-based
approach to scheduling (Bryant, 1993). Expert systems are valuable to assess the eects of changes in suppliers, to locate bottlenecks in the system,
and to ascertain when and where to introduce new orders. These expert systems are used in reactive scheduling when fast decisions need to be made,
and there is no time to generate another optimized production schedule.

6.5 Plantwide Management and Optimization


At the plantwide management and optimization level, engineers strive for
enhancements in the operation of the equipment once it is installed in order to realize the most production, the greatest prot, the minimum cost,
the least energy usage, and so on. In plant operations, benets arise from
improved plant performance, such as improved yields of valuable products (or reduced yields of contaminants), better product quality, reduced
energy consumption, higher processing rates, and longer times between
shut downs. Optimization can also lead to reduced maintenance costs, less
equipment wear, and better sta utilization. Optimization can take place
plantwide or in combinations of units.
The application of real-time optimization (RTO) in chemical plants has
been carried out since the 1960s. Originally a large mainframe computer
was used to optimize process setpoints, which were then sent to analog
controllers for implementation.
In the 1970s this approach, called supervisory control, was incorporated
into computer control systems with a distributed microprocessor architecture called a distributed control system, or DCS (Seborg et al., 1989). In the
DCS both supervisory control and regulatory (feedback) control were implemented using digital computers. Because computer power has increased
by a factor of lo6 over the past 30 years, it is now feasible to solve meaningful optimization problems using advanced tools such as linear or nonlinear
programming in real time, meaning faster than the time between setpoint
changes.
In RTO (level 3), the setpoints for the process operating conditions are
optimized daily, hourly, or even every minute, depending on the time scale
of the process and the economic incentives to make changes. Optimization
of plant operations determines the setpoints for each unit at the tempera-

6.5 Plantwide Management and Optimization

57

tures, pressures, and ow rates that are the best in some sense. For example,
the selection of the percentage
of excess air in a process heater is quite critical and involves a balance
on the fuel-air ratio to ensure complete combustion and at the same time
maximize use of the heating potential of the fuel. Examples of periodic optimization in a plant are minimizing steam consumption or cooling water
consumption, optimizing the reux ratio in a distillation column, blending
of renery products to achieve desirable physical properties, or economically allocating raw materials. Many plant maintenance systems have links
to plant databases to enable them to track the operating status of the
production equipment and to schedule calibration and maintenance. Realtime data from the plant also may be collected by management information
systems for various business functions.
The objective function in an economic model in RTQ involves the costs
of raw materials, values of products, and costs of production as functions of
operating conditions, projected sales or interdepartmental transfer prices,
and so on. Both the operating and economic models typically include constraints on
(a) Operating Conditions: Temperatures and pressures must be within
certain limits.
(b) Feed and Production Rates: A feed pump has a xed capacity; sales
are limited by market projections.
(c) Storage and Warehousing Capacities: Storage tanks cannot be overlled during periods of low demand.
(d) Product Impurities: A product may contain no more than the maximum amount of some contaminant or impurity.
In addition, safety or environmental constraints might be added, such
as a temperature limit or an upper limit on a toxic species. Several steps
are necessary for implementation of RTO, including determining the plant
steady-state operating conditions, gathering and validating data, updating
of model parameters (if necessary) to match current operations, calculating
the new (optimized) setpoints, and implementing these setpoints. An RTO
system completes all data transfer, optimization calculations, and setpoint
implementations before unit conditions change and require a new optimum
to be calculated.
Some of the RTO problems characteristic of level 3 are
1. Reux ratio in distillation .
2. Olen manufacture .
3. Ammonia synthesis .
4. Hydrocarbon refrigeration .
The last example is particularly noteworthy because it represents the
current state of the art in utilizing fundamental process models in RTO.
Another activity in RTO is determining the values of certain empirical parameters in process models from the process data after ensuring that the
process is at steady state. Measured variables including ow rates, temper-

58

6. Integrated Planning and Scheduling of processes

atures, compositions, and pressures can be used to estimate model parameters such as heat transfer coe cients, reaction rate coe cients, catalyst
activity, and heat exchanger fouling factors.
Usually only a few such parameters are estimated online, and then optimization is carried out using the updated parameters in the model. Marlin
and Hrymak (1997) and Forbes et al. (1994) recommend that the updated
parameters be observable, represent actual changes in the plant, and signicantly inuence the location of the optimum; also the optimum of the
model should be coincident with that of the true process. One factor in
modeling that requires close attention is the accurate representation of the
process constraints, because the optimum operating conditions usually lie
at the intersection of several constraints. When RTO is combined with
model predictive regulatory control (see Section 16.4), then correct (optimal) moves of the manipulated variables can be determined using models
with accurate constraints.
Marlin and Hrymak (1997) reviewed a number of industrial applications
of RTO, mostly in the petrochemical area. They reported that in practice a maximum change in plant operating variables is allowable with each
RTO step. If the computed optimum falls outside these limits, you must
implement any changes over several steps, each one using an RTO cycle.
Typically, more manipulated variables than controlled variables exist, so
some degrees of freedom exist to carry out both economic optimization as
well as establish priorities in adjusting manipulated variables while simultaneously carrying out feedback control.

6.6 Resent trends in scheduling


Batch process industries in general are consisting of several products produced in more than one plant in the same premises. Specialty chemicals
and pharmaceutical products are typically produced in batch processes.
The production demand is not xed; it will change as per the market demand. In these industries the production is decided by the market demand.
These industries produce two or more products in one plant in same equipment. Batch process has reduced inventories and/ or shortened response
time compare to continuous processes 15.
2.2 Scheduling of batch processes and representation of the process (RTN,
STN):
Scheduling is a decision-making process that concerns the allocation
of limited resources to competing tasks over time with the goal of optimizing
one or more objectives. The general scheduling problem can be posed as
follows:
Production facility data; e.g., processing unit and storage vessel
capacities, utility availability, unit connectivity.

6.6 Resent trends in scheduling

59

Detailed production recipes; e.g., stoichiometric coe cients, processing times, processing rates, utility requirements.
Production costs; e.g., raw materials, utilities, cleaning, etc.
Production targets or orders with due dates.
The goal of scheduling is to determine
o
The allocation of resources to processing tasks.
o
The sequencing and timing of tasks on processing units.
The objectives functions include the minimization of make span, lateness
and earliness, as well as the minimization of total cost. Scheduling formulations can be broadly classied in to discrete-time models and continuous
time models 16.
Early attempts in modeling the process scheduling problems relied
on the discrete- time approach, in which the time horizon is divided in
to a number of time intervals of uniform durations and events such as
the beginning and ending of a task are associated with the boundaries
of these time intervals. To achieve a suitable approximation of the original
problem, it is usually needed to use a time interval that is su ciently small,
for example, the greatest common factor (GCF) of the processing times.
This usually leads to very large combinatorial problems of intractable size,
especially for real-world problems, and hence limits its applications. The
basic concept of the discrete-time approach is illustrated in Fig (2.1).
Continuous-time models events are potentially allowed to take place at
any point in the continuous domain of time. Modeling of this exibility is
accomplished by introducing the concepts of variable event times, which
can be dened globally or for each unit. Variables are required to determine the timings of events. The basic idea of the continuous-time approach
is also illustrated in Fig (2.2). Because of the possibility of eliminating
a major fraction of the inactive event-time interval assignments with the
continuous-time approach, the resulting mathematical programming problems are usually of much smaller sizes and require less computational eorts
for their solution. However, due to the variable nature of the timings of the
events, it becomes more challenging to model the scheduling process and
the continuous-time approach may lead to mathematical models with more
complicated structures compared to their discrete-time counterparts.
Network represented processes are involve in most scheduling problems.
When the production recipes become more complex and/or dierent products have low recipe similarities, processing networks are used to represent
the production sequences. This corresponds to a more general case in which
batches can merge and/or split and material balances are required to be

60

6. Integrated Planning and Scheduling of processes

FIGURE 6.2. Recipe networks

taken in to account explicitly. The state-task network and resource-task


network are generally used in scheduling problems 17.
Model -based batch scheduling methodologies can be grouped into two
types: monolithic and sequential approaches Monolithic approaches are
those which simultaneously determine the set of tasks to be scheduled, the
allocation of manufacturing resources to tasks and the sequence of tasks at
any equipment unit. Monolithic scheduling models are quite general; they
are more oriented towards the treatment of arbitrary network processes
involving complex product recipes. They are based on either the state-task
network (STN) or the resource-task network (RTN) concepts to describe
production recipes 18.

6.6.1 State-Task Network (STN):


The established representation of batch processes is in terms of recipe
networks4. These are similar to the ow sheet representation of continuous
plants but are intended to describe the process itself rather than a specic
plant. Each node on a recipe network corresponds a task, with directed
arcs between nodes representing task precedence. Although recipe networks
are certainly adequate for serial processing structures, they often involve
ambiguities when applied to more complex ones. Consider, for instance, the
network of ve tasks shown in Fig (2.3).
It is not clear from this representation whether task 1 produces two
dierent products, forming the inputs of tasks 2 and 3 respectively, or

6.6 Resent trends in scheduling

61

FIGURE 6.3. STN representation

whether it has only one type of product which is then shared between 2 and
3. Similarly, it is also impossible to determine from Fig (2.3) whether task 4
requires two dierent types of feed stocks, respectively produced by tasks 2
and 5, or whether it only needs one type of feedstock which can be produced
by either 2 or 5. Both interpretations are equally plausible. The former
could be the case if, say, task 4 is a catalytic reaction requiring a main
feedstock produced by task 2, and a catalyst which is then recovered from
the reaction products by the separation task 5. The latter case could arise
if task 4 were an ordinary reaction task with a single feedstock produced by
2, with task 5 separating the product from the unreacted material which
is then recycled to 4.
The distinctive characteristic of the STN is that it has two types of
nodes; namely, the state nodes, representing the feeds, intermediate and
nal products and the task nodes, representing the processing operations
which transform material from one or more input states to one or more
output states. State and task nodes are denoted by circles and rectangles,
respectively.
State-task networks are free from the ambiguities associated with recipe
networks. Figure (2.4) shows two dierent STNs, both of which correspond
to the recipe network of Fig (2.3). In the process represented by the STN
of Fig (2.4a), task 1 has only one product which is then shared by tasks
2 and 3. Also, task 4 only requires one feedstock, which is produced by
both 2 and 5. On the other hand, in the process shown in Fig (2.4b), task 1
has two dierent products forming the inputs to tasks 2 and 3, respectively.

62

6. Integrated Planning and Scheduling of processes

Furthermore, task 4 also has two dierent feedstocks, respectively produced


by tasks 2 and 5.
Bhattacharya et.al. (2009) proposes a mathematical model based on
State Task Network representation for generating optimal schedule for a sequence of n continuous processing units responsible for processing m products. Each product line has xed capacity storage tanks before and after
every unit. Each unit can process only one product line at any point of time.
However, the inputs for all the product lines arrive simultaneously at the input side of the rst unit, thus giving rise to the possibility of spillage. There
can be multiple intermediate upliftments of the nished products. An optimal schedule of the units attempts to balance among spillage, changeover
and upliftment failures. They develop an MINLP model for the problem
19.
Ierapetritou et.al. (2004) proposed a new cyclic scheduling approach is
based on the state-task network (STN) representation of the plant and a
continuous-time formulation. Assuming that product demands and prices
are not uctuating along the time horizon under consideration, the proposed formulation determines the optimal cycle length as well as the timing
and sequencing of tasks within a cycle. This formulation corresponds to a
non-convex mixed integer nonlinear programming (MINLP) problem, for
which local and global optimization algorithms are used and the results are
illustrated for various case studies 7.

6.6.2 Resource Task Network (RTN):


RTN-based mathematical formulations can either be discrete-time or continuoustime formulations. The original is a discrete-time formulation, where the
time horizon of interest is discretized into a xed number (T) of uniform
time intervals. The RTN regards all processes as bipartite graphs comprising two types of nodes: Resources and Tasks. A task is an operation
that transforms a certain set of resources into another set. The concept
of resource is entirely general and includes all entities that are involved
in the process steps, such as materials (raw-materials, intermediates and
products), processing and storage equipment (tanks, reactors, etc.), utilities
(operators, steam, etc.) as well as equipment conditions (clean, dirty).
The simple motivating example involving a multipurpose batch plant
that requires one raw material and produces two intermediates and one
nal product. The RTN for this example is presented by Shaik et.al. (2008)
shown in Fig (2.5). The raw material is processed in three sequential tasks,
where the rst task is suitable in two units (J1 and J2), the second task
is suitable in one unit (J3), and the third task is suitable in two units (J4
and J5). The equipment resources (units) are shown using double arrow
connectors, indicating that the task consumes this resource at the beginning
of the event and produces the same resource at the end of the event point.
A task which can be performed in dierent units is considered as multiple,

6.6 Resent trends in scheduling

63

FIGURE 6.4. RTN representation

separate tasks, thus leading to ve separate tasks (i=1, . . ., 5), each suitable
in one unit 3.
Shaik et.al. (2008) propose a new model to investigate the RTN representation for unit-specic event-based models. For handling dedicated nite
storage, a novel formulation is proposed without the need for considering
storage as a separate task. The performance of the proposed model is evaluated along with several other continuous-time models from the literature
based on the STN and RTN process representations 3.
Grossmann et.al. (2009) consider the solution methods for mixed-integer
linear fractional programming (MILFP) models, which arise in cyclic process
scheduling problems. Dinkelbachs algorithm is introduced as an e cient
method for solving large-scale MILFP problems for which its optimality
and convergence properties are established. Extensive computational examples are presented to compare Dinkelbachs algorithm with various MINLP
methods. To illustrate the applications of this algorithm, we consider industrial cyclic scheduling problems for a reactionseparation network and a
tissue paper mill with byproduct recycling. These problems are formulated
as MILFP models based on the continuous time Resource-Task Network
(RTN) 21.

6.6.3 Optimum batch schedules and problem formulations


(MILP),MINLP B&B:
Grossmann et.al. (2006) presents a multiple time grid continuous time
MILP model for the short-term scheduling of single stage, multi product
batch plants. It can handle both release and due dates and the objective
can be either the minimization of total cost or total earliness. This formulation is compared to other mixed-integer linear programming approaches,
to a constraint programming model, and to a hybrid mixed-integer linear/constraint programming algorithm. The results show that the proposed
formulation is signicantly more e cient than the MILP and CP models
and comparable to the hybrid model 22.
Mixed Integer Linear Programming (MILP) model is used for the solution of N-dimensional allocation problems. Westerlund et.al. (2007), use

64

6. Integrated Planning and Scheduling of processes

Mixed Integer Linear Programming (MILP) model and solve the one-dimensional
scheduling problems, two-dimensional cutting problems, as well as plant
layout problems and three-dimensional packing problems. Additionally,
some problems in four dimensions are solved using the considered model
23.
Magatao et.al. (2004), present the problem of developing an optimisation
structure to aid the operational decision-making of scheduling activities in
a real-world pipeline scenario. The pipeline connects an inland renery to
a harbour, conveying dierent types of oil derivatives. The optimisation
structure is developed based on mixed integer linear programming (MILP)
with uniform time discretisation, but the MILP well-known computational
burden is avoided by the proposed decomposition strategy, which relies on
an auxiliary routine to determine temporal constraints, two MILP models,
and a database 24.
A new mixed-integer programming (MIP) formulation is presented for
the production planning of single-stage multi-product processes. The problem is formulated as a multi-item capacitated lot-sizing problem in which
(a) multiple items can be produced in each planning period, (b) sequenceindependent set-ups can carry over from previous periods, (c) set-ups can
cross over planning period boundaries, and (d) set-ups can be longer than
one period. The formulation is extended to model time periods of nonuniform length, idle time, parallel units, families of products, backlogged
demand, and lost sales 25.
Bedenik et.al. (2004) describes an integrated strategy for a hierarchical multilevel mixed-integer nonlinear programming (MINLP) synthesis of
overall process schemes using a combined synthesis/analysis approach. The
synthesis is carried out by multilevel-hierarchical MINLP optimization of
the exible superstructure, whilst the analysis is performed in the economic
attainable region (EAR). The role of the MINLP synthesis step is to obtain
a feasible and optimal solution of the multi-D process problem, and the role
of the subsequent EAR analysis step is to verify the MINLP solution and
in the feedback loop to propose any protable superstructure modications
for the next MINLP. The main objective of the integrated synthesis is to
exploit the interactions between the reactor network, separator network
and the remaining part of the heat/energy integrated process scheme 26.
Grossmann et.al. (2009) consider the solution methods for mixed-integer
linear fractional programming (MILFP) models, which arise in cyclic process
scheduling problems. They rst discuss convexity properties of MILFP
problems, and then investigate the capability of solving MILFP problems
with MINLP methods. Dinkelbachs algorithm is introduced as an e cient
method for solving large-scale MILFP problems for which its optimality
and convergence properties are established. Extensive computational examples are presented to compare Dinkelbachs algorithm with various MINLP
methods 21.

6.6 Resent trends in scheduling

65

Cyclic scheduling is commonly utilized to address short-term scheduling


problems for multi product batch plants under the assumption of relatively
stable operations and product demands. It requires the determination of optimal cyclic schedule, thus greatly reducing the size of the overall scheduling
problems with large time horizon. The proposed formulation determines the
optimal cycle length as well as the timing and sequencing of tasks within a
cycle. This formulation corresponds to a non-convex mixed integer nonlinear programming (MINLP) problem, for which local and global optimization algorithms 7. Floudas et.al. (1998a) presents a novel mathematical
formulation for the short-term scheduling of batch plants. The proposed
formulation is based on a continuous time representation and results in a
mixed integer linear programming (MILP) problem 27.
Reklaitis et.al. (1999) proposed a MINLP formulation using the statetask network (STN) representation. They proposed a Bayesian heuristic approach to solve the resulting non convex model 4. Grossmann et.al. (1991)
presented a reformulation of the multi-period based MILP model based on
lot-sizing. The main strength of this formulation is that it provides a tighter
LP relaxation leading to better solutions than the earlier MILP formulation
28.
Kondili et.al. (1993) studied the problem of planning a multi product
energy-intensive continuous cement milling plant. They utilized a hybrid
discrete-continuous time formulation considering discrete time periods and
time slots of varying duration. The resulting mixed integer linear programming (MILP) problem was solved with conventional MILP solvers based
on branch and bound (B&B) principles. Towards developing e cient mathematical models to address the short-term scheduling problem, attention
has been given to continuous-time representations 29. Floudas et.al. (1998a,
1998b) developed a continuous-time formulation for the short-term scheduling problem that requires less number of variables and constraints 27, 30.

6.6.4 Multi-product batch plants:


Multistage, multi-product batch plants with parallel units in one or more
stages abound in the batch chemical industry. In such plants, scheduling of
operations is an essential, critical, and routine activity to improve equipment utilization, enhance on-time customer delivery, reduce setups and
waste, and reduce inventory costs. The most research on batch process
scheduling has focused on serial multi product batch plants or single-stage
non continuous plants, scheduling of multistage, multi product batch plants
has received limited attention in the literature in spite of the industrial signicance of these plants 7. Multi product batch plants, in which every
product follows the same sequence through all the process steps, or as
multi-purpose batch plants, in which each product follows its own distinct
processing sequence by using the available equipment in a product-specic
layout 1.

66

6. Integrated Planning and Scheduling of processes

Kondili et.al. (1993) studied the problem of planning a multi product


energy-intensive continuous cement milling plant. They utilized a hybrid
discrete-continuous time formulation considering discrete time periods and
time slots of varying duration [29].
The cyclic scheduling of cleaning and production operations in multi
product multistage plants with performance decay. A mixed-integer nonlinear programming (MINLP) model based on continuous time representation
is proposed that can simultaneously optimize the production and cleaning
scheduling. The resulting mathematical model has a linear objective function to be maximized over a convex solution space thus allowing globally
optimal solutions to be obtained with an outer approximation algorithm
7. Majozi et.al. (2009) presents a methodology for wastewater minimisation in multipurpose batch plants characterized by multiple contaminant
streams. The methodology is based on an existing scheduling framework
which then makes it possible to generate the required schedule to realize
the absolute minimum wastewater generation for a problem. The methodology involves a two step solution procedure. In the rst step the resulting
MINLP problem is linearized and solved to provide a starting point for the
exact MINLP problems 31.
.

6.6.5 Waste water minimization (Equalization tank super


structure):
Wastewater minimization in batch plants is gaining importance as the need
for industry to produce the least amount of e- uent becomes greater. This
is due to increasingly stringent environmental legislation and the general
reduction in the amount of available freshwater sources. Wastewater minimization in batch plants has not been given su cient attention in the past.
Smith et.al. (1995) proposed one of the rst methodologies for wastewater
minimization in batch processes 32. Smith et.al. (1994) proposed methodology was an extension of their graphical water pinch method. This method
dealt with single contaminant wastewater minimization, where it was assumed that the optimal process schedule was known a priori. The method
employed a number of water storage vessels to overcome the discontinuous
nature of the operation 33.
Mazozi et.al. (2005a) proposed a mathematical methodology where the
corresponding plant schedule is determined that achieves the wastewater
target. In doing this the true minimum wastewater target can be identied
34. This methodology was latter extended to include multiple contaminants
with multiple storage vessels by Majozi et.al. (2008) 35. The methodology
presented by Majozi et.al. (2009) explores the usage idle processing units as
inherent storage for wastewater. The methodology is derived for the single
contaminant case and can deal with two types of problems. In the rst type

6.6 Resent trends in scheduling

67

of problem the minimum wastewater target and corresponding minimum


wastewater storage vessel is determined considering inherent storage. The
second problem is centred on the determination of the minimum wastewater
target where the size of the central storage vessel is xed and inherent
storage is available. In the second type of problem the size of the central
storage limits wastewater reuse 31.
Most of the studies published in literature have dealt with the issue of
minimizing waste using processes separately from the design of e- uent
treatment systems. A conceptual approach has been used to minimize the
wastewater generation in process industries 33. Graphical techniques have
been presented to set targets for the minimum ow rate in a distributed
e- uent system and to design such systems 36, 37.
Shoaib et.al. (2008) addresses the problem of synthesising cost-eective
batch water networks where a number of process sources along with fresh
water are mixed, stored, and assigned to process sinks. In order to address
the complexity of the problem, a three-stage hierarchical approach is proposed. In the rst stage, global targets are identied by formulating and
solving a linear transportation problem for minimum water usage, maximum water recycle, and minimum wastewater discharge. These targets are
determined a priori and without commitment to the network conguration
38.
Manan et al., (2004) has proved its validity in identifying correct water
network targets that include the minimum fresh water and wastewater
ow rate targets, the global pinch location and water allocation targets.
A key assumption in that work is that water sources of dierent impurity
concentrations are not allowed to mix in the same water storage tank. This
is a limitation that may lead to an excessive number of storage tanks. A
water stream chart which can identify the possibility for direct water reuse
was built. This model included tank capacity, stream concentration upper
bounds and time constraints 39.
Chang et.al. (2006) proposed a general mathematical programming model
is developed to design the optimal buer system for equalizing the owrates and contaminant concentrations of its outputs. The demands for heating/cooling utilities in a batch plant arise intermittently and their quantities vary drastically with time, the generation rates of the resulting spent
waters must also be time dependent. A buer tank can thus be used at the
entrance of each utility system to maintain a steady throughput. The capital cost of a wastewater treatment operation is usually proportional to its
capacity. Thus, for economic reasons, ow equalization is needed to reduce
the maximum ow-rate of wastewater entering the treatment system 10.
A buer system may also be installed to equalize the wastewater owrates and pollutant concentrations simultaneously. The inputs of this equalization system can be the spent utility waters or wastewaters generated
from various batch operations, and the outputs can be considered to be

68

6. Integrated Planning and Scheduling of processes

FIGURE 6.5. Super structure of equilisation tanks

the feeds to dierent utility-producing equipments, wastewater-treatment


units and/or discharge points 10.
Li et.al. (2002a,b) adopted both a conceptual design approach and also a
mathematical programming model to eliminate the possibility of producing
an unnecessarily large combined water ow at any instance by using a buer
tank and by rescheduling the batch recipe 13, 14. Later, Li et.al. (2003) used
a two-tank conguration to remove peaks in the prole of total wastewater
ow-rate and also in that of one pollutant concentration [40.
A proper design of the water equalization system includes at least
the following specications:
(1) The needed size of each buer tank,
(2) The network conguration, and
(3) The time proles of the ow-rate and pollutant concentrations of the
water stream in every branch of the equalization network.
Super structure of Equalization system presented by Chang et.al. (2006):

6.6.6 Selection of suitable equalization tanks for controlled


ow:
The e- uent generated from batch plant is treated in a continuous operated e- uent treatment plant. Discharge of the e- uent generated from each
one of these plant is discontinuous in nature. Quality and quantity of the
e- uent generated depend on the products produced and their quantities.
In such case selection of suitable equalization tanks plays major role. Select a equalization tank in such a way that the overow will not occur
and the contaminant concentration will not to high in the discharge of this
equalization tank under the following conditions.
If the production quantities are drastically increase
If the batch failure will occur.

6.6 Resent trends in scheduling

69

If the sudden shout down has taken place


The equalization tank design in such a way that the contaminant concentrations will high then the concentration of e- uent will be equalize. In
some cases two equalization tanks are needed, one is lower concentration
and another is higher concentration. So that the e- uent discharge from
the equalization tank has equalized concentration and suitable ow rate
are going to e- uent treatment plant and decrease the shock load of ETP.

70

6. Integrated Planning and Scheduling of processes

This is page 71
Printer: Opaque this

7
Dynamic Optimization

Interest in dynamic simulation and optimization of chemical processes has


increased signicantly in process industries over the past two decades. This
is because process industries are driven by strongly competitive markets
and have to face ever-tighter performance specications and regulatory
limits. The transient behavior of chemical processes is typically modeled
by ordinary dierential equations (ODEs), dierential/algebraic equations
(DAEs), or partial dierential/algebraic equations (PDAEs). These equations describe mass, energy, and momentum balances and thus ensure physical and thermodynamic consistency. Due to the now widespread industrial
use of dynamic process modeling, dynamic models are increasingly developed and applied. It is then natural to ask what other applications might
exploit the resources invested in the development of such models. Dynamic
optimization is a natural extension of these dynamic simulation tools because it automates many of the decisions required for engineering studies.
It consists of determining values for input/control proles, initial conditions, and/or boundary conditions of a dynamic system that optimize its
performance over some period of time. Examples of dynamic optimization
tasks include: determination of optimal control proles for batch processes;
determination of optimal changeover policies in continuous processes, optimizing feeding strategies of various substrates in semi batch fermenters
to maximize the productivity, and tting of chemical reaction kinetic parameters to data.
A general formulation of the dynamic optimization problem can be stated
as,

72

7. Dynamic Optimization

min J = G(x(tf ); y(tf ); u(tf ) +

u(t);tf

h
y(t)

L(x(t)); y(t); u(t); t); t 2 [to ; tf ] (7.1)

: s:t:x = f (x; u)
= l(x; u)

x(to) : xo

u min

ymin
u(t)

y(t)
umax

(7.2)
(7.3)

(7.4)

ymax

(7.5)
(7.6)

where t0 and tf denote the initial and nal transition times and vectors x(t), y(t) and u(t) represent the state, output and input trajectories.
Vector functions h and g are used to denote all equality and inequality constraints, respectively. Equations 1b,c represent the process model, whereas
equation 1d represents the process and safety constraints. The solution of
the above problem yields dynamic proles of manipulated variables u(t) as
well as the grade changeover time, tf t0. Equation 1 may be solved with
a standard NLP solver through use of CVP, where manipulated variables
are parameterized and approximated by a series of trial functions . Thus,
for the ith manipulated variable,
ui (t) =

na
X

aij

ij (t

tij )

(7.7)

j=1

where tij is the jth switching time of the ith manipulated variable, na is
the number of switching intervals, and aij represents the amplitude of the
ith manipulated variable at the switching time tij.
necessary steps that integrate CVP with the model equations and the
NLP solver are summarized below,
Step 1. Discretize manipulated variables by selecting an appropriate trial
function (see equation 2)
Step 2. Integrate the process model (Equation 1b,c) and the ODE sensitivities (Equations 3) if using a gradient-based solver and the manipulated
variables as inputs
Step 3. Compute the objective function (Equation 1a) and gradients if
necessary

7.1 Dynamic programming

73

Step 4. Provide this information to the NLP solver and iterate starting
with step 2 until an optimal solution is found
Step 5. Construct the optimal recipes using the optimal amplitude and
switching intervals obtained by the NLP solver.
An alternative strategy eliminates Step 2 by discretizing the continuous
process model by simultaneously treating both, the state variables and the
parameterized manipulated variables as decision variables.
In this workshop, we will focus on problem formulation, solution approach, and demonstrating its application to a polymerization reactor for
optimal product grade transition. We shall use MATLAB tool for solving
a dynamic optimization problem solution.

7.1 Dynamic programming


Dynamic programming is based on Bellmans principle of optimality, as
described below.
An optimal policy has the property that whatever the initial state and
initial decision are the remaining decisions must constitute an optimal policy with
regard to the state resulting from the rst decision.
In short, the principle of optimality states that the minimum or maximum value (of a function) is a function of the initial state and the initial
time.
In the calculus of variations, we locate a curve as a locus of points ,
whereas dynamic programming considers a curve to be an envelope of tangents. In that sense, the two theories are dual to each other. However, the
duality and equivalence remain valid only for deterministic processes.
Dynamic programming is best suited for multistage processes, where
these processes can be decomposed into n stages as shown in Figure .
However, application of the dynamic programming technique to a continuously operating system leads to nonlinear partial dierential equations, the
HamiltonJacobiBellman (H-J-B) equation that can be tedious to solve.
A brief derivation of the H-J-B equation is given below. For details, please
refer to Bellman (1957), Aris (1961), and Kirk (1970).
The advantage of dynamic programming over the other methods is that
it is possible to use dynamic programming when the constraints are stochastic, as is discussed in the next section. However, dynamic programming
formulation leads to a solution of partial dierential equations that can be
tedious to solve. Recently, a rst version of the stochastic maximum principle was presented using the analogy between dynamic programming and
the maximum principle. Interested readers are referred to Rico-Ramirez
and Diwekar(2004). In the last section of this chapter, we present a real-

74

7. Dynamic Optimization

FIGURE 7.1. Calculus of variations and dynamic programming

world case study where we show that a problem solution can be simplied
when one uses a combination of these methods.

This is page 75
Printer: Opaque this

8
Global Optimisation Techniques

8.1 Introduction
Tradictional optimisation techniques have the limitation of getting traped
in the local optimum. To over come this problem some optimisation techniques based on the natural phenomena are proposed. Some stocastic optimisation techniques which are popular are presented in the following sections

8.2 Simulated Annealing


8.2.1 Introduction
This optimization technique resembles the cooling process of molten metals
through annealing. The atoms in molten metal can move freely with respect
to each other at high temperatures. But the movement of the atoms gets
restricted as the temperature is reduced. The atoms start to get ordered
and nally form crystals having the minimum possible energy. However, the
formation of crystals mostly depends on the cooling rate. If the temperature
is reduced at a very fast rate, the crystalline state may not be achieved
at all, instead, the system may end up in a polycrystalline state, which
may have a higher energy than the crystalline state. Therefore, in order to
achieve the absolute minimum energy state, the temperature needs to be

76

8. Global Optimisation Techniques

reduced at a slow rate. The process of slow cooling is known as annealing


in metallurgical parlance.
The simulated annealing procedure simulates this process of slow cooling
of molten metal to achieve the minimum value of a function in a minimization problem. The cooling phenomenon is simulated by controlling a
temperature-like parameter introduced with the concept of the Boltzmann
probability distribution. According to the Boltzmann probability distribution, a system in thermal equilibrium at a temperature T has its energy
distributed probabilistically according to P(E) = exp (-EAT), where k is
the Boltzmann constant. This expression suggests that a system at high
temperature has almost uniform probability of being in any energy state,
but at low temperature it has a small probability of being in a high energy
state.
Therefore, by controlling the temperature T and assuming that the search
process follows the Boltzmann probability distribution, the convergence of
an algorithm can be controlled. Metropolis et al. (1953) suggested a way to
implement the Boltzmann probability distribution in simulated thermodynamic systems. This can also be used in the function minimization context.
Let us say, at any instant the current point is x) and the function value
at that point is E(t) =f(x()). Using the Metropolis algorithm, we can say
that the probability of the next point being at
x" + ) depends on the dierence in the function values at these two
points or on AE = E(f + 1) -E(f) and is calculated using the Boltzmann
probability distribution: If cnE I 0, this probability is 1 and the point x(
+ ) is always accepted. In the function minimization context, this makes
sense because if the function value at x" + ) is better than that at x(), the
point x(+ ) must be accepted. An interesting sjtuation results when AE
> 0, which implies that the function value at x( + ) is worse than that
at x(). According to many traditional algorithms, the point x" ) must
not be chosen in this situation. But according to the Metropolis algorithm,
there is some nite probability of selecting the point x(+ even though it is
worse than the point x(). However, this probability is not the same in all
situations. This probability depends on the relative magnitude of AE and
T values. If the parameter T is large, this probability is more or less high
for points with largely disparate function values. Thus, any point is almost
acceptable for a large value of T. On the other hand, if the parameter T is
small, the probability of accepting an arbitrary point is small. Thus, for
small values of T, the points with only a small deviation in the function
value are accepted.
Simulated annealing (Laarhoven & Aarts 1987) is a point-by-point method.
The algorithm begins with an initial point and a high temperature T. A
second point is created at random in the vicinity of the initial point and
the dierence in the function values (AE) at these two points is calculated.
If the second point has a smaller function value, the point is accepted; otherwise the point is accepted with probability exp (-AE/T). This completes

8.3 GA

77

one iteration of the simulated annealing procedure. In the next generation,


another point is created at random in the neighbourhood of the current
point and the Metropolis algorithm is used to accept or reject the point. In
order to simulate the thermal equilibrium at every temperature, a number
of points (n) are usually tested at a particular temperature before reducing the temperature. The algorithm is terminated when a su ciently small
temperature is obtained or a small enough change in function values is
found.
Step 1 Choose an initial point X(), a termination criterion E. Set T
su ciently high, number of iterations to be performed at a particular temperature n, and set t = 0.
Step 2 Calculate a neighbouring point x") = N(x()). Usually, a random
point in the neighbourhood is created.
Step 3 If AE = E(x( + ") - E(x()) c 0, set t = t + 1 ; else create a
random number r in the range (0,l). If r 5 exp (-AE/T), set t = t + 1; else
go to step 2.
Step 4 If Ix(+ - x()l c E and T is small, terminate; else if (t mod n) = 0,
then lower T according to a cooling schedule. Go to step 2; else go to step
2. The initial temperature T and the number of iterations (n) performed at
a particular temperature are two important parameters which govern the
successful working of the simulated annealing procedure. If a large initial
T is chosen, it takes a number of iterations for convergence. On the other
hand, if a small initial T is chosen, the search is not adequate to thoroughly
investigate the search space before converging to the true optimum. A large
value of n is recommended in order to achieve a quasi-equilibrium state at
each temperature, but the computation time is more.
Unfortunately, there are no unique values of the initial temperature and
n that work for every problem. However, an estimate of the initial temperature can be obtained by calculating the average of the function values
at a number of random points in the search space. A suitable value of n
can be chosen (usually between 20 and 100) depending on the available
computing resources and the solution time. Nevertheless, the choice of the
initial temperature and the subsequent cooling schedule still remain an art
and usually require some trial-and-error eorts.

8.3 GA
8.3.1 Introduction
Genetic algorithms (GAS) are used primarily for optimization purposes.
They belong to the goup of optimization methods known as non-traditional
optimization methods.
Non-traditional optimization methods also include optimization techniques such as neural networks (simulated annealing, in particular). Simu-

78

8. Global Optimisation Techniques

lated annealing is an optimization method that mimics the cooling of hot


metals, which is a natural phenomenon. Through this mode of simulation,
this method is utilized in optimization problems.
Just like simulated annealing, GAS try to imitate natural genetics and
natural selection, which are natural phenomena. The main philosophy behind GA is survival of the ttest. As a result of this, GAS are primarily
used for maximization problems in optimization.
GAS do not suer from the basic setbacks of traditional optimization
methods, such as getting stuck in local minima. This is because GAS work
on the principle of natural genetics, which incorporates large amounts of
randomness and does not allow stagnation.

8.3.2 Denition
Genetic algorithms are computerized search and optimization algorithms
based on the mechanics of natural genetics and natural selection. Consider
a maximization problem Maximize f ( x ) x;l) 5 xi 5 xi(u) i = 1, 2, ..., N
This is an unconstrained optimization problem. Our aim is to nd the
maximum of this function by using GAS. For the implementation of GAS,
there are certain well-dened steps.

8.3.3 Coding
Coding is the method by which the variables xi are coded into string structures. This is necessary because we need to translate the range of the function in a way that is understood by a computer. Therefore, binary coding
is used. This essentially means that a certain number of initial guesses are
made within the range of the function and these are transformed into a binary format. It is evident that for each guess there might be some required
accuracy. The length of the binary coding is generally chosen with respect
to the required accuracy.
For example, if we use an eight-digit binary code. (0000 0000) would
represent the minimum value possible and (1 11 1 11 11) would represent
the maximum value possible.
A linear mapping rule is used for the purpose of coding:(/) x y - x!/) xi
= xi + (decoded value) 2Il - 1
The decoded value (of si, the binary digit in the coding) is given by the
rule / - I .I ~ Decoded value = C2si i=O
where
s; E (0, 1) (10.4)
For example, for a binary code (01 1 1), the decoded value will be (0111)
= (112~+ (112~+ (1p2+ (012~= 7
It is also evident that for a code of length 1, there are 2combinations or
codes possible. As already mentioned, the length of the code depends upon
the required accuracy for that variable. So, it is imperative that there be a

8.3 GA

79

method to calculate the required string length for the given problem. So,
in general, Eq. is used for this purpose.
So, adhering to the above-mentioned rules, it is possible to generate a
umber of guesses or, in other words, an initial population of coded points
that lie in the given range of the function. Then, we move on to the next
step, that is, calculation of the tness.

8.3.4 Fitness
As has already been mentioned, GAS work on the principle of survival
of the ttest. This in eect means that the good points or the points
that yield maximum values for the function are allowed to continue in
the next generation, while the less protable points are discarded from our
calculations. GAS maximize a given function, so it is necessary to transform
a minimization problem to a maximization problem before we can proceed
with our computations.
Depending upon whether the initial objective function needs to be maximized or minimized, the tness function is hence dened in the following
ways: for a minimization problem It should be noted that this transformation does not alter the location of the minimum value. The tness function
value for a particular coded string is known as the strings tness. This
tness value is used to decide whether a particular string carries on to the
next generation or not.
GA operation begins with a population of random strings. These strings
are selected from a given range of the function and represent the design or
decision variables. To implement our optimization routine, three operations
are carried out:
F(x) =Ax) for a maximization problem - 1 1 + f(x>
1. Reproduction
2. Crossover
3. Mutation

8.3.5 Operators in GA
Reproduction
The reproduction operator is also called the selection operator. This is
because it is this operator that decides the strings to be selected for the next
generation. This is the rst operator to be applied in genetic algorithms.
The end result of this operation is the formation of a mating pool, where
the above average strings are copied in a probabilistic manner. The rule can
be represented as a (tness of string) Probability of selection into mating
pool The probability of selection of the ith string into the mating pool is
given by where Fi is the tness of the ith string. Fj is the tness of thejth
string, and n is the population size.

80

8. Global Optimisation Techniques

The average tness of all the strings is calculated by summing the tness
of individual strings and dividing by the population size, and is represented
by the symbol F: - i=l F = - n
It is obvious that the string with the maximum tness will have the most
number of copies in the mating pool. This is implemented using roulette
wheel selection. The algorithm of this procedure is as follows. Roulette
wheel selection
Step I Using Fi calculate pi.
Step 2 Calculate the cumulative probability Pi.
Step 3 Generate n random numbers (between 0 and 1).
Step 4 Copy the string that represents the chosen random number in the
cumulative probability range into the mating pool. A string with higher
tness will have a larger range in the cumulative probability and so has
more probability of getting copied into the mating pool.
At the end of this implementation, all the strings that are t enough
would have been copied into the mating pool and this marks the end of the
reproduction operation.
Crossover
After the selection operator has been implemented, there is a need to introduce some amount of randomness into the population in order to avoid
getting trapped in local searches. To achieve this, we perform the crossover
operation. In the crossover operation, new strings are formed by exchange
of information among strings of the mating pool. For example,
oo/ooo - 00~111
Crossover point
lljlll
Parents Children
Strings are chosen at random and a random crossover point is decided,
and crossover is performed in the method shown above. It is evident that,
using this method, better strings or worse strings may be formed. If worse
strings are formed, then they will not survive for long, since reproduction
will eliminate them. But what if majority of the new strings formed are
worse? This undermines the purpose of reproduction. To avoid this situation, we do not select all the strings in a population for crossover. We
introduce a crossover probability (p,). Therefore, (loop,)% of the strings
are used in crossover. ( 1 - p,)% of the strings is not used in crossover.
Through this we have ensured that some of the good strings from the
mating pool remain unchanged. The procedure can be summarized as follows: Step I Select (loop,)% of the strings out of the mating pool at random.
Step 2 Select pairs of strings at random (generate random numbers that
map the string numbers and select accordingly).
Step 3 Decide a crossover point in each pair of strings (again, this is
done by a random number generation over the length of the string and

8.4 Dierential Evolution

81

the appropriate position is decided according to the value of the random


number).
Step 4 Perform the crossover on the pairs of strings by exchanging the
appropriate bits.
Mutation
Mutation involves making changes in the population members directly, that
is, by ipping randomly selected bits in certain strings. The aim of mutation
is to change the population members by a small amount to promote local
searches when the optimum is nearby. Mutation is performed by deciding
a mutation probability pm and selecting strings, on which mutation is to
be performed, at random. The procedure can be summarized as follows:
Step 1 Calculate the approximate number of mutations to be performed
by Approx no. of mutations = nlp, (10.11)
Step 2 Generate random numbers to decide whether mutation is to be
performed on a particular population member or not. This is decided by
a coin toss. That is, select a random number range to represent true and
one to represent false. If the outcome is true, perform mutation, if false, do
not.
Step 3 If the outcome found in step 2 is true for a particular population
member, then generate another random number to decide the mutation
point over the length of the string. Once decided, ip the bit corresponding
to the mutation point. With the end of mutation, the strings obtained
represent the next generation. The same operations are carried out on this
generation until the optimum value is encountered.

8.4 Dierential Evolution


8.4.1 Introduction
Dierential evolution (DE) is a generic name for a group of algorithms that
are based on the principles of GA but have some inherent advantages over
GA.
DE algorithms are very robust and e cient in that they are able to nd
the global optimum of a function with ease and accuracy. DE algorithms
are faster than GAS.
GAS evaluate the tness of a point to search for the optimum. In other
words, GAS evaluate a vectors suitability. In DE, this vectors suitability is
called its cost or prot depending on whether the problem is a minimization
or a maximization problem.
In GAS only integers are used and the coding is done in binary format;
in DE, no coding is involved and oating-point numbers are directly used.

82

8. Global Optimisation Techniques

If GAS are to be made to handle negative integers, then the coding


becomes complicated since a separate signed bit has to be used; in DE,
this problem does not arise at all.
XOR Versus Add
In GAS when mutation is performed, bits are ipped at random with
some mutation probability. This is essentially an XOR operation. In DE,
direct addition is used.For example, In GA, 16 = 10,000 and 15 = 01111
(after mutation). In DE, 15 As is evident, the computation time for ipping
four bits and encoding and decoding the numbers in GAS is far more than
the simple addition operationperformed in the case of DE. The question
that remains is how to decide how much to add? This is the main philosophy
behind DE. = 16 + (-1).

8.4.2 DE at a Glance
As already stated, DE in principle is similar to GA. So, as in GA, we use a
population of points in our search for the optimum. The population size is
denoted by NP. The dimension of each vector is denoted by D. The main
operation is the NP number of competitions that are to be carried out to
decide the next generation.
To start with, we have a population of NP vectors within the range of
the objective function. We select one of these NP vectors as our target
vector. We then randomly select two vectors from the population and nd
the dierence between them (vector subtraction). This dierence is multiplied by a factor F (specied at the start) and added to a third randomly
selected vector. The result is called the noisy random vector. Subsequently,
crossover is performed between the target vector and the noisy random
vector to produce the trial vector. Then, a competition between the trial
vector and the target vector is performed and the winner is replaced into
the population. The same procedure is carried out NP times to decide the
next generation of vectors. This sequence is continued till some convergence
criterion is met.
This summarizes the basic procedure carried out in dierential evolution.
The details of this procedure are described below.Assume that the objective
function is of D dimensions and that it has to be minimized. The weighting
constant F and the crossover constant CR are specied. Refer to Fig. for
the schematic diagram of dierential evolution.
Step 1 Generate NP random vectors as the initial population: Generate
(NP x D) random numbers and linearize the range between 0 and 1 to cover
the entire range of the function. From these (NP x 0)ra ndom numbers,
generate NP random vectors, each of dimension D, by mapping the random
numbers over the range of the function.
Step 2 Choose a target vector from the population of size NP: First
generate a random number between 0 and 1. From the value of the random

8.4 Dierential Evolution

FIGURE 8.1. Schematic diagram of DE

83

84

8. Global Optimisation Techniques

number decide which population member is to be selected as the target


vector (Xi) (a linear mapping rule can be used).
Step 3 Choose two vectors at random from the population and nd the
weighted dierence: Generate two random numbers. Decide which two population members are to be selected (X Xb). Find the vector dierence
between the two vectors (X, - Xb). Multiply this dierence by F to obtain
the weighted dierence.
Weighted dierence = F(X, - Xb)
Step 4 Find the noisy random vector: Generate a random number. Choose
a third random vector from the population (X,).A dd this vector to the
weighted dierence to obtain the noisy random vector (Xf).
Noisy random vector (Xf) = X, + F(X, - Xb)
Step 5 Perform crossover between Xi and Xi to nd Xthe trial vector:
Generate D random numbers. For each of the D dimensions, if the random
number is greater than CR, copy the value from Xii nto the trial vector; if
the random number is less than CR, copy the value from Xf into the trial
vector.
Step 6 Calculate the cost of the trial vector and the target vector: For a
minimization problem, calculate the function value directly and this is the
cost. For a maximization problem, transform the objective function Ax)
using the rule, F(x) = 1/[ 1 +Ax)] and calculate the value of the cost.
Alternatively, directly calculate the value ofAx) and this yields the prot.
In case cost is calculated, the vector that yields the lesser cost replaces the
population member in the initial population. In case prot is calculated,
the vector with the greater prot replaces the population member in the
initial population.
Steps 1-6 are continued till some stopping criterion is met. This may
be of two kinds. One may be some convergence criterion that states that
the error in the minimum or maximum between two previous generations
should be less than some specied value. The other may be an upper bound
on the number of generations. The stopping criterion may be a combination
of the two. Either way, once the stopping criterion is met, the computations
are terminated. Choice of DE Key Parameters (NP, F, and CR) NP should
be 5-10 times the value of D, that is, the dimension of the problem. Choose
F = 0.5 initially. If this leads to premature convergence, then increase F.
The range of values of F is 0 c F c 1.2, but the optimal range is 0.4 c F
c 1.0. Values of F c 0.4 and F > 1.0 are seldom eective. CR = 0.9 is a
good rst guess. Try CR = 0.9 rst and then try CR = 0.1. Judging by the
speed, choose a value of CR between 0 and 1.
Several strategies have been proposed in DE. A list of them is as follows:
(a) DE/ best/l/exp, (b) DE/best/2/exp, (c) DE/best/l/bin, (d) DE/best/2/bin,
(e) DE/randtobest/l/exp, (0 DE/rand-to-best/l/bin, (g) DE/rand/l/bin,
(h) DE/rand/2/bin,
(i) DE/rand/l/exp, and Q) DE/rand/2/exp.

8.4 Dierential Evolution

85

The notations that have been used in the above strategies have distinct
meanings.The notation after the rst /, i.e., best, rand-to-best, and rand,
denotes the choice of the vector X,. Bestmeans that X, corresponds to the
vector in the population that has the minimum cost or maximum prot.
Rand-to-bestmeans that the weighted dierence between the best vector
and another randomly chosen vector is taken as
X,. Randmeans X, corresponds to a randomly chosen vector from the
population. The notation after the second /, i.e., 1 or 2, denotes the
number of sets of random vectors that are chosen from the population
for the computation of the weighted dierence. Thus 2 means the value
of X; is computed using the following expression:
where Xal, xbl, Xa2, and xb2 are random vectors. The notation after the
third /, i.e., exp or bin, denotes the methodology of crossover that has been
used. Exp denotes that the selection technique used is exponential and
bindenotes that the method used is binomial. What has been described
in the preceding discussion is the binomial technique where the random
number for each dimension is compared with CR to decide from where
the value should be copied into the trial vector. But, in the exponential
method, the instant a random number becomes greater than CR, the rest
of the values are copied from the target vector.
Apart from the above-mentioned strategies, there are some more innovative strategies that are being worked upon by the authors group and
implemented on some application.
x: = xc + F(Xal - x b l ) + F(Xa2 - xb2,)
Innovations on DE
The following additional strategies are proposed by the author and his associates, in addition to the ten strategies listed before: (k) DE/best/3/exp,
(1) DE/best/3/bin, (m) DE/rand/3/exp, and (n) DE/rand/3/bin. Very recently, a new concept of nested DEhas been successfully implemented for
the optimal design of an auto-thermal ammonia synthesis reactor (Babu
et al. 2002). This concept uses DE within DE wherein an outer loop takes
care of optimization of key parameters (NP is the population size, CR is
the crossover constant, and F is the scaling factor) with the objective of
minimizing the number of generations required, while an inner loop takes
care of optimizing the problem variables. Yet, the complex objective is
the one that takes care of minimizing the number of generations/function
evaluations and the standard deviation in the set of solutions at the last
generatiodfunction evaluation, and trying to maximize the robustness of
the algorithm.

8.4.3 Applications of DE
DE is catching up fast and is being applied to a wide range of complex
problems. Some of the applications of DE include the following: digital
lter design (Storn 1995), fuzzy-decision-making problems of fuel ethanol

86

8. Global Optimisation Techniques

production (Wang et al. 1998), design of a fuzzy logic controller (Sastry


et al. 1998), batch fermentation process (Chiou & Wang 1999; Wang &
Cheng 1999), dynamic optimization of a continuous polymer reactor (Lee
et al. 1999), estimation of heat-transfer Parameters in a trickle bed reactor (Babu & Sastry 1999), optimal design of heat exchangers (Babu &
Munawar 2000; 2001), Optimization and synthesis of heat integrated distillation systems (Babu & Singh 2000), optimization of an alkylation reaction
(Babu & Chaturvedi 2000), optimization of non-linear functions (Babu &
Angira 2001a), optimization of thermal cracker operation (Babu & Angira 2001b), scenariointegrated optimization of dynamic systems (Babu &
Gautam 2001), optimal design of an auto-thermal ammonia synthesis reactor (Babu et al. 2002), global optimization of mixed integer non-linear
programming (MINLP) problems (Babu & Angira 2002a), optimization of
non-linear chemical engineering processes (Babu & Angira 2002b; Angira
& Babu 2003), etc. A detailed bibliography on DE covering the applications on various engineering and other disciplines is available in literature
(Lampinen 2003).

8.5 Interval Mathematics


8.5.1 Introduction
The study of computing with real numbers, i.e. numerical analysis considers
exact numbers and exact analysis. Getting an exact representation these
exact oating point numbers in a xed length binary number has been a
challenge since inception of computers. With advancement of microprocessor technology and high speed computers, it is now possible to work with
higher precision numbers than ever before. In spite of that rounding errors generally occur and approximations are made. There are several other
types of mathematical computational errors that can as well aect results
obtained using computers. The purpose of interval analysis is to provide
upper and lower bounds on the eect all such errors and uncertainties have
on a computed quantity.
The scope/ purpose of this section of the workshop are to introduce interval arithmetic concepts and to study algorithms that use interval arithmetic to solve global nonlinear optimization problems. It has been shown
that interval global optimization techniques discussed here are guaranteed
to produce numerically correct bounds on global optimum value and global
optimal point. Even if there are multiple solutions, these algorithms guarantee nding all solutions. It is also guaranteed that solutions obtained are
global and not just local.

8.5 Interval Mathematics

87

8.5.2 Interval Analysis


Interval analysis began as a tool for bounding rounding errors (Hansen,
2004). However, it is believed that rounding errors can be detected in another way also. One needs to compute a given result using single precision
and double precision, and if the two results agree to some digits then the
results obtained are believed to be correct. This argument is however not
necessarily valid. Let us look at some examples to understand this in a
better way.
Rumps example
Using IEEE-754 computers, the following form (from Loh and Walster
(2002)) of Rumps expression with x0 = 77617 and y0 = 33096 replicates
his original IBM S/370 results.
f (x, y) =(333.75 - x2)y6 + x2(11x2y2 - 121y4 - 2) + 5.5y8 + x/(2y)
With round-to-nearest (the usual default) IEEE-754 arithmetic, the expression produces:
32-bit: f (x0, y0) = 1.172604
64-bit: f (x0, y0) = 1.1726039400531786
128-bit: f (x0, y0) = 1.1726039400531786318588349045201838
All three results agree in the rst seven decimal digits and thirteen digits
agree in the last two results. This may make us think that these results
are accurate; nevertheless, they are all completely incorrect. One will be
surprised to know that even their sign is wrong. The correct answer is
f (x0, y0) = -0.827396059946821368141165095479816
The reason for such error is probably rounding error and some catastrophic
cancellation. The example we have seen here is fabricated and may lead us
to think this may not happen in practice. Let us look at some real-life
examples where rounding or computational errors caused a disaster.

8.5.3 Real examples


One famous real life example is that of Ariane disaster that happened after
just 39 seconds of its launch on 4th June, 1996. Due to an error in the
software design (inadequate protection from integer overow), the rocket
veered o its ight path 37 seconds after launch and was destroyed by its
automated self-destruct system when high aerodynamic forces caused the
core of the vehicle to disintegrate. It is one of the most infamous computer
bugs in history.
The European Space Agencys rocket family had an excellent success
record, set by the high success rate of the Ariane 4 model. The next generation of Ariane rocket family, Ariane 5, reused the specications from
Ariane 4 software. The Ariane 5s ight path was considerably dierent
and beyond the range for which the reused computer program had been
designed. Because of the dierent ight path, a data conversion from a 64bit oating point to 16-bit signed integer value caused a hardware exception

88

8. Global Optimisation Techniques

(more specically, an arithmetic overow, as the oating point number had


a value too large to be represented by a 16-bit signed integer). E ciency
considerations had led to the disabling of the software handler for this error trap, although other conversions of comparable variables in the code
remained protected. This caused a cascade of problems, culminating in
destruction of the entire ight.
The subsequent automated analysis of the Ariane code was the rst example of large-scale static code analysis by abstract interpretation. It was
not until 2007 that European Space Agency could reestablish Ariane 5
launches as reliable and safe as those of the predecessor model.
On February 25, 1991, an Iraqi Scud hit the barracks in Dhahran, Saudi
Arabia, killing 28 soldiers from the US Armys 14th Quartermaster Detachment. A government investigation was launched to reveal reason of failed
intercept at Dhahran. It turned out that the computation of time in a
Patriot missile, which is critical in tracking a Scud, involved a multiplication by a constant factor of 1/10. The number 1/10 is a number that has
no exact binary representation, so every multiplication by 1/10 necessarily
causes some rounding error.
(0.1)10 = (0.00011001100110011...)2
The Patriot missile battery at Dhahran had been in operation for 100
hours, by which time the systems internal clock had drifted by one third
of a second. Due to the closure speed of the interceptor and the target,
this resulted in an error of 600 meters. The radar system had successfully
detected the Scud and predicted where to look for it next, but because of the
time error, looked in the wrong part of the sky and found no missile. With
no missile, the initial detection was assumed to be a spurious track and the
missile was removed from the system. No interception was attempted, and
the missile impacted on a barracks killing 28 soldiers.
Use of standard interval analysis could have detected the roundo difculty in the Patriot missile example. The extended interval arithmetic
(Hansen, 2004) would have produced a correct interval result in the Ariane
space shuttle example, even in the presence of overow. The Columbia US
Space Shuttle maiden ight had to be postponed because of a clock synchronization algorithm failure. This occurred after the algorithm in question had been subjected to a three year review process and formally proved
to be correct.
Unfortunately, the proof was awed. Interval Arithmetic can be used to
perform exhaustive testing that is otherwise impractical. All of these and
similar errors would have been detected if interval rather than oating-point
algorithms had been used.
Performance Benchmark
The relative speed of interval and point algorithms is often the cause of confusion and misunderstanding. People unfamiliar with the virtues of interval

8.5 Interval Mathematics

89

algorithms often ask what is the relative speed of interval and point operations and intrinsic function evaluations. Aside from the fact that relatively
little time and eort have been spent on interval system software implementation and almost no time and eort implementing interval-specic hardware, there is another reason why a dierent question is more appropriate
to ask. Interval and point algorithms solve dierent problems. Comparing
how long it takes to compute guaranteed bounds on the set of solutions
to a given problem, as compared to providing an approximate solution of
unknown accuracy, is not a reasonable way to compare the speed of interval and point algorithms. For many even problems, the operation counts
in interval algorithms are similar to those in non-interval algorithms. For
example, the number of iterations to bound a polynomial root to a given
(guaranteed) accuracy using an interval Newton method is about the same
as the number of iterations of a real Newton method to obtain the same
(not guaranteed) accuracy.
Virtues of Interval Analysis
The admirable quality of interval analysis is that it enables the solution of
certain problems that cannot be solved by non-interval methods. The primary example is the global optimization problem, which is the major topic
of this talk. Prior to the use of interval methods, it was impossible to solve
the nonlinear global optimization problem except in special cases. In fact,
various authors have written that in general it is impossible in principle to
numerically solve such problems. Their argument is that by sampling values
of a function and some of its derivatives at isolated points, it is impossible to determine whether a function dips to a global minimum (say) between the sampled points. Such a dip can occur between adjacent machinerepresentable oating point values. Interval methods avoid this di culty
by computing information about a function over continua of points even if
interval endpoints are constrained to be machine-representable. Therefore,
it is not only possible but relatively straightforward to solve the global
optimization problem using interval methods.
The obvious comment regarding the apparent slowness of interval methods for some problems (especially if they lack the structure often found
in real world problems) is that a price must be paid to have a reliable algorithm with guaranteed error bounds that non-interval methods do not
provide. For some problems, the price is somewhat high; for others it is
negligible or nonexistent. For still others, interval methods are more e cient.
There are several other virtues of interval methods that make them well
worth paying even a real performance price. In general, interval methods
are more reliable. As we shall see, some interval iterative methods always
converge, while their non-interval counterparts do not. An example is the
Newton method for solving for the zeros of a nonlinear equation.

90

8. Global Optimisation Techniques

Ease of use and availability of software


Despite several advantages of interval analysis, interval mathematics is less
prevalent in practice than one might expect. The main reasons for this are:
i.
Lack of convenience (avoidable)
ii.
Slowness of many interval arithmetic packages (avoidable)
iii.
Slowness of some interval algorithms (occasional)
iv.
Di culty of some interval problems
For programming convenience, an interval data type is needed to represent interval variables and interval constants as single entities rather than as
two real interval endpoints. Now-a-days numerous computing tools support
computations with intervals. This includes, Mathematica, Maple, MuPad,
Matlab, etc. Good interval arithmetic software for various applied problems
is now often available (http://cs.utep.edu/interval-comp/intsoft.html). More
recently compilers have been developed by Sun Microsystems Inc. that represents the current state of the art and allow interval data types (e.g. SUN
Fortran 95).

8.5.4 Interval numbers and arithmetic


Interval numbers
Interval number (or interval) X is a closed interval, i.e. a set of all real
numbers between and including end-points. Mathematically, can be written
as:
X = fxja

bg

(8.1)

A degenerate interval is an interval with zero width, i.e. . The endpoints and of a given interval might not be representable on a given computer. Such an interval might be a datum or the result of a computation
on the computer. In such a case, we round down to the largest machinerepresentable number that is less than and round up to the smallest machinerepresentable number that is greater than . Thus, the retained interval
contains . This process is called outward rounding.
An under-bar indicates the lower endpoint of an interval; and an overbar indicates the upper endpoint. For example, if , then and . Similarly, we
write .
Finite interval arithmetic
Let +, -, ; and

denotetheoperationsof addition; subtraction; multiplication; anddivision; respectively:If


X Y = fx yjx 2 X; y 2 Y g

(8.2)

Thus the interval X Y resulting from the operation contains every possible number that can be formed as x y for each x X, and each y Y.
This denition produces the following rules for generating the endpoints

8.5 Interval Mathematics

of X

91

Y from the two intervals X = [a, b] and Y = [c, d].

X +Y
X Y

= [a + c b + d]
= [a d b c]

(8.3)
(8.4)

Division by an interval containing 0 is considered in extended interval


arithmetic (See Hansen, 2004).
Interval arithmetic operations suer from dependency and this can result
in widening of computed intervals and make it di cult to compute sharp
numerical results of complicated expressions. One should always be aware
of this di culty and, when possible, take steps to reduce its eect.
Real functions of intervals
There are a number of useful real-valued functions of intervals, some of
them are listed here.
The mid-point of interval is
The width of X is
The magnitude is dened as maximum value of for all
The mignitude is dened as minimum value of for all
The interval version of absolute value of X is dened as
Interval arithmetic is quite involved with varied theorems and criteria
to produce sharper bounds on computed quantities. Interested readers are
requested to refer Interval Analysis by Moore (Moore, 1966). We now move
quickly to interval global optimization techniques.

8.5.5 Global optimization techniques


Unconstrained optimization problem
Here, we consider the problem
where f is a scalar function of a vector x of n components. We seek the
minimum value f* of f and the point(s) x* at which this minimum occurs.
For simplicity, we assume that any used derivative exists and is continuous in the region considered. However, Interval methods exist that do not
require dierentiability. (See Ratschek and Rokne (1988) or Moore, Hansen,
and Leclerc (1991))

92

8. Global Optimisation Techniques

Interval analysis makes it possible to solve the global optimization problem, to guarantee that the global optimum is found, and to bound its value
and location. Secondarily, perhaps, it provides a means for dening and
performing rigorous sensitivity analyses.
Until fairly recently, it was thought that no numerical algorithm can
guarantee having found the global solution of a general nonlinear optimization problem. Various authors have atly stated that such a guarantee
is impossible. Their argument was as follows: Optimization algorithms can
sample the objective function and perhaps some of its derivatives only at a
nite number of distinct points. Hence, there is no way of knowing whether
the function to be minimized dips to some unexpectedly small value between
sample points. In fact the dip can be between closest possible points in
a given oating point number system. This is a very reasonable argument;
and it is probably true that no algorithm using standard arithmetic will ever
provide the desired guarantee. However, interval methods do not sample
at points. They compute bounds for functions over a continuum of points,
including ones that are not nitely representable.
Example 4 Example 1
Consider the following simple optimization problem
We know that the global minimum will be at +/- 2
evaluate f at x=1 and over the interval . We obtain,

. Suppose we

Thus, we know that f (x) 0 for all x [3, 4.5] including such transcendental points as = 3.14.... Since f (1) = 3, the minimum value of f is
no larger than 3. Therefore, the minimum value of f cannot occur in the
interval [3, 4.5]. We have proved this fact using only two evaluations of f.
Rounding and dependence have not prevented us from infallibly drawing
this conclusion. By eliminating subintervals that are proved to not contain the global minimum, we eventually isolate the minimum point. In a
nutshell, an algorithm for global optimization generally provides various
(systematic) ways to do the elimination.
Global optimization algorithm
The algorithm proceeds as follows:
i.
Begin with a box x(0) in which the global minimum is sought.
Because we restrict our search to this particular box, our problem is really
constrained. We will discuss this aspect in later.
ii.
Delete subboxes of x(0) that cannot contain a solution point. Use
fail-safe procedures so that, despite rounding errors, the point(s) of global
minimum are never deleted.
The methods for Step 2 are as follows:

8.5 Interval Mathematics

93

(a) Delete subboxes of the current box wherein the gradient g of f is


nonzero. This can be done without dierentiating g. This use of monotonicity was introduced by Hansen (1980). Alternatively, consistency methods
and/or an interval Newton method can be applied to solve the equation g
= 0. In so doing, derivatives (or slopes) of g are used. By narrowing bounds
on points where g = 0, application of a Newton method deletes subboxes
wherein .
(b) Compute upper bounds on f at various sampled points. The smallest
computed upper bound is an upper bound for f*. Then delete subboxes
of the current box wherein f > . The concept of generating and using an
upper bound in this way was introduced by Hansen (1980).
(c) Delete subboxes of the current box wherein f is not convex. The
concept of using convexity in this way was introduced by Hansen (1980).
iii.
Iterate Step 2 until a su ciently small set of points remains. Since
x* must be in this set, its location is bounded. Then bound f over this set
of points to obtain nal bounds on f*.
For problems in which the objective function is not dierentiable, Steps
2a and 2c cannot be used because the gradient g is not dened. Step 2b is
always applicable. We now describe these procedures and other aspects of
the algorithm in more detail.

Initial search region (Initial Box)


The user of the algorithm can specify a box or boxes in which the solution
is sought. Any number of nite boxes can be prescribed to dene the region
of search. The boxes can be disjoint or overlap. However, if they overlap,
a minimum at a point that is common to more than one box is separately
found as a solution in each box containing it. In this case, computing eort
is wasted. For simplicity, assume the search is made in a single box. If user
does not specify a box, search is made in default box , where is largest
oating point number that can be represented by given number system.
Since we restrict our search to a nite box, we have replaced the unconstrained problem by a constrained one of the form

Actually, we do not solve this constrained problem because we assume the


solution occurs at a stationary point of f. However, it is simpler to assume
the box X is so large that a solution does not occur at a non-stationary
point on the boundary of X.
Walster, Hansen, and Sengupta (1985) compared run time on their interval algorithm as a function of the size of the initial box. They found that increasing box width by an average factor of 9.1 105increasedtheruntimebyanaveragef actorof only4:4:F oronee
108:

94

8. Global Optimisation Techniques

Use of gradient
We assume that f is continuously dierentiable. Therefore, the gradient g of
f is zero at the global minimum. Of course, g is also zero at local minima, at
maxima and at saddle points. Our goal is to nd the zero(s) of g at which f
is a global minimum. As we search for zeros, we attempt to discard any that
are not a global minimum of f. Generally, we discard boxes containing nonglobal minimum points before we spend the eort to bound such minima
very accurately.
When we evaluate gradient g over sub-boxes XI, if then there is no stationary point of f in x. therefore x cannot contain the global minimum and
can be deleted. We can apply hull consistency to further expedite convergence of the algorithm and sometimes reduce the search box.
An upper bound on the minimum
We use various procedures to nd the zeros of the gradient of the objective
function. Please note that these zeros can be stationary points that are not
the global minimum. Therefore, we want to avoid spending the eort to
closely bound such points when they are not the desired solution. In this
section we consider procedures that help in this regard.
Suppose we evaluate f at a point x. Because of rounding, the result is
generally an interval . Despite rounding errors in the evaluation, we know
without question that f I(x) is an upper bound for and hence for f*. Let
denote the smallest such upper bound obtained for various points sampled
at a given stage of the overall algorithm. This upper bound plays an important part in our algorithm. Since , we can delete any subbox of X for
which . This might serve to delete a subbox that bounds a non-optimal
stationary point of f. There are various methods that can be applied to the
upper bound on the minimum.
Termination
The optimization algorithm splits and subdivides a box into sub-boxes,
at the same time sub-boxes that are guaranteed to not contain a global
optimum are deleted. Eventually we will have a few small boxes remaining.
For a box to be considered as a solution box, two conditions must be
satised. One,
Where, is specied by user. This condition means that width of a solution
box must be less than a specied threshold. Second, we require
Where, is specied by user. This condition guarantees that the globally minimum value f* of the objective function is bounded to within the
tolerance .

8.5 Interval Mathematics

95

8.5.6 Constrained optimization


The constrained optimization problem considered here is
Subject to
We assume that function is twice continuously dierentiable and constraints and are continuously dierentiable.
Now lets understand the John conditions that necessarily hold at a constrained (local or global) minimum. We use these conditions in solving the
above constrained optimization problem.
Johns condition for the above optimization problem can be written as:
where, are Lagrange multipliers.
The John conditions dier from the more commonly used Kuhn-TuckerKarush conditions because they include the Lagrange multiplier u0. If we
set u0 = 1, then we obtain the Kuhn-Tucker-Karush conditions.
The John conditions do not normally include a normalization condition.
Therefore, there are more variables than equations. One is free to remove
the ambiguity in whatever way desired. A normalization can be chosen
arbitrarily without changing the solution x of the John conditions. If no
equality constraints are present in the problem, we can use
Since Lagrange multipliers are non-negative, this assures .
The multipliers vi (i = 1,
, r) can be positive or negative. Therefore,
a possible normalization is
However, we want our normalization equation that is continuously differentiable so we can apply interval Newton method to solve the John
condition. Therefore we use the following normalization equation:
Where, and is the smallest machine representable number.
An Interval Newton method has been proposed to solve the John condition. Solving the John condition is discussed in detail in Hansen and
Walster (1990).
For further reading on interval global optimization, readers are encouraged to browse references listed here.

8.5.7 References
Alefeld, G. (1984). On the convergence of some interval arithmetic modications of Newtons method, SIAM J. Numer. Anal. 21, 363372.
Alefeld, G. and Herzberger, J. (1983). Introduction to Interval Computations, Academic Press, Orlando, Florida.
Bazaraa, M. S. and Shetty, C. M. (1979). Nonlinear Programming. Theory and Practice,Wiley, NewYork.

96

8. Global Optimisation Techniques

Hansen, E. R. (1969). Topics in Interval Analysis, Oxford University


Press, London.
Hansen, E. R. (1978a). Interval forms of Newtons method, Computing
20, 153163.
Hansen, E. R. (1978b). A globally convergent interval method for computing and bounding real roots, BIT 18, 415424.
Hansen, E. R. (1979). Global optimization using interval analysis-the one
dimensional case, J. Optim. Theory Appl. 29, 331344.
Hansen, E. R. (1980). Global optimization using interval analysis-the
multi-dimensional case, Numer. Math. 34, 247270.
Krawczyk, R. (1983). A remark about the convergence of interval sequences, Computing 31, 255259.
Krawczyk, R. (1986). A class of interval Newton operators, Computing
37, 179183.
Loh, E. andWalster, G.W. (2002). Rumps example revisited. Reliable
Computing, 8 (2) 245248.
Moore, R. E. (1965). The automatic analysis and control of error in
digital computation based on the use of interval numbers, in Rall (1965),
pp. 61130.
Moore, R. E. (1966).Interval Analysis, Prentice-Hall, Englewood Clis,
New Jersey.
Moore, R. E. (1979).Methods and Applications of Interval Analysis,
SIAM Publ., Philadelphia, Pennsylvania.
Moore, R. E., Hansen, E. Rand Leclerc, A. (1992). Rigorous methods
for parallel global optimization, in Floudas and Pardalos (1992), pp.321
342.
Nataraj, P. S.V. and Sardar, G. (2000). Computation of QFT bounds
for robust sensitivity and gain-phase margin specications, Trans. ASME
Journal of Dynamical Systems, Measurement, and Control, Vol. 122, pp.
528534.
Nataraj, P. S. V. (2002a). Computation of QFT bounds for robust tracking specications, Automatica, Vol. 38, pp. 327334.
Nataraj, P. S.V. (2002b). Interval QFT:A mathematical and computational enhancement of QFT, Int. Jl. Robust and Nonlinear Control, Vol.
12, pp. 385402.
Neumaier, A. (1990). Interval Methods for System of Equations, Cambridge University Press, London.
Ratschek, H., and Rokne, J. (1984). Computer Methods for the Range
of Functions, Halstead Press, NewYork.
Walster, G.W. (1988). Philosophy and practicalities of interval arithmetic, pages 309323 of Moore (1988).
Walster, G.W. (1996). Interval Arithmetic: The New Floating-Point Arithmetic Paradigm, Sun Solaris Technical Conference, June 1996.

8.5 Interval Mathematics

97

Walster, G.W., Hansen, E. R., and Sengupta, S. (1985). Test results for
a global optimization algorithm, in Boggs, Byrd, and Schnabel (1985), pp.
272287.
6.1.
Web References
Fortran 95 Interval Arithmetic Programming Reference
http://docs.sun.com/app/docs/doc/816-2462
INTerval LABoratory (INTLAB) for MATLAB
http://www.ti3.tu-harburg.de/~rump/intlab/
Research group in Systems and Control Engineering, IIT Bombay
http://www.sc.iitb.ac.in/~nataraj/publications/publications.htm
Global Optimization using Interval Analysis
http://books.google.com/books?id=tY2wAkb-zLcC&printsec
=frontcover&dq=interval+global+optimization&hl=en&ei=m8QYTLuhO5mMNbuzoccE&sa=
X&oi=book_result&ct=result&resnum=1&ved=0CCwQ6AEwAA#v=onepage&q&f=false
Global Optimization techniques (including non-inverval)
http://www.mat.univie.ac.at/~neum/glopt/techniques.html
List of Interval related softwares
http://cs.utep.edu/interval-comp/intsoft.html
Interval Global optimization
http://www.cs.sandia.gov/opt/survey/interval.html
Interval Methods
http://www.mat.univie.ac.at/~neum/interval.html
List of publications on Interval analysis in early days
http://interval.louisiana.edu/Moores_early_papers/bibliography.html.

98

8. Global Optimisation Techniques

This is page 99
Printer: Opaque this

9
A GAMS Tutorial

9.1 Introduction
The introductory part of this book ends with a detailed example of the use
of GAMS for formulating, solving, and analyzing a small and simple optimization problem. Richard E. Rosenthal of the Naval Postgraduate School
in Monterey, California wrote it. The example is a quick but complete
overview of GAMS and its features. Many references are made to other
parts of the original user manual , but they are only to tell you where
to look for more details; the material here can be read protably without
reference to the rest of the user manual.
The example is an instance of the transportation problem of linear programming, which has historically served as a laboratory animalin the development of optimization technology. [See, for example, Dantzig (1963).]
It is good choice for illustrating the power of algebraic modeling languages
like GAMS because the transportation problem, no matter how large the
instance at hand, possesses a simple, exploitable algebraic structure. You
willsee that almost all of the statements in the GAMS input le we are
about to present would remain unchanged if a much larger transportation
problem were considered.
In the familiar transportation problem, we are given the supplies at several plants and the demands at several markets for a single commodity,
and we are given the unit costs of shipping the commodity from plants
to markets. The economic question is: how much shipment should there

100

9. A GAMS Tutorial

FIGURE 9.1. Data for the transportation problem

be between each plant and each market so as to minimize total transport


cost?
The algebraic representation of this problem is usually presented in a
format similar to the following.
Indices:
i = plants
j = markets
Given Data:
ai = supply of commodity of plant i (in cases)
bi = demand for commodity at market j
cij = cost per unit shipment between plant i and market j ($/case)
Decision Variables:
xij = amount of commodity to ship from plant i to market j (cases),
where xij 0, for all i, j
Constraints:
P
Observe supply limit at plantPi: j xij aj for all i (cases)
Satisfy demand at market j: P
i xij
P bj for all j (cases)
Objective Function: Minimize i j cijxij ($K)
Note that this simple example reveals some modeling practices that we
regard as good habits in general and that are consistent with the design
of GAMS. First, all the entities of the model are identied (and grouped)
by type. Second, the ordering of entities is chosen so that no symbol is
referred to before it is dened. Third, the units of all entities are specied,
and, fourth, the units are chosen to a scale such that the numerical values
to be encountered by the optimizer have relatively small absolute orders of
magnitude. (The symbol $K here means thousands of dollars.)
The names of the types of entities may dier among modelers. For example, economists use the terms exogenous variable and endogenous variable
for given data and decision variable, respectively. In GAMS, the terminology adopted is as follows: indices are called sets, given data are called
parameters, decision variables are called variables, and constraints and
the objective function are called equations. The GAMS representation of
the transportation problem closely resembles the algebraic representation
above. The most important dierence, however, is that the GAMS version
can be read and processed by the computer.

9.1 Introduction

101

As an instance of the transportation problem, suppose there are two


canning plants and three markets, with the data given in table 2.1. Shipping
distances are in thousands of miles, and shipping costs are assumed to
be $90.00 per case per thousand miles. The GAMS representation of this
problem is as follows:
Sets
i canning plants / seattle, san-diego /
j markets / new-york, chicago, topeka / ;
Parameters
a(i) capacity of plant i in cases
/ seattle 350
san-diego 600 /
b(j) demand at market j in cases
/ new-york 325
chicago 300
topeka 275 / ;
Table d(i,j) distance in thousands of miles
new-york chicago topeka
seattle 2.5 1.7 1.8
san-diego 2.5 1.8 1.4 ;
Scalar f freight in dollars per case per thousand miles /90/ ;
Parameter c(i,j) transport cost in thousands of dollars per case ;
c(i,j) = f * d(i,j) / 1000 ;
Variables
x(i,j) shipment quantities in cases
z total transportation costs in thousands of dollars ;
Positive Variable x ;
Equations
cost dene objective function
supply(i) observe supply limit at plant i
demand(j) satisfy demand at market j ;
cost .. z =e= sum((i,j), c(i,j)*x(i,j)) ;
supply(i) .. sum(j, x(i,j)) =l= a(i) ;
demand(j) .. sum(i, x(i,j)) =g= b(j) ;
Model transport /all/ ;
2.2 Structure of a GAMS Model 7
Solve transport using lp minimizing z ;
Display x.l, x.m ;
If you submit a le containing the statements above as input to the
GAMS program, the transportation model will be formulated and solved.
Details vary on how to invoke GAMS on dierent of computers, but the
simplest (no frills) way to call GAMS is to enter the word GAMS followed
by the input les name. You will see a number of terse lines describing the
progress GAMS is making, including the name of the le onto which the
output is being written. When GAMS has nished, examine this le, and

102

9. A GAMS Tutorial

if all has gone well the optimal shipments will be displayed at the bottom
as follows.
new-york
chicago
topeka
seattle
50.000
300.000
san-diego 275.000
275.000
You will also receive the marginal costs (simplex multipliers) below.
chicago
topeka
seattle
0.036
san-diego 0.009
These results indicate, for example, that it is optimal to send nothing
from Seattle to Topeka, but if you insist on sending one case it will add
.036 $K (or $36.00) to the optimal cost. (Can you prove that this gure is
correct from the optimal shipments and the given data?)

9.2 Structure of a GAMS Model


For the remainder of the tutorial, we will discuss the basic components of a
GAMS model, with reference to the example above. The basic components
are listed in table.
There are optional input components, such as edit checks for bad data
and requests for customized reports of results. Other optional advanced features include saving and restoring old models, and creating multiple models
in a single run, but this tutorial will discuss only the basic components.
Before treating the individual components, we give a few general remarks.
1. A GAMS model is a collection of statements in the GAMS Language.
The only rule governing the ordering of statements is that an entity of the
model cannot be referenced before it is declared to exist.
2. GAMS statements may be laid out typographically in almost any style
that is appealing to the user. Multiple lines per statement, embedded blank
lines, and multiple statements per line are allowed. You will get a good idea
of what is allowed from the examples in this tutorial, but precise rules of
the road are given in user manual .
3. When you are a beginning GAMS user, you should terminate every
statement with a semicolon, as in our examples. The GAMS compiler does
not distinguish between upper-and lowercase letters, so you are free to use
either.
4. Documentation is crucial to the usefulness of mathematical models.
It is more useful (and most likely to be accurate) if it is embedded within
the model itself rather than written up separately. There are at least two
ways to insert documentation within a GAMS model. First, any line that
starts with an asterisk in column 1 is disregarded as a comment line by the
GAMS compiler. Second, perhaps more important, documentary text can

9.3 Sets

103

be inserted within specic GAMS statements. All the lowercase words in the
transportation model are examples of the second form of documentation.
5. As you can see from the list of input components above, the creation
of GAMS entities involves two steps: a declaration and an assignment or
denition. Declaration means declaring the existence of something and giving it a name. Assignment or denition means giving something a specic
value or form. In the case of equations, you must make the declaration
and denition in separate GAMS statements. For all other GAMS entities,
however, you have the option of making declarations and assignments in
the same statement or separately.
6. The names given to the entities of the model must start with a letter
and can be followed by up to thirty more letters or digits
Sets
Sets are the basic building blocks of a GAMS model, corresponding exactly to the indices in the algebraic
representations of models. The Transportation example above contains
just one Set statement:

9.3 Sets
i canning plants / seattle, san-diego /
j markets / new-york, chicago, topeka / ;
The eect of this statement is probably self-evident. We declared two
sets and gave them the names i and j. We also assigned members to the
sets as follows:

104

9. A GAMS Tutorial

i = {Seattle, San Diego} j = {New York, Chicago, Topeka}.


You should note the typographical dierences between the GAMS format
and the usual mathematical format for listing the elements of a set. GAMS
uses slashes / rather than curly braces {} to delineate the set simply
because not all computer keyboards have keys for curly braces. Note also
that multiword names like New York are not allowed, so hyphens are
inserted.
The lowercase words in the sets statement above are called text. Text
is optional. It is there only for internal documentation, serving no formal
purpose in the model. The GAMS compiler makes no attempt to interpret
the text, but it saves the text and parrotsit back to you at various times
for your convenience. It was not necessary to combine the creation of sets i
and j in one statement. We could have put them into separate statements
as follows:
Set i canning plants / seattle, san-diego / ;
Set j markets / new-york, chicago, topeka / ;
The placement of blank spaces and lines (as well as the choice of upperor lowercase) is up to you. Each GAMS user tends to develop individual
stylistic conventions. (The use of the singular set is also up to you. Using
set in a statement that makes a single declaration and sets in one that
makes several is good English, but GAMS treats the singular and plural
synonymously.)
A convenient feature to use when you are assigning members to a set is
the asterisk. It applies to cases when the elements follow a sequence. For
example, the following are valid set statements in GAMS.
Set t time periods /1991*2000/;
Set m machines /mach1*mach24/;
Here the eect is to assign
t = {1991,1992,1993, ....., 2000} m = {mach1, mach2,......, mach24}.
Note that set elements are stored as character strings, so the elements of
t are not numbers.
Another convenient feature is the alias statement, which is used to give
another name to a previously declared set. In the following example:
Alias (t,tp);
the name tp is like a t0 in mathematical notation. It is useful in models
that are concerned with the interactions of elements within the same set.
The sets i, j, t, and m in the statements above are examples of static
sets, i.e., they are assigned their members directly by the user and do not
change. GAMS has several capabilities for creating dynamic sets, which
acquire their members through the execution of set-theoretic and logical
operations. Dynamic sets are discussed in Chapter 12, page107 of user
manual. Another valuable advanced feature is multidimensional sets, which
are discussed in user manual.

9.4 Data

105

9.4 Data
The GAMS model of the transportation problem demonstrates all of the
three fundamentally dierent formats that are allowable for entering data.
The three formats are:
Lists
Tables
Direct assignments
The next three sub-sections will discuss each of these formats in turn.

9.4.1 Data Entry by Lists


The rst format is illustrated by the rst Parameters statement of the
example, which is repeated below
Parameters
a(i) capacity of plant i in cases
/ seattle 350
san-diego 600 /
b(j) demand at market j in cases
/ new-york 325
chicago 300
topeka 275 / ;
This statement has several eects. Again, they may be self-evident, but
it is worthwhile to analyze them in detail. The statement declares the existence of two parameters, gives them the names a and b, and declares their
domains to be i and j, respectively. (A domain is the set, or tuple of sets,
over which a parameter, variable, or equation is dened.) The statement
also gives documentary text for each parameter and assigns values of a(i)
and b(j) for each element of i and j. It is perfectly acceptable to break this
one statement into two, if you prefer, as follows.
Parameters a(i) capacity of plant i in cases
/ seattle 350
san-diego 600 / ;
Parameters b(j) demand at market j in cases
/ new-york 325
chicago 300
topeka 275 / ;
Here are some points to remember when using the list format.
1. The list of domain elements and their respective parameter values can
be laid out in almost any way you like. The only rules are that the entire
list must be enclosed in slashes and that the element-value pairs must be
separated by commas or entered on separate lines.
2. There is no semicolon separating the element-value list from the name,
domain, and text that precede it. This is because the same statement is
being used for declaration and assignment when you use the list format.

106

9. A GAMS Tutorial

(An element-value list by itself is not interpretable by GAMS and will result
in an error message.)
3. The GAMS compiler has an unusual feature called domain checking,
which veries that each domain element in the list is in fact a member of
the appropriate set. For example, if you were to spell Seattle correctly
in the statement declaring Set i but misspell it as Seatlein a subsequent
element-value list, the GAMS compiler would give you an error message
that the element Seatledoes not belong to the set i.
4. Zero is the default value for all parameters. Therefore, you only need
to include the nonzero entries in the element-value list, and these can be
entered in any order .
5. A scalar is regarded as a parameter that has no domain. It can be
declared and assigned with a Scalar statement containing a degenerate list
of only one value, as in the following statement from the transportation
model.
Scalar f freight in dollars per case per thousand miles /90/;
If a parameters domain has two or more dimensions, it can still have
its values entered by the list format. This is very useful for entering arrays
that are sparse (having few non-zeros) and super-sparse (having few distinct
non-zeros).

9.4.2 Data Entry by Tables


Optimization practitioners have noticed for some time that many of the
input data for a large model are derived from relatively small tables of
numbers. Thus, it is very useful to have the table format for data entry.
An example of a two-dimensional table (or matrix) is provided the transportation model.
Table d(i,j) distance in thousands of miles
new-york chicago topeka
seattle 2.5 1.7 1.8
san-diego 2.5 1.8 1.4 ;
The eect of this statement is to declare the parameter d and to specify
its domain as the set of ordered pairs in the Cartesian product of i and j. The
values of d are also given in this statement under the appropriate heading.
If there are blank entries in the table, they are interpreted as zeroes. As
in the list format, GAMS will perform domain checking to make sure that
the row and column names of the table are members of the appropriate
sets. Formats for entering tables with more columns than you can t on
one line and for entering tables with more than two dimensions are given
in Chapter 5, page 43.

9.4 Data

107

9.4.3 Data Entry by Direct Assignment


The direct assignment method of data entry diers from the list and table
methods in that it divides the tasks of parameter declaration and parameter assignment between separate statements. The transportation model
contains the following example of this method.
Parameter c(i,j) transport cost in thousands of dollars per case ;
c(i,j) = f * d(i,j) / 1000 ;
It is important to emphasize the presence of the semicolon at the end of
the rst line. Without it, the GAMS compiler would attempt to interpret
both lines as parts of the same statement. (GAMS would fail to discern a
valid interpretation, so it would send you a terse but helpful error message.)
The eects of the rst statement above are to declare the parameter c, to
specify the domain (i,j), and to provide some documentary text. The second
statement assigns to c(i,j) the product of the values of the parameters f and
d(i,j). Naturally, this is legal in GAMS only if you have already assigned
values to f and d(i,j) in previous statements.
The direct assignment above applies to all (i,j) pairs in the domain of
c. If you wish to make assignments for specic elements in the domain,
you enclose the element names in quotes. For example, c(Seattle,NewYork) = 0.40; is a valid GAMS assignment statement. The same parameter
can be assigned a value more than once. Each assignment statement takes
eect immediately and overrides any previous values. (In contrast, the same
parameter may not be declared more than once. This is a GAMS error check
to keep you from accidentally using the same name for two dierent things.)
The right-hand side of an assignment statement can contain a great variety of mathematical expressions and built-in functions. If you are familiar
with a scientic programming language such as FORTRAN or C, you will
have no trouble in becoming comfortable writing assignment statements
in GAMS. (Notice, however, that GAMS has some e ciencies shared by
neither FORTRAN nor C. For example, we were able to assign c(i,j) values
for all (i,j) pairs without constructing do loops.)
The GAMS standard operations and supplied functions are given later.
Here are some examples of valid assignments. In all cases, assume the lefthand-side parameter has already been declared and the right-hand-side
parameters have already been assigned values in previous statements.
csquared = sqr(c);
e = m*csquared;
w = l/lamda;
eoq(i) = sqrt( 2*demand(i)*ordcost(i)/holdcost(i));
t(i) = min(p(i), q(i)/r(i), log(s(i)));
euclidean(i,j) = qrt(sqr(xi(i) - xi(j) + sqr(x2(i) - x2(j)));
present(j) = future(j)*exp(-interest*time(j));
The summation and product operators to be introduced later can also
be used in direct assignments

108

9. A GAMS Tutorial

Variables
The decision variables (or endogenous variables ) of a GAMS-expressed
model must be declared with a Variables
statement. Each variable is given a name, a domain if appropriate, and
(optionally) text. The transportation
model contains the following example of a Variables statement.

9.5 Variables
x(i,j) shipment quantities in cases
z total transportation costs in thousands of dollars ;
This statement results in the declaration of a shipment variable for each
(i,j) pair. (You will see in Chapter 8, page 65, how GAMS can handle
the typical real-world situation in which only a subset of the (i,j) pairs is
allowable for shipment.)
The z variable is declared without a domain because it is a scalar quantity. Every GAMS optimization model must contain one such variable to
serve as the quantity to be minimized or maximized.
Once declared, every variable must be assigned a type. The permissible
types are given below. Variable Type Allowed Range of Variable
free(default) -1 to +1
positive 0 to +1
negative -1 to 0
binary 0 or 1
integer 0, 1, . . . , 100 (default)
The variable that serves as the quantity to be optimized must be a scalar
and must be of the free type. In our transportation example, z is kept
free by default, but x(i,j) is constrained to non-negativity by the following
statement.
Positive variable x ;
Note that the domain of x should not be repeated in the type assignment.
All entries in the domain automatically have the same variable type.
Section 2.10 of user manual describes how to assign lower bounds, upper
bounds, and initial values to variables.

9.6 Equations
The power of algebraic modeling languages like GAMS is most apparent
in the creation of the equations and inequalities that comprise the model
under construction. This is because whenever a group of equations or inequalities has the same algebraic structure, all the members of the group
are created simultaneously, not individually.

9.6 Equations

109

9.6.1 Equation Declaration


Equations must be declared and dened in separate statements. The format
of the declaration is the same as for other GAMS entities. First comes the
keyword, Equations in this case, followed by the name, domain and text
of one or more groups of equations or inequalities being declared. Our
transportation model contains the following equation declaration:
Equations
cost
dene objective function
supply(i)
observe supply limit at plant i
demand(j)
satisfy demand at market j ;
Keep in mind that the word Equation has a broad meaning in GAMS.
It encompasses both equality and inequality relationships, and a GAMS
equation with a single name can refer to one or several of these relationships.
For example, cost has no domain so it is a single equation, but supply refers
to a set of inequalities dened over the
domain i.

9.6.2 GAMS Summation (and Product) Notation


Before going into equation denition we describe the summation notation in
GAMS. Remember that GAMS is designed for standard keyboards and lineby-line input readers, so it is not possible (nor would it be convenient for
the user) to employ the standard mathematical notation for summations.
The summation notation in GAMS can be used for simple and complex expressions. The format is based on the idea of always thinking of a
summation as an operator with two arguments: Sum(index of summation,
summand) A comma separates the two arguments, and if the rst argument
requires a comma then it should be in parentheses. The second argument
can be any mathematical expression including another summation.

9.6.3 Equation Denition


Equation denitions are the most complex statements in GAMS in terms
of their variety. The components of an equation denition are, in order:
1. The name of the equation being dened
2. The domain
3. Domain restriction condition (optional)
4. The symbol ..
5. Left-hand-side expression
6. Relational operator: =l=, =e=, or =g=
7. Right-hand-side expression
The transportation example contains three of these statements.
cost .. z =e= sum((i,j), c(i,j)*x(i,j)) ;

110

9. A GAMS Tutorial

supply(i) .. sum(j, x(i,j)) =l= a(i) ;


demand(j) .. sum(i, x(i,j)) =g= b(j) ;
Here are some points to remember.
1)The power to create multiple equations with a single GAMS statement
is controlled by the domain. For example, the denition for the demand
constraint will result in the creation of one constraint for each element of
the domain j, as shown in the following excerpt from the GAMS output.
DEMAND(new-york)..X(seattle,new-york) + X(san-diego,new-york)=G=325
;
DEMAND(chicago).. X(seattle,chicago) + X(san-diego,chicago) =G=300
;
DEMAND(topeka).. X(seattle,topeka) + X(san-diego,topeka) =G=275
;
2) The key idea here is that the denition of the demand constraints
is exactly the same whether we aresolving the toy-sized example above or
a 20,000-node real-world problem. In either case, the user enters just one
generic equation algebraically, and GAMS creates the specic equations
that are appropriate for the model instance at hand. (Using some other
optimization packages, something like the extract above would be part of
the input, not the output.)
3) In many real-world problems, some of the members of an equation
domain need to be omitted or dierentiated from the pattern of the others
because of an exception of some kind. GAMS can readily accommodate this
loss of structure using a powerful feature known as the dollar or such-that
operator, which is not illustrated here. The domain restriction feature can
be absolutely essential for keeping the size of a real-world model within the
range of solvability.
4)The relational operators have the following meanings:
=l= less than or equal to
=g= greater than or equal to
=e= equal to
5) It is important to understand the dierence between the symbols =
and =e=. The = symbol is used only in direct assignments, and the
=e=symbol is used only in equation denitions. These two contexts are
very dierent. A direct assignment gives a desired value to a parameter
before the solver is called. An equation denition also describes a desired
relationship, but it cannot be satised until after the solver is called. It
follows that equation denitions must contain variables and direct assignments must not.
6)ariables can appear on the left or right-hand side of an equation or
both. The same variable can appear in an equation more than once. The
GAMS processor will automatically convert the equation to its equivalent
standard form (variables on the left, no duplicate appearances) before calling the solver.

9.7 Objective Function

111

7) An equation denition can appear anywhere in the GAMS input,


provided the equation and all variables and parameters to which it refers are
previously declared. (Note that it is permissible for a parameter appearing
in the equation to be assigned or reassigned a value after the denition.
This is useful when doing multiple model runs with one GAMS input.) The
equations need not be dened in the same order in which they are declared.

9.7 Objective Function


This is just a reminder that GAMS has no explicit entity called the objective function. To specify the function to be optimized, you must create
a variable, which is free (unconstrained in sign) and scalar-valued (has no
domain) and which appears in an equation denition that equates it to the
objective function.

9.8 Model and Solve Statements


The word model has a very precise meaning in GAMS. It is simply a collection of equations. Like other GAMS entities, it must be given a name in
a declaration. The format of the declaration is the keyword model followed
by the name of the model, followed by a list of equation names enclosed
in slashes. If all previously dened equations are to be included, you can
enter /all/ in place of the explicit list. In our example, there is one Model
statement:
model transport /all/ ;
This statement may seem superuous, but it is useful to advanced users
who may create several models in one GAMS run. If we were to use the
explicit list rather than the shortcut /all/, the statement would be written
as model transport / cost, supply, demand / ;
The domains are omitted from the list since they are not part of the
equation name. The list option is used when only a subset of the existing
equations comprises a specic model (or sub-model) being generated. Once
a model has been declared and assigned equations, we are ready to call the
solver. This is done with a solve statement, which in our example is written
as solve transport using lp minimizing z ;
The format of the solve statement is as follows:
1. The key word solve
2. The name of the model to be solved
3. The key word using
4. An available solution procedure.
The complete list is
lp
for linear programming

112

9. A GAMS Tutorial

qcp
for quadratic constraint programming
nlp
for nonlinear programming
dnlp
for nonlinear programming with discontinuous derivatives
mip
for mixed integer programming
rmip
for relaxed mixed integer programming
miqcp
for mixed integer quadratic constraint programming
minlp
for mixed integer nonlinear programming
rmiqcp
for relaxed mixed integer quadratic constraint programming
rminlp
for relaxed mixed integer nonlinear programming
mcp
for mixed complementarity problems
mpec
for mathematical programs with equilibrium constraints
cns
for constrained nonlinear systems
5. The keyword minimizingor maximizing
6. The name of the variable to be optimized

9.9 Display Statements


The solve statement will cause several things to happen when executed. The
specic instance of interest of the model will be generated, the appropriate
data structures for inputting this problem to the solver will be created, the
solver will be invoked, and the output from the solver will be printed to a
le. To get the optimal values of the primal and/or dual variables, we can
look at the solver output, or, if we wish, we can request a display of these
results from GAMS. Our example contains the following statement:
display x.l, x.m ;
that calls for a printout of the nal levels, x.l, and marginal (or reduced
costs), x.m, of the shipment variables, x(i,j). GAMS will automatically
format this printout in to dimensional tables with appropriate headings.

9.9.1 The .lo, .l, .up, .mDatabase


GAMS was designed with a small database system in which records are
maintained for the variables and equations.
The most important elds in each record are:
.lo lower bound
.l level or primal value
.up upper bound
.m marginal or dual value
The format for referencing these quantities is the variable or equations
name followed by the elds name, followed (if necessary) by the domain
(or an element of the domain). GAMS allows the user complete read-and
write-access to the database. This may not seem remarkable to you now,

9.9 Display Statements

113

but it can become a greatly appreciated feature in advanced use. Some


examples of use of the database follow.

9.9.2 Assignment of Variable Bounds and/or Initial Values


The lower and upper bounds of a variable are set automatically according
to the variables type (free, positive, negative, binary, or integer), but these
bounds can be overwritten by the GAMS user. Some examples follow.
x.up(i,j) = capacity(i,j) ;
x.lo(i,j) = 10.0 ;
x.up(seattle,new-york) = 1.2*capacity(seattle,new-york) ;
It is assumed in the rst and third examples that capacity(i,j) is a parameter that was previously declared and assigned values. These statements
must appear after the variable declaration and before the Solve statement.
All the mathematical expressions available for direct assignments are usable on the right-hand side. In nonlinear programming it is very important
for the modeler to help the solver by specifying as narrow a range as possible
between lower and upper bound. It is also very helpful to specify an initial
solution from which the solver can start searching for the optimum. For
example, in a constrained inventory model, the variables are quantity(i),
and it is known that the optimal solution to the unconstrained version of
the problem is a parameter called eoq(i). As a guess for the optimum of
the constrained problem we enter quantity.l(i) = 0.5*eoq(i) ;
(The default initial level is zero unless zero is not within the bounded
range, in which case it is the bound closest to zero.)
It is important to understand that the .lo and .up elds are entirely
under the control of the GAMS user. The .l and .m elds, in contrast, can
be initialized by the user but are then controlled by the solver.

9.9.3 Transformation and Display of Optimal Values


(This section can be skipped on rst reading if desired.)
After the optimizer is called via the solve statement, the values it computes for the primal and dual variables are placed in the database in the
.l and .m elds. We can then read these results and transform and display
them with GAMS statements.
For example, in the transportation problem, suppose we wish to know
the percentage of each markets demand that is lled by each plant. After
the solve statement, we would enter parameter pctx(i,j) perc of market js
demand lled by plant i;
pctx(i,j) = 100.0*x.l(i,j)/b(j) ;
display pctx ;
Appending these commands to the original transportation problem input
results in the following output: pctx percent of market js demand lled by
plant I

114

9. A GAMS Tutorial

new-york
chicago
topeka
seattle
15.385
100.000
san-diego 84.615
100.000
For an example involving marginal, we briey consider the ratio constraints that commonly appear in blending and rening problems. These
linear programming models are concerned with determining the optimal
amount of each of several available raw materials to put into each of several desired nished products. Let y(i,j) be the variable for the number
of tons of raw material i put into nished product j. Suppose the ratio
constraint is that
no product can consist of more than 25 percent of one ingredient, that
is,
y(i,j)/q(j) =l= .25 ;
for all i, j. To keep the model linear, the constraint is written as
ratio(i,j).. y(i,j) - .25*q(j) =l= 0.0 ;
rather than explicitly as a ratio.
The problem here is that ratio.m(i,j), the marginal value associated with
the linear form of the constraint, has no intrinsic meaning. At optimality,
it tells us by at most how much we can benet from relaxing the linear
constraint to
y(i,j) - .25*q(j) =l= 1.0 ;
Unfortunately, this relaxed constraint has no realistic signicance. The
constraint we are interested in relaxing (or tightening) is the nonlinear form
of the ration constraint. For example, we would like to know the marginal
benet arising from changing the ratio constraint to
y(i,j)/q(j) =l= .26 ;
We can in fact obtain the desired marginals by entering the following
transformation on the undesired marginals: parameter amr(i,j) appropriate
marginal for ratio constraint ;
amr(i,j) = ratio.m(i,j)*0.01*q.l(j) ;
display amr ;
Notice that the assignment statement for amr accesses both .m and .l
records from the database. The idea behind the transformation is to notice
that
y(i,j)/q(j) =l= .26 ;
is equivalent to
y(i,j) - .25*q(j) =l= 0.01*q(j) ;

9.10 GAMS Output


The default output of a GAMS run is extensive and informative. For a
complete discussion, see Chapter 10, page 79. This tutorial discusses output
partially as follows:

9.10 GAMS Output

115

Echo Print Reference Maps Status Reports. Error Messages Model Statistics Solution Reports. A great deal of unnecessary anxiety has been caused
by textbooks and usersmanuals that give the reader the false impression
that awless use of advanced software should be easy for anyone with a
positive pulse rate. GAMS. is designed with the understanding that even
the most experienced users will make errors. GAMS attempts to catch the
errors as soon as possible and to minimize their consequences.

9.10.1 Echo Prints


Whether or not errors prevent your optimization problem from being solved,
the rst section of output from a GAMS run is an echo, or copy, of your
input le. For the sake of future reference, GAMS puts line numbers on the
left-hand side of the echo. For our transportation example, which luckily
contained no errors, the echo print is as follows:
3 Sets
4 i canning plants / seattle, san-diego /
5 j markets / new-york, chicago, topeka / ;
6
7 Parameters
8
9 a(i) capacity of plant i in cases
10 / seattle 350
11 san-diego 600 /
12
13 b(j) demand at market j in cases
14 / new-york 325
15 chicago 300
16 topeka 275 / ;
17
18 Table d(i,j) distance in thousands of miles
19 new-york chicago topeka
20 seattle 2.5 1.7 1.8
21 san-diego 2.5 1.8 1.4 ;
22
23 Scalar f freight in dollars per case per thousand miles /90/ ;
24
25 Parameter c(i,j) transport cost in thousands of dollars per case;
26
27 c(i,j) = f * d(i,j) / 1000 ;
28
29 Variables
30 x(i,j) shipment quantities in cases
31 z total transportation costs in thousands of dollars ;

116

9. A GAMS Tutorial

32
33 Positive Variable x ;
34
35 Equations
36 cost dene objective function
37 supply(i) observe supply limit at plant i
38 demand(j) satisfy demand at market j ;
39
40 cost .. z =e= sum((i,j), c(i,j)*x(i,j)) ;
41
42 supply(i) .. sum(j, x(i,j)) =l= a(i) ;
43
44 demand(j) .. sum(i, x(i,j)) =g= b(j) ;
45
46 Model transport /all/ ;
47
48 Solve transport using lp minimizing z ;
49
50 Display x.l, x.m ;
51
The reason this echo print starts with line number 3 rather than line
number 1 is because the input le contains two dollar-print-control statements. This type of instruction controls the output printing, but since it
has nothing to do with dening the optimization model, it is omitted from
the echo. The dollar print controls must start in column 1.
$title a transportation model
$ouppper
The $title statement causes the subsequent text to be printed at the top
of each page of output. The $oupper statement is needed for the echo to
contain mixed upper- and lowercase. Other available instructions are given
in Appendix D, page 193.

9.11 Summary
This tutorial has demonstrated several of the design features of GAMS that
enable you to build practical optimization models quickly and eectively.
The following discussion summarizes the advantages of using an algebraic
modeling language such as GAMS versus a matrix generator or conversational solver.
1) By using an algebra-based notation, you can describe an optimization
model to a computer nearly as easily as you can describe it to another
mathematically trained person.

9.11 Summary

117

2) Because an algebraic description of a problem has generality, most of


the statements in a GAMS model are reusable when new instances of the
same or related problems arise. This is especially important in environments
where models are constantly changing.
3) You save time and reduce generation errors by creating whole sets of
closely related constraints in one statement.
4) You can save time and reduce input errors by providing formulae for
calculating the data rather than entering them explicitly.
5) The model is self-documenting. Since the tasks of model development
and model documentation can be done simultaneously, the modeler is much
more likely to be conscientious about keeping the documentation accurate
and up to date.
6) The output of GAMS is easy to read and use. The solution report
from the solver is automatically reformatted so that related equations and
variables are grouped together and appropriately labeled. Also, the display
command allows you to modify and tabulate results very easily.
7) If you are teaching or learning modeling, you can benet from the
insistence of the GAMS compiler that every equation be mathematically
consistent. Even if you are an experienced modeler, the hundreds of ways
in which errors are detected should greatly reduce development time.
8) By using the dollar operator and other advanced features not covered
in this tutorial, one can e ciently implement large-scale models. Specic
applications of the dollar operator include the following:
1. It can enforce logical restrictions on the allowable combinations of
indices for the variables and equations to be included in the model. You
can thereby screen out unnecessary rows and columns and keep the size of
the problem within the range of solvability.
2. It can be used to build complex summations and products, which can
then be used in equations or customized reports.
3. It can be used for issuing warning messages or for terminating prematurely conditioned upon context-specic data edits

118

9. A GAMS Tutorial

This is page 119


Printer: Opaque this

Appendix A
The First Appendix

Example1.1.

ShorttermscchedulingbasedonDisccretetim
merepre
esentatio
on

Timehorizon:H=9hr

Model:

6/18/2010

CyclicSchedulingofContinuousPlants
Time slot
k=1

stage 1

k=2
k=1

stage 2

k = NK

...
k=2

...

Transition
processing
i

k = NK

.
k=1

stage M

k=2

...

k = NK

time

Time slots of a plant with one production line per stage


(Pinto & Grossmann, 1994)

MINLP model for cyclic scheduling


Maximize
Profit =

WpMi
Im im
Zijkm
Cinvim
Ctrij
Tc
Tc
Tc
i
m
i
j
k m

1
TppikM
Cinvfi iM RpiM 1
TppikM

2 i k
Tc

subject to

ikm

=1

ik
ikm

=1

(1)

(2a)

(2b)

ijkm

= yikm

(3a)

ijkm

= y jk 1m

(3b)

6/18/2010

Tspikm U im yikm 0

k m

(4a)

Tepikm U im yikm 0

k m

(4b)

T ikm U im yikm 0
Tpp

k m

(4 )
(4c)

Tppikm = Tepikm Tspikm i

k m

(4d)

Tsp

i1 m

Tsp

i ( k + 1) m

ijm

z ij 1 m

(5a)

Tep
i

ikm

+ ijm z ij ( k
i

+ 1) m

k < NK m

T c Tpp ikm + ijm zijkm


k i
i
j

(5c)

Tppikm
Tspikm

Tppikm

stage m

Tepikm

Tspikm

Tepikm
Tppik(m+1)

Tppik(m+1)

stage m+1

Tspik(m+1) Tepik(m+1)

Tspik(m+1) Tepik(m+1)
Inventory
level

(5b)

Inventory
I1im

I0im

level

I2im

I1im

I3im

time

I2im

I3im

I0im

time

Inventory levels of products between stages

6/18/2010

I 1im = I 0 im + im Rp im min Tsp ik ( m + 1) Tsp ikm , Tpp ikm


k
k

I 2 im = I 1im + ( im Rp im Rp i ( m +1) )max 0, Tep ikm Tsp ik ( m + 1)


k

I 3im = I 2 im Rp i ( m +1) min Tpp ik ( m + 1), Tep ik ( m + 1) Tep ikm


k
k
k

0 I 1im Im im

0 I 2 im Im im
0 I 3im Im im
Im im U im
i
I

i m

I 3im = I 0 im

(6)

Wp Mi = iM Rp iM Tpp ikM

(7a)

Wp Mi DiTc

(7b)

Variables:

y ikm {0 ,1}
0 z ijkm 1
Tsp ikm , Tep ikm , Tpp ikm , Wp Mi , T c , Im im , I 0 im , I 1im , I 2 im , I 3 im 0

6/18/2010

Motivating example (3P2S)


A

stage 1

Product

stage 2

sale pprice ($
($/ton))

A
B
C

150
400
650

50
100
250

stage 1

product
A
B
C

processing
rate
(kg/h)
800
1200
1000

demand ((kg/h)
g )

stage 2
intermediate
storage
($/ton)

processing
rate
(kg/h)

140.6
140.66
140
140.6

900
600
1100

final
inventory
($/ton.h)
4.06
44.06
06
4.06

Transition times (sequence dependent)


stage 1
product
A
B
C

stage 2

3
8

10
3

3
6
-

A
3
4

B
7
0

C
3
10
-

6/18/2010

stage 1
0

10.84

94.05

19.72
3

stage 2

23 9
23.9

15 68
15.68

91 75
91.75

Inv
( )
(ton)

Time (hr)

Results for motivating example (3P2S)


Profit
= $ 442.53 / hr
Cycle time = 94.05 hr
Variables = 146 (18 bin)
Constraints = 162
CPU time = 12.43 sec
Product
A
B
C

demand (kg/hr)
50
100
250

production (kg/h)
50
100
758

Overview of Planning and Scheduling:


Short-term Scheduling of Batch Plants
Discrete time model
Dr. Munawar A. Shaik
Assistant Professor
Department of Chemical Engineering

Basic Definitions & Applications


Scheduling: Efficient management of resources over a set of
units to perform a group of activities in an optimal fashion
Planning: What?

Where?

How much?

Scheduling: How?
Applications:
Operations Research Community:
Flowshops & Jobshops
Scheduling of Personnel, Vehicles etc.

Chemical Engineering:
Batch plants: Food, Pharmaceuticals, Paper products &
Specialty Chemicals
Continuous/Semi-continuous: Petrochemical & Refinery
operations

People & Places


Chemical engineers have made significant contributions
in Operations Scheduling in the past two decades
Shah, Pantelides et al

Imperial College, London

Grossmann et al

CMU

Floudas et al

Princeton Univ.

Karimi
m ett a
al
Kar

N
NUS
S

Reklaitis, Pekny et al

Purdue

Pinto et al

RPI

Ierapetritou et al

Rutgers Univ.

Supply Chain of an Enterprise


Other Resources

Integration

Challenges:
Different time scales
Consistent Decisions
Infrequent Revision
Large-size Problems

Planning
Forecasting

Scheduling

Market

Operations
Management

Demand/Supply

Plant

RTO
MPC

Control & Instrumentation

Vertical Integration in an Enterprise is Desirable

Planning and Scheduling


Multi-site Production Planning:
period 1 period 2

site 1

Time Horizon is
longer

period T

site 2

site N

Medium-term & Short-term Scheduling:


period t

R l i l Short
Relatively
Sh
Ti
Time
Horizons

Typical Time Horizons:


Planning

3 months to 1 year

Medium-term week or month


Short-term

hour or day

site n

Problem Statement
Given:
Set of products along with their demands and due dates
Set of manufacturing locations
Process flow sheet at each plant
Equipment and storage capacities
Batch processing time for each product in all stages
Transition times (sequence dependent)
Production, transportation, inventory or earliness, and tardiness costs

For Planning determine:


Order allocation across plants
Amounts of products to be
produced
Length of short-term horizon

For Scheduling determine:

Optimal sequencing at each plant

Start and finish times of different


tasks on each unit
Optimal inventory levels
Optimal dispatch schedule

Classification of Scheduling Problems


Batch Plants
Continuous/Semi-continuous

Medium-term Scheduling

Mixed
d production
d
lines

Short-term scheduling

Serial units

Cyclic scheduling

Parallel lines

Robust scheduling

Hybrid flowshops

Reactive scheduling

Discrete time
Continuous-time
formulation

Slot-based
Global-event based
Unit-specific-event based
Precedence based

Classification of Scheduling Problems

Max Profit
Min Make Span
Min Tardiness/Earliness

Multi-product plants
(job shops)
Multi-purpose plants
(flow shops)
Without Resources

Unlimited Storage
No Storage / Zero-wait
Finite-Intermediate
Storage

With Resources
(Utilities)
Dedicated Storage
Flexible Storage

Classification of Scheduling Problems


fA
fB
fC

A
B
C

Multi-product plants (flow shop)


fA
fB
C

A
1

B
fC

Multi-purpose plants (job shop)

Process Representation
STN Representation:

State-Task Network (STN)

S8

Resource-Task Network (RTN)


p diagrams
g
Recipe

S1

Heating
i=1

F dA
Feed

S4
Hot A

0.4
IntAB
0.4 Reaction 2 0.6
S5
i=4, 5
06
0.6
S6

2 products, 3 feeds, 4 intermediates


1 heater, 2 reactors, 1 still
9 states, 8 tasks

Product 1

S2
Feed B

IntBC

Impure E
S7

Reaction 1
i=2, 3
0.5

Reaction 3
i=6, 7
0.2

0.1
Separation
i=8
0.9
S9
Product 2

S3
Feed C

Gantt Chart Schedule:

Process Representations: STN vs RTN


S8

STN Representation:
1 heater, 2 reactors, 1 still

Heating
i=1

S1

9 states, 8 tasks

S4

Feed A

Hot A

Product 1

0.4
IntAB
0.4 Reaction 2 0.6
S5
i=4, 5
0.6
S6

IntBC

S8

Reaction 2
i=4
R ti 2
Reaction
i=5

Hot A
S4 0.4

Heating
i=1
1

0.6
Reactor1
J2

0.5

Feed C

IntBC

Reaction 1
i=2
Reaction 1
i=3

0.5

S9
Product 2

Product 1
Product 2

Feed A

S2

i=8
09
0.9

Feed C

Heater
J1

Feed B

Reaction 3
i=6, 7
0.2

0.1
Separation

S3

RTN Representation:

S1

S7

Reaction 1
i=2, 3
0.5

S2
Feed B

Impure E

0.6
IntAB
S5

0.8

S6
Reactor2
J3

S9

0.4

0.9
0.1 Separation
i=8

Reaction 3
i=6
Reaction 3
i=7

Separator
J4

S7

13 resources, 8 tasks

Impure E

0.2

S3

Different Time Representations


Discrete Time Representation

Continuous Time Representation I


Slot based
U1

U1

UN

UN

5 slots or 6 events

H-1

0 1 2

Continuous Time Representation II


Global
Gl
b l event
based

U1
U2

Only the start times of tasks


have to be at an event

UN

4 events
3

H-1

Events common to all units

H-1

Time intervals of unequal and unknown length


common to all units

Time intervals of equal length common to all units

0 12

Both start and end times


of tasks have to be at an
eventt

U2

U2

Continuous Time Representation III


Unit Specific
event based

U1
n

U2

n+1

UN

0 12

Only 2 events
4

H-1

Events different for each unit

Scheduling Characteristics
Profit maximization

Performance
criteria

Make-span minimization
Mean-flow time minimization
Average tardiness minimization
UIS (Unlimited Intermediate Storage)

Transfer
policies

NIS (No Intermediate Storage)


FIS (Finite Intermediate Storage)
ZW (Zero-Wait Policy)
MIS (Mixed Intermediate Storage)

Mathematical Model
Max Profit or Min Makespan
s.t.

Allocation constraints
Material balance constraints
Capacity constraints
Storage constraints
Duration constraints
Sequence constraints
Demand constraints
Due date constraint
Time horizon constraints

Mixed-Integer Linear/Nonlinear Optimization Problem

Solution of the Scheduling Model


Broadly Two approaches for solution:
Deterministic Methods
Stochastic
h i Methods
M h d
Commercial Software:
Modeling Languages

Solvers

GAMS

LP/MILP CPLEX

ILOG OPL Studio


MOSEL from XPRESSMP
AMPL, LINGO etc.

MINLP

SBB,
SBB DICOPT
DICOPT, BARON

NLP

SNOPT, MINOS, CONOPT

DAEs

MINOPT

Short-Term Scheduling: Batch Plants


Discrete-time model of Kondili et al. (1993)
They first introduced the concept of STN representation.
One of the first models developed in scheduling literature.

horizon is divided into a number of intervals of equal duration


The time
time-horizon

yp
g individual batches of
Events of anyy type-such
as the start or end of p
processing
individual tasks, changes in the availability of processing equipment and other
resources etc.-are only allowed at the interval boundaries.

The main advantage of this type of time representation is that it facilitates the
formulation by providing a reference grid against which all operations competing
for shared resources are positioned.

Short-Term Scheduling: Batch Plants


The length of the time interval is taken to be the highest common factor
of the processing times involved in the problem
The length of the interval may have to be reduced further to ensure that
all resource changes coincide with interval boundaries.

Selection of the grid size:


Tradeoff between accuracy and required computational efforts
Use of the GCF of the processing times as duration of each time
interval
Large combinatorial problems
Coarser discretization
Problem size more tractable
Loss of model accuracy suboptimal solution

Short-Term Scheduling: Batch Plants

Variables

Wijt determines whether a task(i) starts in unit(j)


at the beginning of time period t
Bijt
amountt off material
t i l that
th t starts
t t undergoing
d
i
task(i) in unit (j) at beginning of t
Sst amount of material stored in state s, at the
beginning of t

Allocation Constraints

Short-Term Scheduling: Batch Plants

Capacity Limitations

Material Balance

Other aspects

Similarly other constraints can be modeled using


discrete-time approach such as demand
constraints, duration constraints, different
schedule performance criteria etc.

Examples 1 & 2
STN Representation
S8

S1
F dA
Feed

Heating
i=1

S4
Hot A

Product 1

0.4
IntAB
0.4 Reaction 2 0.6
S5
i=4, 5
06
0.6
S6

S2
Feed B

IntBC

Impure E
S7

Reaction 1
i=2, 3
0.5

Reaction 3
i=6, 7
0.2

0.1
Separation
i=8
0.9
S9
Product 2

S3
Feed C

Problem involves 4 units, 8 processing tasks, 9 states (3 feed, 4 int, 2 product)


Finite intermediate storage (FIS) for intermediates S4,S5,S6 and S7 in example 1
& FIS for intermediates S4,S5 & S7 in example 2
Time horizon: example 1(H= 9 h) & example 2 (H= 10 h)
Objective function: Maximization of profit

10

Example 3
STN Representation
A1
F dA
Feed

A2
Prod A

Int A
B1

Feed B

B2
Prod B

Int B
C1

Feed C

C2
Prod C

Int C

Problem involves 4 units, 6 processing tasks, 9 states (3 feed, 3 int, 3 products)


Finite intermediate storage (FIS) for intermediates int A, int B & int C
Time horizon is 10 h
Objective function: Maximization of profit

Data
Data of coefficients of processing times of tasks, limits on batch sizes of units
Task
i

Examples 1&2

Example 3

Unit
j

Processing
times (h)

Bijmin

Bijmax

(mu)

(mu)

Heating
(i=1)
Reaction1 (i=2)
(i=3)
Reaction2 (i=4)
(i=5)
Reaction3 (i=6)
(i=7)
Separation (i=8)

Heater
Reactor1
Reactor2
Reactor1
Reactor2
Reactor1
Reactor2
Separator

1
2
2
2
2
1
1
2

-----------------

100
80
50
80
50
80
50
200

A1
A2
B1
B2
C1
C2

Unit 1
Unit 2
Unit 3
Unit 4
Unit 2
Unit 3

2
1
1
1
1
2

-------------

2029
1691
720
929
1691
720

11

Data
Data of storage capacities, initial stock levels and prices of various states

Example 1

State

Feed A
Feed B
Feed C
Hot A
Int AB
Int BC
Imp E
P1
P2

Storage Initial
capacity stock
(mu)
(mu)

UL
UL
UL
100
200
150
200
UL
UL

Example 2
Price
($/mu)

Storage
capacity
(mu)

Initial
stock
(mu)

0
0
0
0
0
0
0
1
1

UL
UL
UL
1000
1000
0
1000
UL
UL

AA
AA
AA

AA
AA
AA

Example 3
Price
($/mu)

0
0
0
0
0
0
0
10
10

State

Storage Initial
capacity stock
(mu)
(mu)

Feed A UL
Feed B UL
Feed C UL
Int A
100000
Int B
0
Int C
0
Prod A UL
Prod B UL
Prod C UL

AA
AA
AA

Price
($/mu)

0
0
0
0
0
0
1
1
2.5

UL Unlimited storage capacity


AA Available as and when required

Computational Results
Example

Time Points

CPU
time (s)

Nodes

RMILP
($)

MILP
($)

Binary
variables

Continuous
variables

Constraints Nonzeros

Example 1 (H=9)
17
18
20

0.015
0.015
0.031

4
17
91

232.75
204.99
257.20

214.75
191.75
241

136
144
192

0.016
0.031
0.032

11
28
138

2138.01
2426
2437

2053.33
2268.33
2296.25

200
208
216

0.016
0.015
0
0.015
015

0
21
0

15085
14935
16591.27 15000
17501 35 16756
17501.35

48
120
126

299
316
418

358
379
505

1263
1466
2065

435
458
469

526
547
568

2155
2245
2335

130
310
325

321
801
841

559
1746
1835

Example 2 (H=10)
25
26
27

Example 3 (H=10)
19
20
21

12

Gantt chart for Example 1

R1

R2

R1

R2

R1

R3

R2

R2

R3

R2

R3

H Heater
R1 Reaction 1
R2 Reaction 2
R3 Reaction 3
D Distillation

Time (hrs)

Gantt chart for Example 2

R1

R1

R2

R3

R3

R2

R2

R2

Time (hrs)

13

Gantt chart for Example 3

Time (hrs)

14

Short-term Scheduling of Batch Plants:


Slot based and Global-event based
Continuous-time Models
Dr. Munawar A. Shaik
Assistant Professor
Department of Chemical Engineering

Introduction
Short-term scheduling has received increasing attention from
both academia and industry in the past two decades

Models are usually classified into two main groups based on


time representation:

Floudas & Lin, C&ChE (2004); Floudas & Lin, Annals of OR (2005)

- Discrete-time models
- Continuous-time models

Slot based
Global-event based
Unit-specific-event based

Both Slot based and Global event based models use a set of
events that are common for all tasks and all units while Unit
Unitspecific event based models define events on a unit basis

Unit-specific event based models are considered the most


general and most rigorous representation of time used in shortterm scheduling problems

Different Time Representations


Discrete Time Representation

Continuous Time Representation I


Slot based

U1

U1

U2

U2

UN

UN

Both start and end times


of tasks have to be at an
event

5 slots or 6 events
0

H-1

0 1 2

H-1

Time intervals of equal length common to all units

Time intervals of unequal and unknown length


common to all units

Continuous Time Representation II

Continuous Time Representation III

Global event
based

U1
U2

Only the start times of tasks


have to be at an event

UN

H-1

U2

Events common to all units

n+1

UN

4 events
0 12

Unit Specific
p
event based

U1

Only 2 events
0 12

H-1

Events different for each unit

Literature Review
Review: Floudas and Lin (2004, 2005), Mendez et al. (2006)

Slot-based models
Pinto & Grossmann (1994,1995,1996,1997), Pinto et al. (1998,2000),
Alle & Pinto (2002
(2002, 2004)
2004), Karimi & McDonald (1997)
(1997), Lamba & Karimi
(2002)
Sundaramoorthy & Karimi (2005)

Global event-based models

Zhang & Sargent (1996,1998), Mockus & Reklaitis (1997,1999)


Schilling & Pantelides (1996,1999), Mendez & Cerda (2000,2003)
Maravelias & Grossmann (2003,2004)
Castro et al (2001,2004,2005,2006), Majozi and Zhu (2001), Lee et al
(2001), Wang & Guignard (2002), Burkard et al (2002,2005),

Unit-specific
p
event-based models
Ierapetritou & Floudas (1998a,b), Ierapetritou et al (1999), Lin & Floudas
(2001), Lin et al (2003,2004), Janak et al (2004,2005,2006,2007), Shaik and
Floudas (2007)
Giannelos & Georgiadis (2002, 2003, 2004)

General Short-Term Scheduling Model


Max or Min Profit or Makespan
s.t.

Allocation constraints
Material balance constraints
Capacity constraints
Storage constraints
Duration constraints
Sequence constraints
Demand constraints
Due date constraint
Time horizon constraints

Mixed-Integer Linear Optimization Problem

Global-event based model of


Castro, Barbosa-Povoa, and Matos (2001)
Based on RTN process representation
Global events common across all units
Binary variables for both start and end times of tasks
No special sequencing constraints required because
of the unified treatment of different resources using
RTN

No big-M constraints
Tasks can occur over multiple events
Tasks allowed to end before the end time of the event
resulting in inexact process time representations with
additional wait periods

Global-event based model of


Castro, Barbosa-Povoa, and Matos (2001)

Global-event based model of


Castro, Barbosa-Povoa, and Matos (2001)
For the objective of maximization of profit:
Max Profit =

price R(r, t = T )
r

T (t ') T (t ) i N (i, t , t ') + i (i, t , t ')


N (i, t ) = N (i, t , t ')

i, t , t ' t ' > t

i, t t < T

t '> t

(i, t ) = (i, t , t ')

i, t t < T

t '>t

Vi min N (i, t ) (i, t ) Vi max N (i, t )

i, t t < T

Vi min N (i, t , t ') (i, t , t ') Vi max N (i, t , t ')

i, t , t ' t ' > t , t < T

Global-event based model of


Castro, Barbosa-Povoa, and Matos (2001)
R(r , t ) = Rr0

t =1

Rrmin R ( r , t ) Rrmax
T (t ) H

T (t ) = 0

+ R(r , t 1) t >1 + ( ri N (i, t ) + ri (i, t ) ) + ri N (i, t ', t ) + ri (i, t ', t )


i

t '< t

r , t

r , t

t = 1

N (i, t , t ') = (i, t , t ') = 0

t ' = 1 or t ' t

N (i, t ) = (i, t ) = N (i, t , t ') = (i, t , t ') = 0

t = T

For the objective of minimization of makespan:


Min MS
R(r , t ) Demand r

T (t ) MS

t=T

t=T

Global-event based model of


Castro, Barbosa-Povoa,Matos, Novais (2004)
Based on RTN process representation
Global events common across all units
Improved model compared to Castro et al (2001) by eliminating

redundant binary and continuous variables and with new timing


constraints
Binary variables for only end times of tasks
No special sequencing constraints required because of the
unified treatment of different resources using RTN
No big-M constraints
Tasks can occur over multiple events
Iteration over an additional parameter (t) that defines the limit
on the maximum number of events over which a task can occur
Tasks allowed to end before the end time of the event resulting
in inexact process time representations with additional wait
periods

Global-event based model of


Castro, Barbosa-Povoa,Matos, Novais (2004)
The variables N(i,t) and (i,t) are eliminated from the model of CBM and for
each event we have an additional iteration over a parameter t.

For the objective of maximization of profit:


Max Profit =

price R(r , t = T )
r

T (t ') T (t ) ri i N (i, t , t ') + i (i, t , t ')

r R EQ , t , t ', t < t ' t + t , t T

Vi min N (i, t , t ') (i, t , t ') Vi max N (i, t , t ')

R (r , t ) = Rr0

t =1

+ R (r , t 1) t >1 +
i

Rrmin R(r , t ) Rimax

t <t 't + t

+
i

i, t , t ', t < t ' t + t , t T


ri

t t t '<t

N (i, t , t ') + ri (i, t , t ')

ri

N (i, t ', t ) + ri (i, t ', t )

r , t

r , t

Global-event based model of


Castro, Barbosa-Povoa,Matos, Novais (2004)
T (t ) H
T (t ) = 0

t
t = 1

N (i, t , t ') = (i, t , t ') = 0

t ' = 1 or t ' t or t = T

For the objective of minimization of makespan:


Min MS
R(r , t ) Demand r

t=T

T (t ) MS

t=T

For zero-wait tasks, the following constraint needs to be added:

T (t ') T (t ) H 1 ri N (i, t , t ') + ri i N (i, t , t ') + i (i, t , t ')


iI ZW
iI ZW
r R EQ , t , t ', t < t ' t + t , t T

Global-event based model of


Maravelias and Grossmann (2003)
Based on STN process representation
Global events common across all units
Tasks allowed to take place over multiple events
using time matching constraints involving big-M
constraints

Accounts for various resource constraints such as


utilities and different storage policies

Proposed a new class of tightening constraints for


improved LP relaxation

Global-event based model of


Maravelias and Grossmann (2003)
For the objective of maximization of profit:
Max Profit =

price ST (s, N )

Ws(i, n) 1

j , n

isuitij

Wf (i, n) 1

j , n

isuitij

Ws(i, n)=Wf (i, n)


n

(All tasks that start must finish)

(Ws(i, n ') Wf (i, n ')) 1

j , n

(At most one task can continue)

isuitij n ' n

D(i, n) = iWs (i, n) + i Bs (i, n)

i, n

Global-event based model of


Maravelias and Grossmann (2003)
Tf (i, n) Ts (i, n) + D (i, n) + H (1 Ws (i, n))
Tf (i, n) Ts (i, n) + D (i, n) H (1 Ws (i, n))

Tf (i, n) Tf (i, n 1) H Ws (i, n)

i , n
i, n

i , n > 1

(The finish time of a task i remains unchanged until the next occurance of task i)

Tf (i, n) Tf (i, n 1) D (i, n)


Ts (i, n) = T (n)

i , n > 1

i, n

Tf (i, n 1) T ( n) + H (1 Wf (i, n))

i , n > 1

For zero-wait tasks, the following constraints are added:

Tf (i, n 1) T (n) H (1 Wf (i, n))

i I ZW , n > 1

Global-event based model of


Maravelias and Grossmann (2003)
Ws (i, n) Bimin Bs (i, n) Ws (i, n) Bimax

i, n

Wf (i, n) Bimin Bf (i, n) Wf (i, n) Bimax

Batch-size constraints

i, n

Bimin Ws (i, n ') Wf (i, n ') Bp(i, n) Bimax Ws (i, n ') Wf (i, n ') i, n
n ' n
n ' n
n '< n

n '< n

Bs (i, n 1) + Bp (i, n 1) = Bp (i, n) + Bf (i, n)

B I (i, s, n) = si Bs (i, n)

Constraint to ensure
Bs(i,n)=Bf(i,n)=Bp(i,n)

i, n, s SI (i )

B I (i, s, n) Bimax siWs (i, n)


B O (i, s, n) = si Bf (i, n)

iO ( s )

i, n, s SI (i )
i, n, s SO (i )

B O (i, s, n) Bimax siWf (i, n)


ST ( s, n) = ST ( s, n 1) +

i , n > 1

i, n, s SO (i )

B O (i, s, n)

B (i , s , n )
I

s, n > 1

iI ( s )

Global-event based model of


Maravelias and Grossmann (2003)
T ( n + 1) T ( n)

n < N

Tightening constraints

D(i, n) H

isuitij

D(i, n ') H T (n)

j , n

isuitij n ' n

( Wf (i, n ') + Bf (i, n ') ) T (n)

isuitij n ' n

Ts (i, n) H

i , n

Tf (i, n) H

i , n

ST ( s, n) STsmax

j , n

s FIS , n

T (n) = Wf (i, n) = Bf (i, n) = B O (i, s, n) = 0 n = 1


Ws (i, n) = Bs (i, n) = D(i, n) = Bp (i, n) = B I (i, s, n) = 0

n = N

T (N ) = H

Global-event based model of


Maravelias and Grossmann (2003)
For the objective of minimization of makespan:
Min MS
ST ( s, N ) Demand s

T ( N ) = MS

Tightening constraints

D(i, n) MS

isuitij

D(i, n ') MS T (n)

j , n

isuitij n ' n

When utility requirements are considered, the following constraints are added:

R I (i, r , n) = irWs (i, n) + ir Bs (i, n)

R O (i, r , n) = irWf (i, n) + ir Bf (i, n)

i, r , n

i , r , n

R(r , n) = R(r , n 1) R O (i, r , n 1) + R I (i, r , n)


i

R (r , n) Rrmax

r , n

r , n

Slot based model of


Sundaramoorthy and Karimi (2005)
Based on process representation using recipe diagrams
Recent model that claims superior performance
Slot based but similar to global events common across all units
Tasks allowed to continue over multiple time slots
No resources other than materials and equipments
Several new ways of writing the balances are proposed leading
to a compact model eliminating the otherwise big-M constraints

Claim that no big-M


big M constraints
They demonstrated that the model of Giannelos and Georgiadis
(2002) leads to suboptimal solutions

Claim that the model can effectively handle the objective of


makespan minimization (problems not solved to zero integrality
gap)

Slot based model of


Sundaramoorthy and Karimi (2005)

10

Slot based model of


Sundaramoorthy and Karimi (2005)
The set of tasks (I) also includes an idle task i0that is suitable on all units.

For the objective of maximization of profit:


Max Profit =

price ST (s, K )
s

SL(k ) H
k

Z ( j, k ) =

Y (i, j, k )

j , 0 k < K

isuitij

Z ( j, k ) =

YE (i, j, k )

j , 0 < k < K

isuitij

Y (i, j, k ) Bijmin B(i, j , k ) Y (i, j, k ) Bijmax i > 0, j suitij ,0 k < K


y (i, j , k ) Bijmin b(i, j , k ) y (i, j , k ) Bijmax i > 0 , j suitij ,0 < k < K
YE (i, j, k ) Bijmin BE (i, j , k ) YE (i, j, k ) Bijmax i > 0, j suitij ,0 < k K

Slot based model of


Sundaramoorthy and Karimi (2005)
y (i, j , k ) = y (i, j , k 1) + Y (i, j , k 1) YE (i, j , k ) i, j suitij , 0 < k < K

b(i, j , k ) = b(i, j , k 1)) + B (i, j , k 1)) BE (i, j , k )


t ( j , k + 1) t ( j , k ) +

( Y (i, j, k ) +

isuitij

t ( j, k )

isuitij

ij

ij

y (i, j, k ) + ij b(i, j, k )

ST ( s, k ) = ST ( s, k 1) +

j isuitij ,i 0, si > 0

ST ( s, k ) STsmax

ij

Balance on status of a unit:

i > 0 , j suitij ,k
, >0

B(i, j , k ) ) SL( k + 1)

j , k < K

j, 0 < k < K

si BE (i, j , k ) +

j isuitij ,i 0, si < 0

si B (i, j , k )

s, k

s FIS , k

11

Slot based model of


Sundaramoorthy and Karimi (2005)
Bounds

SL(k ) max max( ij + ij Bijmax )


j
isuitij

t ( j , k ) max( ij + ij Bijmax )
isuitij

k > 0

j , k

Y ( i , j , k ) = y (i , j , k ) = b ( i , j , k ) = B ( i , j , k ) = 0

YE (i, j , k ) = y (i, j , k ) = b(i, j , k ) = BE (i, j , k ) = 0


Z ( j, k ) = t ( j, k ) = 0

i, j suitij = 0 or k = K

i, j suitij = 0 or k = 0

j , k = K

t ( j , k ) = 0; SL ( k ) = 0

k = 0

0 y (i, j , k ), YE (i, j , k ), Z ( j , k ) 1

For the objective of minimization of makespan:


K

Min MS=

SL(k )
k =1

ST ( s, K ) Demand s

References
Floudas, C. A.; Lin, X. Continuous-time versus discrete-time approaches for scheduling of chemical
processes: A review. Comput. Chem. Eng. 2004, 28, 2109.
Floudas, C. A.; Lin, X. Mixed integer linear programming in process scheduling: Modeling,
algorithms, and applications. Ann. Oper. Res. 2005, 139, 131.
Mendez, C. A.; Cerda, J.; Grossmann, I. E.; Harjunkoski, I.; Fahl, M. State-of-the-art review of
optimization methods for short-term scheduling of batch processes. Comput. Chem. Eng. 2006, 30, 913
Maravelias, C. T.; Grossmann, I. E. New general continuous-time state-task network formulation for
short-term scheduling of multipurpose batch plants. Ind. Eng. Chem. Res. 2003, 42, 3056.
Pinto, J. M.; Grossmann, I. E. Optimal cyclic scheduling of multistage continuous multiproduct plants.
Comput. Chem. Eng. 1994, 18, 797.
Sundaramoorthy, A
Sundaramoorthy
A.;; Karimi
Karimi, II. A
A. A simpler better slot-based continuous-time formulation for shortterm scheduling in multipurpose batch plants. Chem. Eng. Sci. 2005, 60, 2679.
Ierapetritou, M. G.; Floudas, C. A. Effective continuous-time formulation for short-term
scheduling: 1. Multipurpose batch processes. Ind. Eng. Chem. Res. 1998, 37, 4341.
Ierapetritou, M.G.; Floudas, C.A. Effective continuous-time formulation for short-term scheduling: 2.
Continuous and semi-continuous processes. Ind. Eng. Chem. Res. 1998, 37, 4360.

12

References
Janak, S. L.; Lin, X.; Floudas, C. A. Enhanced continuous-time unit-specific event-based formulation for
short-term scheduling of multipurpose batch processes: Resource constraints and mixed storage policies.
Ind. Eng. Chem. Res. 2004, 42, 2516.
Shaik, M. A.; Janak, S. L.; Floudas, C. A. Continuous-time models for short-term scheduling of
multipurpose batch plants: A comparative study. Ind. Eng. Chem. Res. 2006, 45, 6190.
Shaik, M. A.; Floudas, C. A. Improved unit-specific event-based model continuous-time model for
short-term scheduling of continuous processes: Rigorous treatment of storage requirements. Ind. Eng.
Chem. Res. 2007, 46, 1764.
Shaik, M. A.; Floudas, C. A. Unit-specific event-based continuous-time approach for short-term
scheduling of batch plants using RTN framework. Comput. Chem. Eng. 2008, 32, 260.
Shaik, M. A.; Floudas, C. A.; Kallrath, J.; Pitz, H. -J. Production scheduling of a large-scale industrial
continuous plant: Short
Short-term
term and medium
medium-term
term scheduling
scheduling , Comput.
Comput Chem
Chem. Eng
Eng. 2009,
2009 32,
32 670
670-686
686.
Shaik, M. A.; Bhushan, M.; Gudi, R. D.; Belliappa, A. M. Cyclic scheduling of continuous multiproduct plants in a hybrid flowshop facility. Ind. Eng. Chem. Res. 2003, 42, 5861.
Munawar, S.A. and Gudi, R.D.A Multi-level, Control-theoretic Framework for Integration of Planning,
Scheduling and Rescheduling, Ind. Eng. Chem. Res., 2005, 44, 4001-4021.
Shaik, M. A.; Floudas, C. A. Unit-specific event-based continuous-time approach for short-term
scheduling of batch plants using RTN framework. Comput. Chem. Eng. 2008, 32, 260.

13

Short-term Scheduling of Batch Plants:


Unit-Specific Event-based Continuoustime Models
Dr. Munawar A. Shaik
Assistant Professor
Department of Chemical Engineering

Unit-specific-event based model of


Ierapetritou and Floudas (1998a,b; et al.1999)
Based on STN process representation
Presented the original concept of event points
True
T
continuous
ti
time
ti
formulation
f
l ti
Location of events different for each unit
Different tasks can start at different times in different units at
the same event point

Sequencing constraints involving big-M constraints


Requires less number of events compared to slot based/ global
event based models

No resources other than materials and equipments


Janak, Lin, Floudas (2004) extended the basic model to
account for resource constraints and storage policies

Short-Term Scheduling: Batch Plants


Shaik, Janak & Floudas (2006)
For the objective of maximization of profit:

Max Profit = prices ST ( s, N ) + si b(i, j , N )

s
i si > 0
jsuitij

w(i, j, n) 1

j,n

isuit ij

w(i, j , n) Bijmin b(i, j , n) w(i, j , n) Bijmax


ST ( s, n) = ST ( s, n 1) +

si

i si > 0

b(i, j , n 1) +

jsuitij

i,j suitij ,n

si

i si < 0

ts (i, j , n + 1) ts (i ' , j , n) + i ' j w(i ' , j , n) + i ' j b(i ' , j , n)

b(i, j , n)

s,n

jsuitij

i, i ' , j suit ij , suiti ' j , n < N

ts (i, j , n + 1) ts (i ', j ', n) + i ' j ' w(i ', j ', n) + i ' j ' b(i ', j ', n) H (1 w(i ', j ', n))
s , i , i ', j , j ' suitij , suiti ' j ' , i i ', j j ', si < 0, si ' > 0, n < N

Short-Term Scheduling: Batch Plants


Shaik, Janak & Floudas (2006)
ts (i, j , n) H

i, j suitij , n

ts (i, j , N ) + ijj w(i, j , N ) + ijj b(i, j , N ) H

w(i, j , n) = b(i, j , n) = ts (i, j , n) = 0

i, j suitijj

i, j suitij = 0

For the objective of minimization of makespan:


Min MS

ST (s, N ) +

si > 0

si

b(i, j , N ) Demand s

jsuitij

ts (i, j , N ) + ij w(i, j , N ) + ij b(i, j , N ) MS

i, j suitij

Short-Term Scheduling: Batch Plants


Shaik & Floudas (2008)

RTN representation has not been explored in literature


for unit-specific event-based models

Unit-Specific Event-based Continuous-time formulation for Short-Term


Scheduling of Batch Plants without Resources (such as utilities)
The work is extension of STN model of Ierapetritou & Floudas (1998)
Improved Sequencing Constraints (for handling sequence-dependent
changeovers)
h
)
Alternate approach for handling dedicated finite-intermediate storage
without the need for considering storage as a separate task
Additional tightening constraint
Limitation: Does not allow tasks to take place over multiple events

Short-Term Scheduling Model


Nomenclature
Sets
I
Ir
R
RJ
RS
RFIS
N

tasks
tasks related to resource r
resources
equipment resources
material resources
material resources with finite dedicated storage
event points within the time horizon

Parameters
H
Pr
Dr

r
ii '

Ermin

Ermax
rip , ric
rip , ric

scheduling horizon
price of resource r
demand for resource r
sequence independent clean up time
sequence-dependent clean up time required between tasks i and i
lower bound on the availability of resource r
upper bound on the availability of resource r
c
proportion of equipment resource produced, consumed in task i, rip 0, ri 0
p
c
proportion of material resource produced, consumed in task i, ri 0, ri 0

Short-Term Scheduling Model


Nomenclature
Binary variables
w(i,n)

Assign the beginning of task i at event n

Positive variables
b(i,n))
b(i
E0(r)
E(r,n)
Ts(i,n)

A
Amount
t off material
t i l processed
d by
b ttaskk i in
i eventt n
initial amount of resource r available or required from external sources
excess amount of resource r available at event n
time at which task i starts at event n

Capacity Constraints
w(i, n) Bimin b(i, n) w(i, n) Bimax
Ermin E ( r , n) Ermax

i I , n N

(1)

r R , n N

(2)

Short-Term Scheduling Model


Excess Resource Balances
The amount of a resource r produced or consumed
by task i is represented as:

ri w(i, n) + ri b(i, n)

E ( r , n) = E ( r , n 1) + ( rip w(i, n 1) + rip b(i, n 1) ) + ( ric w(i, n) + ric b(i, n) )


iI r

iI r

r R , n N , n > 1

E (r , n) = E0 (r ) + ( ric w(i, n) + ric b(i, n) )

r R , n N , n = 1

(3a)
(3b)

iI r

The excess resource balances are more generic compared to their


counterpart (material balances) in STN based models

Analysis for Equipment Resources: (keeps track of the status of a unit)


J
E (r , n) = E (r , n 1) + rip w(i, n 1) + ric w(i, n) r R , n N , n > 1
iI r

iI r

E (r , n) = E0 (r ) + ric w(i, n)

r R J , n N , n = 1

iI r

A separate task is assumed for each task suitable in multiple equipment resources
Implicitly represents the allocation constraint (No need to write separately)

Analysis for Material Resources: (Reduces to the material balances in STN)

Short-Term Scheduling Model


Sequencing Constraints
(i) Same task in the same unit
T s (i, n + 1) T s (i, n) + i w(i, n) + i b(i, n)

i I , n N , n < N

(4)

((ii)) Different tasks in the same unit:


(a) No changeovers or cleanup times:

T s (i, n + 1) T s (i ', n) + i ' w(i ', n) + i 'b(i ', n)

r R J , i I r , i ' I r , n N , n < N

(5a)

(b) Sequence-independent cleanup times:


T (i, n + 1) T s (i ', n) + i ' w(i ', n) + i 'b(i ', n) + r w(i ', n) r R J , i I r , i ' I r , i i ', n N , n < N (5b)
s

(c) Sequence-dependent changeovers:


T s (i, n) T s (i ', n ') + i ' w(i ', n ') + i 'b(i ', n ') + ii'ii w(i, n) H (1 w(i ', n ')) H

w(i ", n ")

i "I r n '< n "< n

r R J , i I r , i ' I r , i i ', n N , n ' N , n > n '

(5c)

The last constraint is novel and more generic than the earlier version
shown below

Only the last constraint has big-M terms unlike in the earlier works

Short-Term Scheduling Model


Sequencing Constraints
(iii) Different tasks in different units:
T s (i, n + 1) T s (i ', n) + i ' w(i ', n) + i 'b(i ', n) H (1 w(i ', n))
r R S , i ' I r , i I r , i i ', rip' > 0, ric < 0, n N , n < N

(6)

Time Bounding Constraints


T s (i, n) H

i I , n N

T s ( i , N ) + i w( i , N ) + i b ( i , N ) H

(7a)

i I

(7b)

Ti ht i Constraint
Tightening
C
t i t

( w(i, n) + b(i, n)) H

nN iI r

r R J

(8)

The tightening constraint provides a better LP relaxation

Objective Function
Maximization of Profit

P E (r , N ) + (

Max Profit =

rR S

iI r

p
ri

w(i, N ) + rip b(i, N ) )

(9)

Minimization of MakeSpan (MS)

Demand Constraints
E (r , N ) + ( rip w(i, N ) + rip b(i, N ) ) Dr

r R S

(10)

iI r

Time Bounding Constraints


T (i, N ) + i w(i, N ) + i b(i, N ) MS
s

i I

(11)

Modified Tightening Constraint

( w(i, n) + b(i, n)) MS

nN iI r

r R J

(12)

This is the model for Unlimited Intermediate storage (UIS)

Dedicated Finite Intermediate


Storage (FIS)
Finite Storage requirement:

E (r , n) Ermax

r R s , n N

Simply enforcing an upper bound may lead to violations in storage


requirements in real time

Example:

N2

U2
U1

100

E(r,N1)=200 ?

N1
N2
300

Using the Lin & Floudas (2001) model :


Storage needs to be considered as a separate task, and the allocation and
sequencing constraints are written for storage tasks as well

Dedicated Finite Intermediate


Storage (FIS)
We Propose an Alternate Method for handling dedicated FIS:
(without the need for considering storage as a separate task)

Two additional Sequencing


q
g Constraints
T s (i, n + 1) T s (i ', n) + i ' w(i ', n) + i 'b(i ', n) + H (2 w(i ', n) w(i, n + 1))

(6a)

r R FIS , i ' I r , i I r , i i ', rip' > 0, ric < 0, n N , n < N

Constraint (6a) along with Eq (6) for different tasks in different units will enforce the start
time of next event to be equal to the end of previous event
T s (i, n) T s (i ', n) + i ' w(i ', n) + i 'b(i ', n) + H (1 w(i ', n))
r R FIS , i ' I r , i I r , i i ', rip' > 0, ric < 0, n N

(6b)

Constraint (6b) enforces that the start time of the consuming task at event n should be
before the end of the active producing task (producing FIS) at event n
There is no need to write these constraints at the end of the horizon time, as the excess
amount produced can stay in the batch unit itself

Flexible FIS: storage needs to be considered as a separate task (Janak et al., 2004)

Unit-specific-event based model of


Giannelos and Georgiadis (2002)
Based on STN process representation
Slight
g variation of the model of Ierapetritou
p
and Floudas (1998),
(
)
using buffer times for relaxing the task durations and implicitly
eliminated the various big-M constraints of Ierapetritou and
Floudas (1998)

No big-M constraints
Although based on unit specific events, due to special
sequencing constraints on tasks producing/consuming the
same state
state, it is similar to global events

They enforce the start and end times of all tasks producing or
consuming the same state to be same

Thus leading to suboptimal solutions as observed by


Sundaramoorthy & Karimi (2005) and also in this work

Benchmark Examples
Problem Statement

Given:

Determine:

P d ti recipe
Production
i iin tterms off ttaskk sequences
Pieces of equipment and their ranges of capacities
Material storage policy (Unlimited)
Production requirement
Utility requirements and their maximum availabilities
Time horizon under consideration
Optimal sequence of tasks taking place in each unit
Amount of material processed at each time in each unit
Processing time of each task in each unit
Utility usage profiles

So as to optimize a performance criterion,


Maximization of profit, minimization of makespan,
minimization of order earliness, etc.

Example 1
STN Representation

S1

Task 1
i=1, 2

S2

Task 2
i=3

S3

Task 3
i=4, 5

S4

Problem involves 5 units, 3 processing tasks, and 4 states (1 feed, 2 int, 1 product)
Variable batch sizes and processing times
Unlimited intermediate storage (UIS) for all states
Consider two objective functions:
Maximization of Profit
for 3 cases of different time horizons:
Case 1a: H=8 hr
Case 1b: H=12 hr
Case 1c: H=16 hr

Minimization of Makespan
for 2 cases of different demands:
Case 1a: D4 =2000 mu
Case 1b: D4 =4000 mu

Example 2
STN Representation
S8

S1

Heating
i=1

F dA
Feed

S4
Hot A

Product 1

0.4
IntAB
0.4 Reaction 2 0.6
S5
i=4, 5
06
0.6
S6

S2
Feed B

Impure E

IntBC

S7

Reaction 1
i=2, 3
0.5

0.1
Separation
i=8
0.9

Reaction 3
i=6, 7
0.2

S9
Product 2

S3
Feed C

Problem involves 4 units, 8 processing tasks, 9 states (3 feed, 4 int, 2 product)


Variable batch sizes and processing times
Unlimited intermediate storage (UIS) for all states
Consider two objective functions:
Minimization of Makespan
for the following demands:

Maximization of Profit
for 3 cases of different time horizons:
Case 2a: H=8 hr
Case 2b: H=12 hr

D8 =200 mu
D9 =200 mu

Example 3
STN Representation

Feed 3

S8

0.75
Heating 2
i=2
Int 1
S1

Heating 1

S3
0.5
Reaction 2
i=5, 6
0.5

S2

S6

i=1

Feed 1

Reaction 1
i=3, 4

Feed 2

S5
Int 3

S4

S9
Int 6

0.25
Int 4

Reaction 3 0.4
S13
i=7, 8
Product 2
0.6
Int 7 S10

Int 5
0.4
0.4
Separation 0.5 S7 0.4 Mixing
i=9
i=10, 11
0.1
0.2
Feed 4

S12
Product 1

S11

Int 2

Problem involves 6 units, 11 processing tasks, 13 states (4 feed, 7 int, 2 product)


Variable batch sizes and processing times
Unlimited intermediate storage (UIS) for all states
Consider 3 cases of different time horizons:
Maximization of Profit
for 2 cases of different time horizons:
Case 3a: H=8 hr
Case 3b: H=12 hr

Minimization of Makespan
for 2 cases of different demands:
Case 3a: D12 =100 mu, D13 =200 mu
Case 3b: D12 = D13 =250 mu

Computational Results
Maximization of Profit

Example 1
Model

Events

Example 1a (H=8)
S&K
M&G
CBM
CBMN(t=1)
(t=2)
G&G
I&F

5
5
5
5
5
4
4
5

Example 1b (H=12)
S&K
9
M&G
9
CBM
9
CBMN(t=1)
9
(t=2)
9
G&G
6
I&F
6
7
Example 1c (H=16)
S&K
12
13
M&G
12
13
CBM
12
13
CBMN(t=2)
12
(t=3)
12
(t=3)
13
G&G
11
I&F
9
10
a Suboptimal

CPU
time (s)

Nodes

RMILP
($)

MILP Binary Continuous Constraints Nonzeros


($) variables variables

0.05
0.03
0.04
0.01
0.02
0.01
0.01
0.05

13
2
0
0
7
0
1
160

2000.0
2000.0
2000.0
2000.0
2000.0
2000.0
2000.0
2804.6

1840.2
1840.2
1840.2
1840.2
1840.2
1840.2
1840.2
1840.2

40
40
70
20
35
20
10
15

215
195
115
70
85
76
48
62

192
520
201
86
116
122
69
92

642
1425
655
274
414
355
176
245

26.83
29.52
26.93
0.23
10.32
0.03
0.03
0.19

27176
26514
23485
606
21874
22
24
589

4481.0
4563.8
5237.6
4419.9
5237.6
3890.0
4000.0
4857.6

3463.6
3463.6
3463.6
3301.6 a
3463.6
3301.6a
3463.6
3463.6

80
80
220
40
75
30
20
25

415
375
301
130
165
114
76
90

408
1000
553
162
232
182
115
138

1358
3415
2099
546
886
541
314
383

5328 22
5328.22
>670001
37675.13
>670002
32456.61
>670003
1086.08
3911.14
40466.83
3.40
1.76
20.60

3408476
36297619
17465450
20693001
14385711
22948021
1642027
4087336
44252075
9533
6596
89748

6312.6
6312
6
6381.9
6332.8
6391.4
7737.6
8237.6
7737.6
7737.6
8237.6
6236.0
6601.5
6601.5

5038
5038.1
1
5038.1
5038.1
5038.1
5038.1
5038.1
5000.0 a
5038.1
5038.1
4840.9a
5038.1
5038.1

110
120
110
120
385
450
105
150
165
55
35
40

565
615
510
555
493
567
225
270
295
209
118
132

570
624
1360
1480
922
1065
319
409
448
332
184
207

1895
2074
5275
5965
3707
4343
1240
1680
1848
1006
521
590

solution; Relative Gap: 1.24 %1, 6.54%2, 2.92%3

Example 1c

Maximization of Profit

9 events, Bin = 35
CPU time = 1.76 sec
Nodes=6596

Ierapetritou & Floudas (1998)


12 events, Bin = 150
CPU time = 4997.22 sec
Nodes = 4087336

Castro et al (2004)

Computational Results
Example 2
Model

Events

Example 2a (H=8)
S&K
M&G
CBM
CBMN(t=1)
G&G
I&F

5
5
5
5
4
4
5

Example 2b (H=12)
S&K
7
8
9
10
11
M&G
7
8
9
10
11
CBM
7
8
9
10
11
CBMN(t=2)
7
8
9
10
11
G&G
6(to 11)
I&F
7
8
a

CPU
time (s)
0 07
0.07
0.16
0.07
0.01
0.03
0.03
0.28

RMILP
($)

4
26
8
4
14
13
883

1730.9
1730
9
1730.9
1812.1
1730.9
1812.1
1812.1
2305.3

1498
1498.6
6
1498.6
1498.6
1498.6
1498.6
1498.6
1498.6

48
64
112
32
32
18
26

235
360
184
104
142
90
115

249
826
322
114
234
165
216

859
2457
1105
439
820
485
672

3002.5
3167.8
3265.2
3315.8
3343.4
3002.5
3167.8
3265.2
3315.8
3343
3343.4
4
3190.5
3788.3
4297.9
4770.8
5228.7
3045.0
3391.0
3730.5
4070.0
4409.5
3190.5
3788.3
4297.9

2610.1
2610.3
2646.8
2646.8
2646.8a
2610.1
2610.3
2646.8
2646.8a
2658
2658.5
5
2610.1
2610.3
2646.8
2646.8
2627.9a
2610.1
2610.3
2646.8
2646.8
2646.8a
2564.6a
2658.5
2658.5

72
84
96
108
120
96
112
128
144
160
216
280
352
432
520
88
104
120
136
152
48
42
50

367
433
499
565
631
526
609
692
775
858
316
394
480
574
676
188
218
248
278
308
208
165
190

387
456
525
594
663
1210
1402
1594
1786
1978
572
721
886
1067
1264
224
261
298
335
372
348
318
369

1363
1615
1867
2119
2371
4019
4884
5805
6782
7815
2146
2791
3519
4330
5224
1050
1238
1426
1614
1802
1238
1046
1233

1.93
1234
29.63
16678
561.58
288574
10889.61
3438353
>670001
17270000
2.15
814
58.31
17679
2317.38
611206
>670002
10737753
>670003
9060850
1.38
1421
35.81
30202
1090.53
680222
40355.97 19225950
>670004
13393455
0.63
1039
14.39
32463
331.72
593182
4366.09
6018234
>670005
80602289
0.33
701
6.19
14962
105.64
211617

MILP
($)

Maximization of Profit

Nodes

Binary
variables

Continuous
variables

Constraints

Nonzeros

Suboptimal solution; Relative Gap: 1.59 %1, 3.16%2, 5.12%3 , 28.16%4 , 2.58%5

Computational Results
Example 3
Model

Events

Example 3a (H=8)
S&K
M&G
CBM
CBMN(t=2)
G&G
I&F

7
7
7
7
5
5
6

Example 3b (H=12)
S&K
9
10
M&G
9
10
CBM
9
10
CBMN(t=2)
9
10
G&G
6
I&F
7
8
a

CPU
time (s)

RMILP
($)

MILP
($)

145888
429949
13130
10361
807
1176
57346

2513.8
2560.6
2809.4
2606.5
2100.0
2100.0
2847.8

1583.4
1583.4
1583.4
1583.4
1274.5a
1583.4
1583.4

102
132
297
121
55
30
41

597
717
433
264
244
155
190

584
1667
841
343
392
303
377

2061
5601
3049
1495
1335
875
1139

372.92
94640
>710001 12781125
19708.33 2254227
2
>71000
5857914
290.84
80123
16416.31
3194816
107.97
47798
1173.82
751686
1.18
2750
18.33
15871
50.48
41925

3867.3
4029.7
3867.3
4029.7
4059.4
4615.6
3864.3
4189.8
2871.9
3465.6
4059.4

3041.3
3041.3
3041.3
2981.7a
3041.3
3041.3
3041.3
3041.3
2443.2a
3041.3
3041.3

136
153
176
198
484
594
165
187
66
52
63

783
876
943
1056
658
787
348
390
290
225
260

792
896
2195
2459
1307
1576
457
514
469
451
525

2789
3153
8114
9492
5001
6154
2031
2299
1608
1403
1667

184.46
1012.68
19.82
6.90
0.35
0.38
25.92

Nodes

Maximization of Profit
Binary
Continuous Constraints Nonzeros
variables variables

Suboptimal solution; Relative Gap: 3.76 %1, 12.85 %2

Minimization of Makespan

Example 1
Model

Events

Example 1a (D4=2000 mu)


S&K
13
14
15
16
17
M&G
13
14
15
16
CBM
13
14
15
16
CBMN(t=1)
13
(t=1)
14
(t=1)
15
(t=2)
15
(t=2)
16
(t=2)
17
G&G
12
15
I&F
12
13
14
15
Example 1b (D4=4000 mu)
S&K
23
24
M&G
23
24
CBM
23
24
CBMN(t=1)
23
(t=2)
24
(t=2)
25
G&G
22
24
I&F
22
23
a

H
(hr)

CPU
time (s)

Nodes

RMILP
(hr)

MILP
(hr)

27.126
25.702
25.142
24.871
24.716
27.126
25.335
25.024
24.834
23.313
21.049
19.049
17.049
27.126
25.824
25.358
19.049
17.049
15.049
27.126
25.064
24.236
24.236
24.236
24.236

29.772
29.772
29.439
29.106
28.773a
29.772
29.772
29.439
29.106a
29.772
29.772
29.439
29.106a
29.772
29.772
29.772
29.439
29.106
28.773a
29.772
29.772a
28.439
27.903
27.881
27.881

120
130
140
150
160
120
130
140
150
450
520
595
675
60
65
70
135
145
155
60
75
50
55
60
65

615
665
715
765
815
556
601
646
691
568
647
731
820
191
206
221
286
306
326
228
285
160
174
188
202

624
678
732
786
840
1485
1605
1725
1845
1066
1219
1382
1555
239
258
277
407
436
465
367
457
253
276
299
322

2074
2253
2432
2611
2790
6056
6786
7551
8351
4404
5095
5836
6627
824
892
960
1605
1723
1841
1108
1387
732
801
870
939

-101.03
34598 51.362
-- 15814.03 4164921 49.939
100 21974.42 2525960 51.362
>900004 5129168 49.572
-6.09
185 43.313
-2016.50
136348 41.049
-0.05
0 51.362
-0.20
72 50.061
->800005 34358380 39.049
-0.07
0 51.362
-1.53
1707 49.594
100
6.48
19019 48.473
384.12
832372 48.473

56.432
56.432a
56.432
57.765a
56.432
56.432a
56.432
56.432
56.099a
56.432
56.432a
52.433
52.072

220
230
220
230
1375
1495
110
115
235
110
120
100
105

1115
1165
1006
1051
1583
1712
341
356
486
418
456
300
314

1164
1218
2685
2805
3046
3299
429
448
697
667
727
483
506

3864
4043
14931
16011
13564
14755
1504
1572
2785
2038
2224
1422
1491

-1.18
362
-31.54
15622
-728.05
400789
-- 37877.69 12064418
-- >800001 17279722
50
2.19
394
645.06
139488
25253.81 5273904
>900002 11258561
-0.50
6
-14.90
4262
-2163.55
454549
-- 64850.69
9852772
-0.02
0
-0.11
65
-0.28
417
-235.90
236250
-- 27994.64 23426601
-- >800003
80105289
-0.03
0
-1.87
3529
50
0.12
208
2.26
7863
41.89
134961
950.64
2693556

Binary
Continuous Constraints Nonzeros
variables variables

Suboptimal solution; Relative Gap: 4.22 %1, 7.38 %2, 0.12%3, 11.01%4, 2.18 %5

Computational Results
Minimization of Makespan

Example 2
Model

Events

Example 2 (D8=D9=200 mu)


S&K
9
10
11
M&G
9
10
11
7887
CBM
9
10
11
CBMN(t=1)
9
(t=1)
10
(t=2)
10
(t=2)
11
G&G
8
10
I&F
8
9
10
a

H
(hr)

CPU
time (s)

---50

10.98
519.35
11853.03
66.55
5693.53
>800001

---------50

7.75
727.23
32258.74
0.71
50.49
56.11
5535.27
1.97
1614.35
0
0.78
78
74.26
1672.11

Nodes

RMILP
(hr)

5378 18.685
142108 18.685
2840768 18.685
15674 18.685
1066939 18.685
5019315
6426
441130
13776145
1809
134189
109917
8389012
3804
1182082
1008
111907
2079454

12.555
9.889
7.223
18.685
18.685
15.654
12.988
12.555
10.475
12
12.738
738
12.477
12.435

MILP Binary Continuous Constraints Nonzeros


(hr) variables variables
19.789
19.340
19.340
19.789
19.340
18.685

96
556
108
622
120
688
128
693
144
776
19.340
160

528
597
666
1598
1790
859

1936
2188
2440
5869
6850
1982

19.789
19.340
19.340
19.789
19.789
19.340
19.340
19.789
19.789a
19
19.764
764
19.340
19.340

352
432
520
64
72
136
152
64
80
45
53
61

888
1069
1266
216
241
337
374
475
589
367
418
469

3584
4403
5305
872
979
1623
1811
1675
2093
1211
1398
1585

481
575
677
193
215
279
309
274
340
190
215
240

Suboptimal solution; Relative Gap: 2.03 %1

Computational Results
Minimization of Makespan

Example 3
Model

Events

H
(hr)

CPU
Nodes
time (s)

Example 3a (D12=100 mu, D13=200 mu)


S&K
8
-0.28
9
-13.32
10
-226.83
11
-4340.65
12
-- >800001
M&G
8
50
1.15
9
126.77
10
3949.36
11
>800002
CBM
8
-0.62
9
-5.89
10
-53.42
11
-2514.97
12
-- >800003
CBMN(t=2)
8
-0.23
(t=2)
9
-2.23
(t=2)
10
-14.73
(t=2)
11
-312.07
(t=3)
(t
3)
11
-- 20230.89
(t=3)
12
-- 11547.29
G&G
7
-0.25
9
-3.36
I&F
7
50
0.38
8
2.89
Example 3b (D12=D13=250 mu)
S&K
11
-981.01
M&G
11
100 62724.36
CBM
11
-38.14
CBMN(t=2)
11
-31.57
G&G
10
-59.26
I&F
10
100
2.50
11
396.58
a

RMILP
(hr)

36
5156
53789
821194
11858901
316
21366
605450
7481387
68
2762
22452
673460
20380858
67
2566
17426
326752
16842943
5054232
338
3960
458
3506

12.317
11.621
11.417
11.335
11.295
12.317
11.621
11.417

226238
5802875
9627
28079
84970
2668
424617

MILP
(hr)

Binary
Continuous Constraints Nonzeros
variables variables

10.941
8.941
6.941
4.941
3.825
12.192
10.192
8.192
6.192
6.192
4.635
11.066
10.167
11.066
10.000

14.366
13.589
13.532
13.367
13.367
14.366
13.589
13.532
11.335
14.366
13.589
13.532
13.367
13.367
14.366
13.589
13.532
13.532
13.367
13.367
14.616
14.616a
13.367
13.367

119
690
136
783
153
876
170
969
187
1062
154
831
176
944
198
1057
13.367
220
385
541
484
659
594
788
715
928
847
1079
143
307
165
349
187
391
209
433
297
521
330
574
77
336
99
428
52
225
63
260

689
793
897
1001
1105
1937
2201
2465
1170
1064
1309
1578
1871
2188
402
459
516
573
725
801
558
712
452
526

14.535
14.535
10.722
12.494
12.763
12.500
12.500

17.357a
17.357a
17.357a
17.357a
18.978a
17.025
17.025

170
220
715
209
110
85
96

1001
2729
1871
573
789
674
748

969
1170
928
433
474
330
365

2425
2789
3153
3517
3881
6905
8208
9592
2729
4044
5090
6254
7536
8936
1776
2044
2312
2580
3494
3877
1902
2448
1413
1677

11057

3517
11057
7536
2580
2721
2205
2469

Suboptimal solution; Relative Gap: 1.01 %1, 3.055 %2, 3.29 %3

Conclusions

Compared and assessed various continuous-time formulations for short-term


scheduling of batch plants
Slot based vs. Global-event based vs. Unit-specific-event based models are
compared with respect to different performance metrics
Different instances of 3 benchmark examples with 2 objective functions: Max Profit
and Min Makespan
Giannelos & Georgiadis (2002) yields suboptimal solutions due to special
sequencing constraints
Both Slot based and Global-event based models require same number of events,
while the Unit-specific-event based model almost always requires less number of
events
Both Slot based and Global-event based models have weak performance for the
objective of makespan minimization
Unit-specific-event
Unit
specific event based model performs well for both the objectives of max.
max profit
and min. makespan considered in this study
Unit-specific-event based model outperforms all the models compared in this study
in terms of faster computational times resulting from compact model statistics,
despite the presence of big-M constraints
Unit-specific-event based models treat the time horizon in a True continuous time
fashion without the requirement of small unnecessary slots as required by the slot or
global event based models

Short-Term Scheduling of Continuous


Plants: Industrial case study of FMCG

Dr. Munawar Abdul Shaik


Assistant Professor
Department
p
of Chemical Engineering
g
g

Classification of Scheduling Problems


Batch Plants
Continuous Plants
Mixed production
lines

Long-term Scheduling
Medium-term scheduling
Short-term scheduling

Discrete time
Slot-based
Continuous-time
formulation

Global event-based
Unit-specific event-based

Motivation behind the Proposed


Short-Term Scheduling Model
Ierapetritou & Floudas (1998) model for Continuous Plants
Approximation of storage
Reported approximate/ suboptimal solutions for UIS and
FIS cases of an Industrial Case Study
Mendez & Cerda (2002) and Giannelos & Georgiadis(2002)
Reported suboptimal solutions for FIS case of an Industrial
Case Study
Castro & co-workers ((2004a,, 2004b))
Reported suboptimal solutions for NIS case of an
Industrial Case Study
Classified the problem as Intractable despite using a
Decomposition Strategy
Shaik and Floudas (2007) proposed an improved model

Short-Term Scheduling Model


Shaik and Floudas (2007) model

- Unit-specific Event-based Continuous-Time Formulation


- Improved version of the Model of Ierapetritou and Floudas (1998)
for Rigorous Handling of Different Storage Requirements and
Improved Sequencing Constraints
Nomenclature
Binary variables
w(i,n)
z(ist,n)

Assign the beginning of task i at event n


Whether there is nonzero amount stored at event n

Positive variables
B(i,n)
ST(s,n)
ST0(s)
Ts(i,n)
Tf(i,n)

Amount of material undertaking task i at event n


Excess amount of state s that needs to be stored at event n
Initial amount of state s required from external resources
Time that task i starts at event n
Time that task i ends at event n

Proposed Short-Term Scheduling Model


With Bypassing of Storage:

Without Bypassing of Storage:

- only the excess amount is stored

- Whatever is produced is always


stored

UIS (Unlimited Intermediate Storage)


NIS (No Intermediate Storage)

Storage
policies

FIS (Finite Intermediate Storage)


ZW (Zero-Wait Policy)
MIS (Mixed Intermediate Storage)

Unlimited Intermediate Storage Case


(UIS)
No need to model storage as a separate task
No difference in the model due to bypassing of storage
Allocation constraints:

w(i, n) 1

j J , n N

iI j

Capacity constraints for processing tasks:

Rimin
(T f (i p , n) T s (i p , n)) b(i p , n) Rimax
(T f (i p , n) T s (i p , n))
p
p
b(i p , n) = Ri p (T (i p , n) T (i p , n))
f

min
p
max
Demand constraints: Ds si b(i p , n) Ds
nN i pI s

i p I p , n N

i p I p , n N

s S P

Duration constraints for processing tasks:

T f (i p , n) T s (i p , n) Hw(i p , n)
Extra tightening constraint:

(T

n N iI j

(i, n) T s (i, n)) H min


j

i p I p , n N
j J

Unlimited Intermediate Storage Case


(UIS)
Material balance constraints
Raw materials (available as and when required):
ST0 ( s, n) + sic p b(i p , n) = 0
s S R , n N
i p I s

Raw materials (entire amount available in the beginning):


ST ( s, n) = ST ( s, n 1) +

i p I s

ST ( s, n) = ST0 ( s ) +

i p I s

c
si p

c
si p

s S R , n N , n > 1

b(i p , n)

s S R , n = 1

b(i p , n)

Intermediates:

ST ( s, n) = ST ( s, n 1) +

i p I s

ST ( s, n) = ST0 ( s ) +

i p I s

p
si p

p
si p

b(i p , n) +

b(i p , n) +

i p I s

i p I s

c
si p

c
si p

b(i p , n) s S IN , n N , n > 1

b(i p , n) s S IN , n = 1

Unlimited Intermediate Storage Case


(UIS)
Sequencing Constraints
s
f
Same task in the same unit: T (i, n + 1) T (i, n)

i I , n N , n N

Different tasks in the same unit:


(a) No changeovers or cleanup times:

T s (i, n + 1) T f (i ' , n)

j J , i I j , i ' I j , n N , n N

(b) Sequence independent cleanup times:

T s (i, n + 1) T f (i' , n) + j w(i' , n)

j J , i, i ' I j , i i' , n N , n N

(c) Sequence dependent changeovers:

T s (i, n) T f (i ', n ') + ti'icl w(i, n) H (1 w(i ', n ')) H

w(i ", n ")

i " n '< n "< n

Different tasks in different units - processing tasks:

j J , i, i ' I j , i i ', n, n ' N , n > n '

T s (i p , n) T s (i ' p , n) H (1 w(i ' p , n))


s S IN , i p I s , i ' p I s , i p i ' p , sip' p > 0, sic p < 0, n N
T f (i p , n) T f (i ' p , n) H (1 w(i ' p , n))
s S IN , i p I s , i ' p I s , i p i ' p , sip' p > 0, sic p < 0, n N

Dedicated Finite Intermediate


Storage Case (FIS)
No need to model storage as a separate task
With Storage Bypassing:
Different tasks in different units - zero wait condition processing tasks:
T s (i p , n) T s (i ' p , n) + H (2 w(i ' p , n) w(i p , n))
s S FIS , i p I s , i ' p I s , i p i ' p , sip' p > 0, sic p < 0, n N

T (i p , n) T (i ' p , n) + H (2 w(i ' p , n) w(i p , n))


f

s S FIS , i p I s , i ' p I s , i p i ' p , sip' p > 0, sic p < 0, n N

Giannelos and Georgiadis (2002) enforced the zw condition for batch plants
as well leading to suboptimal solutions
(Sundaramoorthy & Karimi, 2005; Shaik, Janak, & Floudas, 2006)

ST ( s, n) STsmax

Finite Storage requirement:

s S FIS , n N

Better to Model storage as a separate task !

No Intermediate Storage Case (NIS)


No need to model storage as a separate task
No Storage requirement: ST(s,n) = 0

i p I s

p
si p

b(i p , n) +

i p I s

c
si p

or eliminate ST(s,n)

b(i p , n) = 0

s S IN , n N

Different tasks in different units - processing tasks:


T s (i p , n) T s (i ' p , n) H (2 w(i ' p , n) w(i p , n))
s S IN , i p I s , i ' p I s , i p i ' p , sip' p > 0, sic p < 0, n N
T f (i p , n) T f (i ' p , n) H (2 w(i ' p , n) w(i p , n))
s S IN , i p I s , i ' p I s , i p i ' p , sip' p > 0, sic p < 0, n N

Different tasks in different units - zero wait condition processing tasks:


T s (i p , n) T s (i ' p , n) + H (2 w(i ' p , n) w(i p , n))
s S FIS , i p I s , i ' p I s , i p i ' p , sip' p > 0, sic p < 0, n N
T (i p , n) T (i ' p , n) + H (2 w(i ' p , n) w(i p , n))
f

s S FIS , i p I s , i ' p I s , i p i ' p , sip' p > 0, sic p < 0, n N

Flexible FIS With Storage Bypassing


Most general case: Model storage as a separate task
Allocation Constraints for Storage Tasks:
w(ist , n + 1) w(ist , n) + z (ist , n) 1
Capacity Constraints - Storage Tasks:

b(ist , n) Vistmax w(ist , n)

b(ist , n) Vi stmax z (ist , n)

ist I st , n N

ist I st , n N

Material Balance Constraints: ST(s,n) = 0

i p I s

i p I s

p
si p

p
si p

b(i p , n) +

ist I s

p
sist

ist I st , n N

or eliminate ST(s,n)

b(ist , n 1) + b(i, n) = 0
iI s

c
si

b(i p , n) + ST0 ( s ) + sic b(i, n) = 0

s S FIS , n N , n > 1

s S FIS , n = 1

iI s

Duration Constraints - Storage Tasks:


T f (ist , n) T s (ist , n)

ist I st , n N

Flexible FIS With Storage Bypassing


Sequencing Constraints: Different Tasks in Different Units Storage Tasks:
(a) Start time of storage task = start time of processing task (producing/consuming):

T s (ist , n) T s (i p , n) H (2 w(ist , n) w(i p , n)) s S IN , ist I s , i p I s , n N


T s (ist , n) T s (i p , n) + H (2 w(ist , n) w(i p , n)) s S IN , ist I s , i p I s , n N
(b) No consuming/producing tasks & z(ist,n)=1 then ist should start at the end of previous event

T s (ist , n) T f (ist , n 1) + H (1 z (ist , n) + w(i p , n)) s S IN , ist I s , i p I s , n N , n > 1

(c) End time of storage task end time of both producing and consuming tasks

T f (ist , n) T f (i p , n) H (2 w(ist , n) w(i p , n)) s S IN , ist I s , i p I s , n N


(d) When z(ist,n)=0 then end time of ist should match with the consuming task:
T f (ist , n) T f (i p , n) + H (2 w(ist , n) w(i p , n)) + Hz
H (ist ,n))
s S IN , ist I s , i p I s , sic p < 0, n N

(e) When z(ist,n)=1 then ist should go till start time of next consuming/producing task:
T f (ist , n) T s (i p , n + 1) H (2 w(ist , n) w(i p , n + 1)) H (1 z (ist ,n))

s S IN , ist I s , i p I s , n N , n N
T f (ist , n) T s (i p , n + 1) + H (2 w(ist , n) w(i p , n + 1)) + H (1 z (ist ,n))
s S IN , ist I s , i p I s , n N , n N

FIS Case Without Storage Bypassing


Dedicated FIS Without Storage Bypassing:
No need to model storage as a separate task
Material Balance Constraints for Intermediates:
ST ( s, n 1) +

ST0 ( s ) +

i p I s

i p I s

p
si p

p
si p

s S FIS , n N , n > 1

b(i p , n) STsmax

s S FIS , n N , n = 1

b(i p , n) STsmax

Dedicated and Flexible FIS Without Storage Bypassing:


Model with storage as a separate task
Allocation Constraints:

w(i

st

, n) w(i p , n)

s S FIS , i p sipp , n N

i st sic st

Material Balance Constraints for Intermediates:

ist I s

p
sist

b(ist , n 1) +

ST0 ( s ) +

i p I s

p
si p

i p I s

p
si p

b(i p , n)

b(i p , n)

ist I s

max
isi

ist I s

max
isi

w(ist , n)

w(ist , n) s S FIS , n N , n > 1

s S FIS , n = 1

FIS Case Without Storage Bypassing


Dedicated and Flexible FIS Without Storage Bypassing:
Sequencing Constraints: Different Tasks in Different Units:
(a) Start time of storage task = start time of producing task:

T s (ist , n) T s (i p , n) H (2 w(ist , n) w(i p , n)) s S IN , ist I s , i p sipp , n N


T s (ist , n) T s (i p , n) + H (2 w(ist , n) w(i p , n)) s S IN , ist I s , i p sipp , n N
(b) Start time of consuming task start time of storage task:

T s (i p , n) T s (ist , n) H (2 w(ist , n) w(i p , n)) s S IN , ist I s , i p sic p , n N

No need to enforce the zero wait condition on start time of processing tasks
(c) End time of consuming task End time of producing task:

T f (i p , n) T f (i ' p , n) H (2 w(i ' p , n) w(i p , n))


s S IN , i p I s , i ' p I s , i p i ' p , sip' p > 0, sic p < 0, n N

Objective Function
Max Profit
C1

price

sS P n N

i I s

p
si

b(i, n) C2 w(i, n) C3
iI n N

z(i

i st I st nN

st

, n)

Min MS
T f (i, n) MS

i I , n N

(T f (i, n) T s (i, n)) MS min


j

j J

nN iI j

Industrial Case Study:


Mixing, Storage, & Packing

Munawar A. Shaik

and Christodoulos
Department of Chemical Engineering
Princeton University

A. Floudas

State-Task-Network
Pack-P1

P1

(Line 3)

Pack-P2

P2

(Line 1)

Pack-P3

P3

(Line 2)

Pack-P4

P4

(Line 1)

Pack-P5

P5

(Line 2)

Pack-P6

P6

Pack-P7

P7

(Line 4)

Pack-P8

P8

(Line 1)

Pack-P9

P9

(Line 2)

Pack-P10

P10

(Li 5)
(Line

Pack-P11

P11

(Line 5)

Pack-P12

P12

(Line 4)

Pack-P13

P13

(Line 4)

Pack-P14

P14

(Line 2)

Pack-P15

P15

(Line 4)

Mixing Stage: 3 mixers


3 bases
7 intermediates

(Mixer A)
Make-Int1

Int1

Base A
(Mixer A)
Make-Int2

Int2

Packing Stage: 5 lines


15 products

(Mixer B,C)
Make-Int3

Int3

Base B

(Line 3)

(Mixer B C)
Make-Int4

(Mixer B,C)
Make-Int5

Base C

(Mixer B,C)
Make-Int6

(Mixer B,C)
Make-Int7

Int4

Int5

Int6

Int7

With Storage bypassing


Time horizon = 120 h

Different Cases
a) Unlimited intermediate storage with Dmin
b) No intermediate storage with Dmin
c) Flexible finite intermediate storage: 3 tanks available with
maximum
i
capacity
it off 60 tton each,
h and
d any iintermediate
t
di t can
be stored in any of the 3 tanks. With Dmin and Dmax
d) Same as (c) but without Dmax
e) Restricted finite intermediate storage: With Dmin and Dmax
f) Same as (e) but without Dmax
Restricted Storage Suitability

State(s)

tank (Jst)

Int1
Int2
Int3
Int4
Int5
Int6
Int7

Tank A
Tank B
Tank C
Tank A
Tank B
Tank A
Tank C

Other models
Ierapetritou, M. G.; Floudas, C. A. Effective continuous-time formulation for
short-term scheduling: 2. Continuous and semi-continuous processes. Ind.
g Chem. Res. 1998,, 37,, 4360.
Eng.
Giannelos, N. F.; Georgiadis, M. C. A novel event-driven formulation for shortterm scheduling of multipurpose continuous processes. Ind. Eng. Chem.
Res., 2002, 41, 2431.
Mendez, C. A.; Cerda, J. An efficient MILP continuous-time formulation for
short-term scheduling of multiproduct continuous facilities. Comput. Chem.
Eng. 2002, 26, 687.
Castro, P
Castro
P. M
M.;; Barbosa-Povoa
Barbosa Povoa, A
A. P
P.;; Matos
Matos, H
H. A
A.;; Novais
Novais, A
A. Q
Q. Simple
continuous-time formulation for short-term scheduling of batch and
continuous processes. Ind. Eng. Chem. Res. 2004, 43, 105.
Castro, P. M.; Barbosa-Povoa, A. P.; Novais, A. Q. A divide-and-conquer
strategy for the scheduling of process plants subject to changeovers using
continuous-time formulations. Ind. Eng. Chem. Res. 2004, 43, 7939.

Results for Case A - UIS


this work
Events
Binary variables
Continuous variables
Constraints
Nonzeros
RMILP
MILP
Profit
Integrality gap (%)
CPU time (s)
Nodes
aCPU

Castro et al

4
108
356
1040
4867
2695.32
2695.32
2695.32
0
1.03
69

Giannelos &
Georgiadis
9
4
236
108
762
628
894
1637
5354
2695.32
2695.32
2695.32
2695.32
2695.32
2695.32
0
0
58.5a
186.44
1041
15310

Mendez &
Cerda
38
44
140

2695.32
2695.32
14a

times for other models reported for completeness only.

10

Gantt Chart for Case A - UIS

Results for Case B - NIS


this work
Events
4
Binary variables
108
Continuous variables 328
C t i t
Constraints
1240
Nonzeros
5926
RMILP
26946.722
MILP
26869.467
Profit
2689.747
Integrality gap (%)
0.26
CPU time (s)
157.86
Nodes
4272
aCPU

Castro et al
9
236
762
894
2695.32
2672.50
2672.50
0.85
200000a
8007335

time reported for completeness only.

11

Gantt Chart for Case B - NIS

Results for Case C - FIS


this work
Events
4
Binary variables
276
Continuous variables 580
Constraints
4282
Nonzeros
21190
RMILP
13876.71
MILP
13857
Profit
1388
Integrality gap (%)
0.062
CPU time (s)
8.81
Nodes
130
a

Giannelos &
Georgiadis
4
220
712
2113
6884
1388
1388
1388
0
0.81
30

Giannelos &
Georgiadisa
4
292
712
2113
7176
13876.67a
13857a
1388
0.01
3.92
50

Using objective function with C1=10,


=10 C2=C3=1

Max Profit
C1

price

sS P n N

i I s

p
si

b(i, n) C2 w(i, n) C3
iI n N

z(i

i st I st nN

st

, n)

12

Gantt Chart for Case C - FIS

Results for Case D - FIS


this work

Castro et al Giannelos & Mendez &


Georgiadis
Cerda
Events
4
10
4
Binary variables
276
330
220
60
C i
Continuous
variables
i bl
580
927
712
87
Constraints
4267
1127
2113
361
Nonzeros
21130
6884
RMILP
26946.72 2695.32 2695.32
MILP
26910.18 2695.32 2692.06 2670.28
Profit
2695.32 2695.32 2692.06 2670.28
Integrality gap (%)
0.12
0
0.12
CPU time (s)
465.61
162a
60000
399a
Nodes
7144
3934 3307486
a CPU

times for other models reported for completeness only.

13

Gantt Chart for Case D - FIS

Results for Case E - FIS


this work
Events
4
Binary variables
164
Continuous variables 412
Constraints
2080
Nonzeros
9406
RMILP
13876.712
MILP
13857
Profit
1388
Integrality gap(%)
0.026
CPU time (s)
6.56
Nodes
100

14

Gantt Chart for Case E - FIS

Results for Case F - FIS


this work

Giannelos &
Georgiadis
Events
4
4
Binary variables
164
164
Continuous variables 412
656
Constraints
2065
1833
Nonzeros
9346
5904
RMILP
26946.72
2695.32
MILP
26914.18
2689.39
Profit
2695.32 2689.39
Integrality gap (%)
0.093
0.22
CPU time (s)
662.58 60000
Nodes
16524 3550540

15

Gantt Chart for Case F - FIS

Conclusions
Proposed an Improved Unit-Specific Event-based Continuous-Time
formulation for Short-Term Scheduling of Continuous Plants
Rigorous
Ri
T
Treatment
t
t off St
Storage Requirements
R
i
t compared
d tto th
the M
Model
d l
of Ierapetritou and Floudas (1998)
Improved Sequencing Constraints
Finds the global optimal solution for all variants of an Industrial Case
Study from the Literature

16

Cyclic Scheduling of Continuous


Plants
Dr. Munawar Abdul Shaik
Assistant Professor
Department
p
of Chemical Engineering
g
g

Problem Definition
Given:

- products along with their demands


- stages and interconnections
- intermediate and final product inventory tank capacities
- processing time for each product in all stages
- transition times (sequence dependent)

For a cyclic schedule determine:


- sequencing of products
- length of cycle time
- length of production times
- amounts of products to be produced
- levels of intermediate storage and final product inventories

Cyclic Scheduling Problem


tanks

.
.

products

. ...
.

.
.
stage 1

.
.

.
.

stage 2

1
2
N

stage M

M lti t
Multistage
Multiproduct
M lti
d tC
Continuous
ti
Pl
Plantt
(Pinto & Grossmann, 1994)

Mathematical Formulation
Time slot
stage 1
stage 2

k=1

k=2
k=1

k = NK

...
k=2

Transition

k = NK

...

processing
i

.
stage M

k=1

k=2

...

k = NK

time

Time slot representation

MINLP model for Cyclic Scheduling


Maximize
Profit =

WpMi
Im im
Zijkm
Cinvim
Ctrij
Tc
Tc
Tc
i
m
i
j
k m

1
TppikM
Cinvfi iM RpiM 1
TppikM

2 i k
Tc

subject to

ikm

=1

ik
ikm

=1

(1)

(2a)

(2b)

ijkm

= yikm

(3a)

ijkm

= y jk 1m

(3b)

MINLP model for Cyclic Scheduling


Tspikm U im yikm 0

k m

(4a)

Tepikm U im yikm 0

k m

(4b)

Tppikm U im yikm 0

k m

(4c)

Tppikm = Tepikm Tspikm i

k m

(4d)

Tsp

i1 m

Tsp

i ( k + 1) m

ijm

z ij 1 m

(5a)

Tep
i

ikm

+ ijm z ij ( k
i

+ 1) m

k < NK m

(5b)

Tc Tpp ikm + ijm zijkm


k i
i
j

(5c)

Inventory Breakpoints
Tppikm

stage m

Tspikm Tepikm
Tppik(m+1)
ik( 1)
Tspik(m+1) Tepik(m+1)

Tppikm
Tspikm

Tpp
ppik(m+1)

stage m+1

Inventory

Tepikm
Tspik(m+1) Tepik(m+1)

Inventory

level

I1im

level

I2im

I0im

I3im

I1im

I2im

I3im

I0im

time

time

Inventory Breakpoints

I 1im = I 0 im + im Rp im min Tsp ik ( m + 1) Tsp ikm , Tpp ikm


k
k

I 2 im
i = I 1im
i + ( im Rp im Rp i ( m +1) ) max 0, Tep ikm
ik Tsp ik ( m + 1)
k

I 3im = I 2 im Rp i ( m +1) min Tpp ik ( m + 1), Tep ik ( m + 1) Tep ikm


k
k
k

0 I 1im Im im

0 I 2 im Im im
0 I 3im Im im
Im im U im
I

i m

I 3im = I 0 im

(6)

Wp Mi = iM Rp iM Tpp ikM

(7a)

Wp Mi DiTc

(7b)

Mathematical model
Variables:

y ikm {0 ,1}
0 z ijkm 1
Tsp ikm , Tep ikm , Tpp ikm , Wp Mi , T c , Im im , I 0 im , I 1im , I 2 im , I 3 im 0
Most of the Scheduling problems in Chemical
Engineering result in MILP/MINLP models with
large number of binary and continuous variables.

3P2S Scheduling Problem


fA

fB

fC

stage 1

P d t
Product
A
B
C

ssale
l p
price
i ($/t
($/ton)
n)
150
400
650

stage 2

demand
d m nd (kg/h)
(k /h)
50
100
250

3P2S Problem data


stage 1

product

processing
rate
(kg/h)

A
B
C

stage 2

intermediate
stora e
storage
($/ton)

800
1200
1000

processing
rate
(kg/h)

140.6
140.6
140.6

final
inventory
($/ton.h)

900
600
1100

4.06
4.06
4.06

Transition times (sequence dependent)


stage 1
product
A
B
C

stage 2

3
8

10
3

3
6
-

3
4

7
0

3
10
-

3P2S Solution
stage 1

3
0

B
10.84

15.68

C
94.05

19.72
3

stage 2

23.9

C
91.75

Inv
(ton)

Time (hr)

3P2S Solution
Profit
= $ 442.53 / hr
Cycle time = 94.05 hr
Variables = 146 (18 bin)
Constraints = 162
CPU time = 12.43 sec
P d t
Product

d
demand
d (kg/hr)
(k /h )

A
B
C

production
d ti (kg/h)
(k /h)

50
100
250

50
100
758

General Hybrid Flowshop facility


tanks

tanks

L41

L11

S1

S2

S3

L12

stage 1

tanks

S4

LM-2,1

S5

L42

stage 2

stage 3

stage 4

SM-2

SM-1

SM

LM-2,2

stage 5

stage M-2 stage M-1

stage M

Key features & assumptions


Two units in each parallel line
Continuous feed with FIS
C
Constant
st t demand
d m d rates
t s/ V
Varying
i d
demands
m ds lleading
di tto empty
mpt
slots
Same number of grades in the first / second units of the
parallel lines
Processing rates are decision variables with given LB & UB
UIS on product side
Common tank only on feed side of stage 1
Only L11 and L12 cannot operate simultaneously
Succeeding stages can start / end processing before the
preceding stages start / end
Binary representation of logic

Effect of Sloping
Rp Tpp

Rp Tpp
Tank

Tank

Stage

Rp Trpp (sloping)

Rp Trpp (sloping)
Tank

Tank

Trsp

Tpp
Tsp

Tep

Trep

Trpp
Tep

Tsp
sloping

Model Constraints
Sequencing constraints
Mass balance constraints
Inventory balance constraints
Objective function
MINLP f
formulation
l ti

Model Constraints (contd.)


Sequencing constraints

ikm

=1

ikm

=1

ijkm

= yikm

j k m

= y jk 1m

i k m

ijkm

Model Constraints (contd.)


Tspikm U im yikm 0

Trsp ikm U im yikm 0

Tepikm U im yikm 0

Trep ikm U im yikm 0

Tppikm U im yikm 0

Trpp ikm U im yikm 0

Tppikm = Tepikm Tspikm

Trppikm = Trepikm Trspikm

Tsp

= (1 / 2 )

i1 m

Tsp ik

+ 1m

Tep ikm +

z ij 1 m

ijm

Trsp

ikm

Tsp

ikm

Tep

ijm z ijk

(1 / 2 )

ikm

i
ikm

k'

+ 1m

+ (1 / 2 )

ijm

k"

z ijkm

ijm

z ijk

i"

Tc Trppikm

i'

Tc Trpp" i" k " l

Trep

Tc Trpp ' i ' k ' l

+ +1m

Mass balance constraints


feed and stage 1
F Tc = Rp' Trpp '
Sfi '1Fi ' Tc = Rp' i '1 Trpp ' i ' k '1
k'
i'

i '1

i ' k '1

k'

im =

(1 Sfi"1) Fi" Tc = Rp" i"1 Trpp" i" k "1

imRpim Tppikm
k
k

Rpim Trppikm

im Tppikm
k
k

Trpp

ikm

k"

Fi"Tc = Rp" i"1 Trpp" i" k "1


k"

i 'l =

parallel line and stage

' i ' lRp ' i ' l Trpp ' i ' k ' l


k

' i ' lRp' i ' l Trpp ' i ' k ' l = Rpi ' m Trppi ' km
k'

k'

Rpi ' m Trppi ' km

' i ' lRp ' i ' l Trpp ' i ' k ' l + " i" lRp" i" l Trpp" i" k " l = Rpim Trppikm
k'

k"

" i" lRp" i" l Trpp" i" k " l = Rpi" m Trppi" km


k"

10

General Hybrid Flowshop facility


tanks

tanks

tanks

L41

L11

S3

S2

S1

LM-2,1

S5

S4

L12

SM-2

L42

stage 1

stage 2

stage 3

SM-1

SM

LM-2,2

stage 4

stage 5

stage M-2 stage M-1

stage M

Mass balance constraints (contd.)


between any two stages
imRppim Trpp
ppikm = Rp
pim + 1 Trpp
ppikm + 1
k

stage and parallel line


i ' mRpi ' m Trppi ' km = Rp' i '1 Trpp ' i ' k '1
k

k'

Sfi '1i ' mRpi ' m Trppi ' km = Rp ' i '1 Trpp ' i ' k '1
k

k'

(1 Sfi"1) i" mRpi" m Trppi" km = Rp" i"1 Trpp" i" k "1


k

k"

i" mRpi" m Trppi" km = Rp" i"1 Trpp" i" k "1


k

k"

11

Model Constraints (contd.)


WpiM =

iMRpiM TrppikM
k

Tc

Binary representation of logic


qi Trep'i'k'1 + (1 qi ) Trep"i"k"1 qi Trsp"i"k"1 + (1 qi ) Trsp'i'k'1
k'

k"

k"

k'

(2qsim 1) Tspikm Trspikm+1 0


k

(2qeim 1) Tepikm Trepikm+1 0


k

Inventory breakpoints
Tppikm
Tspikm

Trppikm+1
Trspikm+1

I0im

Tspikm

Tepikm
Trppikm+1

stage m+1

Trspikm+1

Trepikm+1

Inventory
level

Tppikm

stage m

Tepikm

Trepikm+1

Inventory
I1im

level

I2im

I3im
time

I1im

I0im

I2im

I3im
time

12

Example: two-stage
Stage 1
Stage 2

I0 (B)
I2 (B)

I0 (C)= I1(C)

I3 (B)

I3 (C)

Inventory

I3 (A)
I0 (A)

I1 (A)
I2 (C)

I1 (B)

I1 (A)

Time

Inventory constraints
Five categories
Feed inventory of grades charged into only
L11 or L12
Feed inventory of common grades charged
into both L11 and L12
Inventory
y between any
y two stages
g
Inventory between a stage and a parallel line
Inventory between a parallel line and a stage

13

General Hybrid Flowshop facility


tanks

tanks

tanks

L41

L11

S3

S2

S1

LM-2,1

S5

S4

L12

L42

stage 1

stage 2

stage 3

SM-1

SM-2

SM

LM-2,2

stage 4

stage 5

stage M-2 stage M-1

stage M

Inventory breakpoints
Tppikm
Tspikm

stage m

Tepikm
Trppikm+1
Trspikm+1

Tepikm
Trppikm+1

stage m+1

Trspikm+1

Trepikm+1

Inventory

Trepikm+1

Inventory

level

level

I1im

I2im

I1im

I0im

Tppikm
Tspikm

time

I3im

I0im

I2im

time

I3im

14

Inventory constraints (contd.)


Inventory between any two stages

I1im = I 0im + imRpim min Trspikm + 1 Tspikm, Tppikm qsim


k
k

Rpim + 1 min Tspikm Trspikm + 1, Trppikm + 1 (1 qsim)


k
k
k

I 2im = I1im + (imRpim Rpim + 1) max 0, Tepikm Trspikm + 1 qsim qeim


k

+ (imRpim Rpim + 1) Trppikm + 1 qsim (1 qeim)


k

+ (imRp
pim Rp
pim + 1) max 0, Treppikm + 1 Tsppikm (1 qqsim) (1 qqeim)
k

+ (imRpim Rpim + 1) Tppikm (1 qsim) qeim


k

I 3im = I 2im Rpim + 1 min Trepikm + 1 Tepikm,


k
k

Trpp

+ im Rpim min Tepikm Trepikm + 1,


k

Tpp

qeim

ikm + 1

ikm

(1 qeim)

Inventory constraints (contd.)


Inventory breakpoints of the feed tank
Line 2

Inventory
level

I1 (B)

I3 ((B))

I0 (B)

I2 (B)
Time

15

Inventory constraints (contd.)


Inventory break points for feed
I1i ' = I 0i '+ Fi '

Trsp'

i ' k '1

k'

I 2i ' = I1i '+( Fi ' Rp' i '1 ) Trpp 'i ' k '1
k'

I 3i ' = I 2i '+ Fi ' Tc- Trep 'i ' k '1


k'

I1i" = I 0i"+ Fi"

Trsp"

i " k "1

k"

I 2i" = I1i"+( Fi" Rp" i"1 ) Trpp"i" k "1


k"

I 3i" = I 2i"+ Fi" Tc- Trep"i" k "1


k"

Inventory constraints (contd.)


Inventory break points of feed common tank
Trppik
Trspik

Trppik

Line 1

Trepik
Trppik
Trspik

Line 2

Trepik

Trspik

Trepik

Trppik
Trspik

Trepik

Inventory
level

I1im
I3im

I0im
I2im

I4im

I5im

time

16

Inventory constraints (contd.)


Inventory break points of feed common tank

I1i = I 0i + Fi qi

Trsp '

+(1-qi ) Trsp" i" k "1


k"

i ' k '1

k'

I 2i = I1i + qi (Fi -Rp' i '1) Trpp ' i ' k '1 + (1 qi )(Fi -Rp" i"1) Trpp" i" k "1
k'

k"

I 3i = I 2i + qiFi Trsp" i" k "1 Trep' i ' k '1 + (1 qi ) Fi Trsp ' i ' k '1 Trep" i" k "1
k'
k"
k'

k"

I 4i = I 3i + (1-qi )(Fi -Rp' i '1) Trpp ' i ' k '1 + qi (Fi -Rp" i"1) Trpp" i " k "1
k'

k"

I 5i = I 4i + Fi Tc- (1-qi ) Trep' i ' k '1 + qi Trep" i" k "1


k
'
k
"

Model constraints (contd.)


Objective function
= (WpiM Di ) 2
i

Demand feasibility scenarios

WpiM Td Qd i

profit = PiWpiM Ctrij


i

zijkm
Tc

Ctr'i ' j 'l


i'

j'

k'

z'i ' j 'k 'l


Tc

Ctr"i" j"l
i"

j" k "

z"i" j"k"l
Tc

Im axil + Im axim
Cinvi

Tc

i
l m

17

Prototype hybrid flowshop


Case study 1

Fb =

Td = 1000 hrs

5237
Qdi = 8414
975
975

21
3
28 m /hr
33

m3

Prototype hybrid flowshop: Data


Pi =

350
500 $/m3
250
250

Ctr = $3500
Cinv = 5 $/m3
UiI = 800 m3

18

Results: Prototype hybrid flowshop


Objective function: min

CPU time = 13.2 sec


=0
Tc = 79.21 hrs
SfB1 = 0.587
B1 = 0.688

Results: Prototype hybrid flowshop


Objective function: min

19

Results: Prototype hybrid flowshop


Objective function: max profit

Qi =

6719.5
9888.2 m3
1488.6
2186.6

profit

Tc
SfB1
B1

= 7296 $/hr
= 6.1
= 61.37 hrs
= 0.939
= 1.0

Results: Prototype hybrid flowshop


Objective function: max profit

20

Results: Prototype hybrid flowshop


Ignoring Sloping losses

10.8
Fb = 19.67 m3/hr
8.64

CPU time = 5.65 sec


=0
Tc = 12.44 hrs
SfB1 = 0.9
B1 = 0.924

Results: Prototype hybrid flowshop


Ignoring Sloping losses

21

Results
With and without sloping (3p_2s problem)
Without sloping

With sloping

Profit ($/hr)

448

402

Cycle time(hr)

96

122

CPU time(sec)

1.5

8.5

Extensions to Large problems


Performance indices
Discrete variables

4P3S

5P3S

6P3S

8P3S

10P3S

48

66

98

154

252

Continuous variables

476

717

1112

1848

3436

No. of equations

606

855

1231

1621

2609

CPU time (sec)

13.2

19.4

68.3

372.3

648.1

Non linear N-Z

1135

1609

2388

3667

6251

21413 32204 53275

88669

Code length

15397

Derivative pool

73

124

232

77

115

Constant pool

22

27

28

26

33

22

6/14/2010

Advanced Scheduling of Pulp and


Paper Plants
Dr. Munawar Abdul Shaik
Assistant Professor
Department
p
of Chemical Engineering
g
g

Paper manufacturing process:


Overview

Pulp

P
Paper
machine

Wi d
Winder

Jumbo reels

Sh t
Sheeter

Cut
rolls

Sheets

Major Decisions:
Order allocation to various mills
Sequencing at each mill

Pinar et al (2002) A-team


framework (heuristics based)

Trimming
Dispatch Schedule

6/14/2010

Paper manufacturing: Issues


Paper manufacturing as a hybrid flowshop facility
Sheeter 1

G1
G2

sheets
Winder 1

Paper
Machine 1

Wrapper 1

rolls

G3
Palletizer

Offline
coater

Rewinder

G2
Wrapper 2
G3

Paper
Machine 2

rolls

Winder 2

G4

Sheeter 2

Simplifying assumptions:
Paper machine slowest
Capacity constraints for
shared resources

Multi-level Structure Paper


Industry
Two-level framework for
small-size p
problems

Level-1
Level-2

Simultaneous order
assignment and sequencing
Simultaneous trim loss
minimization and
optimal sequencing of
cutting patterns

Three/Four level framework for


medium to large-size problems
Level-1
Level-1a

Order assignment across multiple-sites

Level-1b

Detailed scheduling at each site


(Grade Sequencing)

Level-2a

Trim loss minimization

Level-2b

optimal sequencing of
cutting patterns

6/14/2010

Multi-level Structure for Paper


Industry
Abstractions

Proactive measures
High trim losses

Level-1

Time slots

Level-2

Simultaneous trim loss &


pattern sequencing

(Assumed trim losses)

Higher tardiness
compared to earliness
Conservative
production rates

Planning & Scheduling in a Paper


Industry
Model formulation for order allocation
G1

m=1

G3

J6 J7

J11 J12

k=1

k=2

k=3

G1

m=2

G2

J1 J3 J5

G2

G3

J2 J4 J8 J9 J10 J13 J14 J15

k=1

k=2

k=3

k=4

G1

J16 J17

Changeover
time
Production time

k-1

k=4

time
Iteration on maximum number of time slots (NK)

6/14/2010

Planning & Scheduling in a Paper


Industry
MINLP model for order allocation
min
i cost =

Qpr Cpr
mk

gm

z gmk +

Q Ctr
j

+ E j Q j Ce m y jmk +
j

Tard

s.t.

y
m

g'

jmk

=1

y jmk
j k

Q j Ctard j

+ z gm ( slot1) g 0 g 'm Cgrgg 'm +


m

j
jm

z
m k >1 g

gmk

z g 'm ( k 1) Cgrgg 'm

g'

j where OMj,m=1

z gmk = min(1, y jmk OG jg )

g, m, k

z gm ( k 1)

gmk

m, k >1

Planning & Scheduling in a Paper


Industry
MINLP model (contd.)
Trim mk
Q mk = Q j y jmk 1 +
Qpr
100

j
Qprmk
Tpp mk = z gmk
m, k
Rp gm
g

Qprmk Qm gm z gmk m,
m k
g

Tmk = t 0 m + z gmk g 0 g 'm mgg ' + Tpp mk

m, k=1

Tmk = Tm ( k 1) + z ggmk z g 'm ( k 1) mgg


gg ' + Tpp mk

m, k >1

g'

g'

Ts j = Td j Trans jm y jmk
m

E j Ts j Tmk y jmk
m

Tard j Tmk y jmk Ts j


m

6/14/2010

Case Study 1: Order allocation


20 orders, 5 grades, 3 mills, 5 customers
Customer orders for case study 1:
G1
Delhi
Mumbai
J5 J6
Chennai
J11
Pune
Hyderabad J19

G2
J3
J7
J13

G3

G4

J1 J2
J8
J10

J4

J18

J14 J16 J17

G5
J9
J12
J15
J20

Case Study 1: Order allocation


20 orders, 5 grades, 3 mills, 5 customers
Comparison of various costs ($) for different NK
2 slots
3 slots
production cost
78,65,893 73,47,141
transportation cost 6,06,830 1,49,610
earliness cost
10,61,663 1,32,584
tardiness cost
20,95,995 1,14,728
gradechange cost
16,800
20,000
total cost
116,47,180 77,64,064

4 slots
5 slots 6 slots
72,26,088 69,64,937 122,48,810
2,04,170 4,71,820
8,80,620
2,10,455 9,30,072 14,49,588
1,24,180 8,77,822 158,60,900
24,400
31,200
28,000
77,89,293 92,75,852 304,67,920

6/14/2010

Case Study 1: Order allocation


NK = 3 slots optimum
Delhi
(M1)

G3

G4

J4
1

10

Mumbai
(M2)

G5

12

G2

J13
2

G1

G3

30

G3

G4

J14 J16 J17 J8

G1

J11 J19
9

J5 J6
25

14.5

J10 J18
0

22

J9 J15 J20

J7
0

Chennai
(M4)

16

G2

Mumbai
(M3)

G2

J3

J1 J2

24.5

J12
18

29.5

G5
25

time (days)

Case Study 2: Order allocation


35 orders, 5 grades, 3 mills, 6 customers
Customer orders for case study 2:
G1
G2
G3
G4
Delhi
J3 J28
J1 J2
J4 J25
Mumbai
J5 J6
J7
J8
Chennai
J11
J29 J30 J35 J10
Pune
J13
J14 J16 J17
H d
Hyderabad
b d J19
J18
Bhopal
J32 J33 J21 J24 J22 J26 J31

G5
J9 J23 J27
J12
J15
J20 J34

6/14/2010

Case Study 2: Order allocation


35 orders, 5 grades, 3 mills, 6 customers
Comparison of various costs ($) for different NK
3 slots
4 slots
5 slots
41,07,580 41,35,222 40,51,072
2,66,490 1,41,490 2,23,490
2,77,862 3,71,648 4,71,172
4,91,604 2,36,950 4,17,696
28,400
30,400
29,600
51,71,937 49,15,712 51,93,032

production cost
transportation cost
earliness cost
tardiness cost
gradechange cost
total cost

Case Study 2: Order allocation


NK = 4 slots optimum
Delhi
(M1)
Mumbai
(M2)

G4

G1

J4 J25 J1 J2
1

G2

J24
0

G2
J7

6.7

27.6

G5

J9 J15 J20

12.1

G3

25.1

33.4

G5

J14 J16 J17 J23J27J34


15

G3

30.6

J8J22J26J31

G4

J3 J13 J21
2

G2

J28

J6 J32 J33

14

G2

Mumbai
(M3)
Chennai
(M4)

G3

G1

25.1

32

G2

G5

J10 J18 J5 J11 J19 J29 J30 J35 J12


0

20

29.1 32.3

time (days)

6/14/2010

Level-2 Results
Orders width quantity due date transport tardiness
time
penalty
i
bi (m) Qi(ton) Tdi(days) tri(days) Cti
I1
I2
I3
I4
I5
I6
I7

0.90
0.80
0.70
1.15
1.05
1.20
1.00

140
130
125
100
95
80
50

7
8
10
10
3
3
4

2
1
1
3
2
0
3

8
4
10
4
10
6
2

Sequential approach
% Trimloss
Trim cost
Under production cost
Knife change cost
Tardiness cost
The total cost

1.031174
$9899.2
$9905.6
$700
$2438.4
$22943.2

22 Feasible Cutting
g
Patterns

Simultaneous
1.03134
$9900.8
$9907.2
$1000
$1015.5
$21823.5

p17 p9 p5 p18 p19 p22 p14


p17 p12 p9 p5 p21 p19 p22. p18 p14 p7

Anda mungkin juga menyukai