Mathematical Modeling
Optimization
Dr. Ali Hasan Al-Shanini
Mathematical Modeling Optimization
• Mathematical optimization models are methodical based
programs.
• These models consist of objective function and constraints.
1. The Objective Function
• The main objective of any optimization model is to minimize or
maximize a desired function.
• In this class of optimization models, the objective function is
represented by a single mathematical equation.
Where, x1, x2, . . ., xN are decision or optimization variables.
2. Constraints
• They are a set of equations that trend the objective function to
meet the optimum solution.
• Constraints are like boundaries that obstacle the over or under
estimation of the objective function.
• Constraints are classified into two main categories:
1. Inequality constraints:
When there is no equality exists, but may there are ≤, ≥, ˂, or ˃
2. Equality constraints:
When there is equality exists.
-g(x) 0 g(x)
What does optimization mathematically mean?
• For building an optimization program:
Should have a deep understanding of the process needed to be
optimized.
Formulate the correct objective function equation .
Consider all constraints that logically leading the objective
function to the optimum solution, then write them as equations.
When the obtained model contains large number of equations,
solving it becomes difficult, so use coding software such as GAMS
or LINGO that easily converge to the optimum solution.
Develop the constraints:
Now, we add the constraint of overall material balance, which is represented by a line
segment as shown by Figure below
The intersection of this line segment with the rest of the constraints to yield the
feasibility region shown by the heavy line segment shown in Figure below
With the feasibility region determined, we can now search for the optimal solution
which must lie within the feasibility region.
In order to determine z:
GAMS Software
Sets
Declaration
Assignment of members
Data
(Parameters, Tables, Scalars) Declaration
Assignment of values
Variables
Declaration
Inputs Assignment of type
Assignment of Variable Bounds and/or Initial Values (optional)
Equations
Declaration
Definition
Model and Solve Statements
Display Statements (optional)
scalars
C1 "price of grade 1 MEA per kg" /85/
C2 " price of grade 2 MEA per kg" /60/ ;
variables Z, X1, X2;
equations
eq1 “Z: the optimum MEA solution that meets the minimum cost "
eq2 "water content constraint"
eq3 "overall material balance constraint"
eq4 "postive X1 constraint"
eq5 "postive X2 constraint" ;
eq1 .. Z =e= C1*X1 + C2*X2;
eq2 .. (0.2*X1)+(0.32*X2)=l=0.25;
eq3 .. X1 + X2 =e=1;
eq4 .. X1=g=0;
eq5 .. X2=g=0;
model simple_LP_moldel /all/ ;
solve simple_LP_moldel using lp minimizing Z;
The solving of this problem is
difficult task, therefore; an
optimization programing coding
software such as GAMS or LINGO
has to be used.
Classification of Optimization Programs
• Depending on the mathematical equations of objective
function and constraints, optimization programs are classified
into:
1. Linear program (LP): when the objective function as well as
all the constraints are linear equations. A linear program can
be mathematically described as:
Classification of Optimization Programs (Cond.)
2. Non-Linear Program (NLP): A mathematical program is non-
linear if any of the arguments are non-linear.
For example:
Min. (max.) z = 3x + 6𝑦 2
5x + x y ≥ 0
• Non-Linear Programs (NLP’s) can be solved to yield a local
optimum. Solver routines can not always guarantee a
globally optimal solution.
• Unlike LPs that can be solved to yield a global optimum.
Solver routines can guarantee a truly optimal solution.
Classification of Optimization Programs (Cond.)
3. Integer Programs (IPs): these kind of programs contain on
integer variable (s). The most commonly used integer variables
are the (zero/one) binary integer variables.
William Shakespeare “ Hamlet play”
The integer programs could be classified depend on the linearity
of the equations to:
I. Linear Integer Program (LIP): it is a linear program in which one
or more variables are integers.
II. Non-Linear Integer Program (NLIP): Non-linear programs in
which one or some of the variables are integers.
Furthermore, they can be classified depending on the kind of
decision variables into:
• Pure Integer Program: when the variable value (0 ,1, 2,3,….N).
• Binary Integer Program (BIP): when the variable value (0 or 1).
• Mixed Integer Program (MIP): It is a program in which one or
more variables are integers while other variable (s) are
continuous. This kind of programs could be linear (MILP) or
nonlinear (MINLP).