Qasim Khan .Lab Report .Optimization
Qasim Khan .Lab Report .Optimization
Lab Report
Semester spring-2022
Submitted to
Dr. Muazzam Arshad
Lab Report #01
Introduction to optimization
Optimization:
It is an act, process, or methodology of making something (such as a design, system, or decision)
as fully perfect, functional, or effective as possible specifically the mathematical procedures (such
as finding the maximum of a function) involved in this.
OR
“Finding the best option(candidate) from a set of alternatives without explicitly enumerating
and evaluating all possible alternatives.”
The main goal of process optimization is to reduce or eliminate time and resource wastage, unnecessary
costs, bottlenecks, and mistakes while achieving the process objective.
Scope of Optimization:
Scope of Optimization Problems From a practical standpoint, we define the optimization task as
follows
Objective function:
An objective function is needed that provides a scalar quantitative performance measure that
needs to be minimized or maximized. This can be the system’s cost, yield, profit, etc.
Predictive model:
A predictive model is required that describes the behavior of the system. For the optimization
problem this translates into a set of equations and inequalities.
Conclusion:
Hence, we concluded that optimization is an integral part of every field, without optimizationit
would be very informal and less probable to reach to a point, where the efficiency and
effectiveness is at its peak. That is why, engineering projects are deal with proper channel,
which is known as optimization.
Lab Report # 02
To apply the degree of freedom analysis.
Problem Statement:
A defined amount of two components (A - stream1, B – stream 2) are mixed before cooled
down in a heat exchanger (utility cooling water) to a specific Temperature T4.
The heat capacities cpA, cpB and cpW can be considered as constant.
Set up the equations needed for a complete balance (mass balance and energy balance)
of the process.
Abstract:
In this experiment, we have determined the number of unknown variables for an optimization
problem using degree of freedom analysis. These unknown then altered to optimize the given
reaction system.
Theory:
Degree of Freedom:
The degree of freedom analysis gives us the number of decision variables that can be changed
during optimization process to obtain the optimal solution.
DOF = (No. of variables) – (No. of linearly independent equation)
Procedure:
Solution:
Conclusion:
From this experiment, we have concluded that for some specific optimization we will find the
number of unknowns using the degree of freedom analysis and by altering these unknowns we
will optimize the required problem.
Lab Report # 03
To find the maximum profit of process using MS excel:
Abstract:
In this experiment, we have determined the maximum profit of a process using MS Excel. Input
data points were given, by using them in a given function, output data points were generated.
The points were then graphically displayed, and we located the point where the profit for given
scenario was maximum.
Theory:
All optimization problems are stated in some standard format. Essential information needs to be
extracted from the problem statement and write them in mathematical form. Essential parts of
an optimization problem statement:
1. The Design/Decision variables.
2. The Constraints.
3. The Objective function
4. The Process Model
Software used:
MS Excel.
Procedure:
Function of dependent and independent variables was given, as well as the domain
values of the input variable was also given.
From the excel operation, the values were used in the required formula(f(x)=297-
2x*210-2x*x/1000) to get the output values of the dependent variable.
Via ‘insert’ command, the graph was plotted.
As our objective was to locate the value in graph, the maximum value point of
dependent variable, we did so and got value of 40(x-axis), where f(x) has maximum
value.
Results:
1200
1000
800
f(X)
600
400
200
0
0 20 40 60 80 100 120
X
From this experiment, we have concluded that the optimum point is at x = 40, that is we have
the maximum profit at this point. Hence, for practical approach this point would be prefer
because it is relative maximum point.
Lab Report # 04
To find the maximum profit of a process using solver in MS excel
Abstract:
The maximum profit of a process is determined using solver in MS Excel. The objective function,
variables and constraints are defined in solver. The solver tool itself optimized the process and
an optimum value is obtained at the end of experiment.
Theory:
All optimization problems are stated in some standard format. Essential information needs to be
extracted from the problem statement and write them in mathematical form. Essential parts of
an optimization problem statement:
1. The Design/Decision variables.
2. The Constraints.
3. The Objective function
4. The Process Model.
Solver (MS Excel):
Solver is a Microsoft Excel add-in program you can use for what-if analysis. It is used find an
optimal (maximum or minimum) value for a given optimization problem.
Software used:
MS Excel.
Procedure:
In this optimization problem, the data was given and we have to calculate the maximum
profit of the manufacturing company.
First, the formula for objective function and constraints were defined in their respective
cells.
Using solver, the objective function, the constraints and variables were defined.
The optimum results were obtained by Linear programming (LP) in solver.
From the answer sheet and other sheets like sensitivity report the optimum value of the
process is obtained which is the required value of maximum profit of the given problem.
Results:
Conclusion:
From this experiment we have concluded that to solve an optimization problem, the use of the
software makes it easy and time saving to solve given optimization problem. The constraints,
objective function, design variables are defined in software which makes it’s easy to find a
solution of optimization problems.
Lab Report # 05
To solve an optimization problem for the maximization the give objective function
(profit):
Abstract:
The maximum profit of a process is determined using solver in MS Excel. The objective function,
variables and constraints are defined in solver. The solver tool itself optimized the process and
an optimum value is obtained at the end of experiment.
Theory:
All optimization problems are stated in some standard format. Essential information needs to be
extracted from the problem statement and write them in mathematical form. Essential parts of
an optimization problem statement:
1. The Design/Decision variables.
2. The Constraints.
3. The Objective function
4. The Process Model.
Solver (MS Excel):
Solver is a Microsoft Excel add-in program you can use for what-if analysis. It is used find an
optimal (maximum or minimum) value for a given optimization problem.
Software used:
MS Excel.
Procedure:
In this optimization problem, the data was given and we have to calculate the maximum
profit of the manufacturing company.
First, the formula for objective function and constraints were defined in their respective
cells.
Using solver, the objective function, the constraints and variables were defined.
The optimum results were obtained by Linear programming (LP) in solver.
From the answer sheet and other sheets like sensitivity report the optimum value of the
process is obtained which is the required value of maximum profit of the given problem.
Results:
Conclusion:
From this experiment we have concluded that to solve an optimization problem, the use of the
software makes it easy and time saving to solve given optimization problem. The constraints,
objective function, design variables are defined in software which makes it’s easy to find a
solution of optimization problems.
Lab Report # 06
Abstract:
In this experiment, we solved a non-linear optimization problem using solver in MS Excel. The
objective function, variables and constraints are defined in solver. The solver tool itself
optimized the process and an optimum value is obtained at the end of experiment.
Theory:
All optimization problems are state some standard format. Essential information needs to be
extracted from the problem statement and write them in mathematical form. Essential parts of
an optimization problem statement:
1. The Design/Decision variables.
2. The Constraints.
3. The Objective function
4. The Process Model.
Solver (MS Excel):
Solver is a Microsoft Excel add-in program you can use for what-if analysis. It is used find an
optimal (maximum or minimum) value for a given optimization problem.
Software used:
MS Excel.
Procedure:
In this optimization problem, the data was given and we have to calculate the minimum
value of the given optimization problem.
First, the formula for objective function and constraints were defined in their respective
cells.
Using solver, the objective function, the constraints and variables were defined.
The optimum results were obtained by GRG Non-Linear programming in solver.
From the answer sheet and other sheets like sensitivity report the optimum value of the
process is obtained.
Results:
Conclusion:
From this experiment we have concluded that to solve an optimization problem, the use of the
software makes it easy and time saving to solve given optimization problem. The constraints,
objective function, design variables are defined in software which makes it’s easy to find a
solution of optimization problems.
Lab Report # 07
To optimize (minimize) the cost of given optimization problem using
APMONITOR:
Abstract:
In this experiment, an optimization problem was solved using a software i.e. AP Monitor. The
given frame of interest was to minimize the objective function(cost). The appropriate procedure
was fallowed as for the solution of optimization problem i.e. objective function, state variables
and constraints were defined properly, at the end the point where the cost of a objective function
was minimum was obtained.
Theory:
All optimization problems are state some standard format. Essential information needs to be
extracted from the problem statement and write them in mathematical form. Essential parts of
an optimization problem statement:
1. The Design/Decision variables.
2. The Constraints.
3. The Objective function
4. The Process Model.
No single method or algorithm of optimization can be applied efficiently to all problems. The
method chosen for any particular case depends primarily on:
A refinery must produce 100 gallons of gasoline and 160 gallons of diesel to meet customer
demands. The refinery would like to minimize the cost of crude and two crude options exist. The
less expensive crude costs $80 USD per barrel while a more expensive crude costs $95 USD per
barrel. Each barrel of the less expensive crude produces 10 gallons of gasoline and 20 gallons of
diesel. Each barrel of the more expensive crude produces 15 gallons of both gasoline and diesel.
Find the number of barrels of each crude that will minimize the refinery cost while satisfying the
customer demands?
Procedure:
Theory line for description in Ap Monitor was illustrated with exclamation mark(!).
Statement scenario was written in the form of equation i.e. indicating constraints and
the relationship of objective function with the state variables (decision variables).
From this experiment we have concluded that to solve an optimization problem, the use of the
software makes it easy and time saving to solve given optimization problem. The constraints,
objective function, design variables are defined in software which makes it’s easy to find a
solution of optimization problems.
Lab Report # 08
Optimization of Refinery using AP-Monitor
Problem statement
Software
AP-Monitor (Online)
Procedure
First of all, formulate the problem statement.
There are two decision variable crude 1 and crude 2.
Objective function is to maximize profit.
Constraints are shown below.
Write code in AP-Monitor command window.
At last run your code and observe results.
Results
𝑏𝑏𝑙
𝑥1 = 𝑐𝑟𝑢𝑑𝑒. 1 ( )
𝑑𝑎𝑦
𝑏𝑏𝑙
𝑥2 = 𝑐𝑟𝑢𝑑𝑒. 2 ( )
𝑑𝑎𝑦
max 𝑦 = 𝑖𝑛𝑐𝑜𝑚𝑒 − 𝑟𝑎𝑤 𝑚𝑎𝑡𝑒𝑟𝑖𝑎𝑙 𝑐𝑜𝑠𝑡 − 𝑝𝑟𝑜𝑐𝑒𝑠𝑠𝑖𝑛𝑔 𝑐𝑜𝑠𝑡
Amount of each Product Produced
Gasoline 𝑥3 = 0.80𝑥1 + 0.44𝑥2
Kerosene 𝑥4 = 0.05𝑥1 + 0.10𝑥2
Fuel oil 𝑥5 = 0.10𝑥1 + 0.36𝑥2
Residual 𝑥6 = 0.05𝑥1 + 0.10𝑥2
Income
Gasoline: (36)0.80𝑥1 + 0.44𝑥2
Kerosene: (24)0.05𝑥1 + 0.10𝑥2
Fuel oil: (21)0.10𝑥1 + 0.36𝑥2
Residual: (10)0.05𝑥1 + 0.10𝑥2
So if,
Income = 32.6𝑥1 + 26.8𝑥2
Raw material cost = 24𝑥1 + 15𝑥2
Processing cost = 0.5𝑥1 + 𝑥2
The objective function is = 𝑓 = 8.1𝑥1 + 10.8𝑥2
Constraints
0.80𝑥1 + 0.44𝑥2 ≤ 24000 (Gasoline)
0.05𝑥1 + 0.10𝑥2 ≤ 2000 (Kerosene)
0.10𝑥1 + 0.36𝑥2 ≤ 6000 (Fuel oil)
𝑥1 ≥ 0
𝑥2 ≥ 0
Solver Output
apm 128.187.56.207_online_684
Degrees of freedom : 2
Successful Solution
Objective Value = -286758.621
Solution Results
Main Config Info Dashboard Oper FVs MVs SVs CVs Vars Sens Start Refresh (20m)
In optimization our target is to find optimal parameters for a process. There are many software
through which we can solve optimization problems. Aspen plus is one of them and especially
for chemical engineers. First we have to introduce a little about aspen plus which is given
below;
Aspen plus
Aspen Plus is a market-leading process modeling tool for conceptual design, optimization, and
performance monitoring for the chemical, polymer, specialty chemical, metals and minerals,
and coal power industries.
Problem
Minimization of energy consumption in column, variation of reflux ratio.
Constraints: Purity of bottom product is equal to 99.9%.
Flow sheet
Software
Aspen Plus
Procedure
Define components which is ethanol and water in this case.
Select process type and base method.
Draw flow sheet in Process flow sheet window.
Insert inputs for flow sheet (Temperature, Pressure, Mass flow and etc.)
In data browser there is model analysis tool in which we should select the optimization and
create new.
Define sampled variables, objective function (mini or max), variable (reflux ratio) also set
variable limits.
Select on constraint option in data browser and create new constraint.
Associate constraint with optimization.
At last run simulation and see results in optimization.
Lab Report # 11
Optimization of Methyl Ethyl Ketone (MEK) Using Aspen Plus
Procedure
Define components which is MEK in this case.
Select process type and base method.
Draw flow sheet in Process flow sheet window.
Insert inputs for flow sheet (Temperature, Pressure, Mass flow and etc.)
In data browser there is model analysis tool in which we should select the optimization and
create new.
Define sampled variables, objective function (mini or max), variable (reflux ratio) also set
variable limits.
Select on constraint option in data browser and create new constraint.
Associate constraint with optimization.
At last run simulation and see results in optimization.
Results
Objective function
𝑀𝑎𝑥 𝑦𝑖𝑒𝑙𝑑 = 𝑀𝐸𝐾 𝑖𝑛 𝐷𝑖𝑠𝑡𝑖𝑙𝑙𝑎𝑡𝑒 𝑝𝑟𝑜𝑑𝑢𝑐𝑡/𝑓𝑒𝑒𝑑 𝑡𝑜 𝑐𝑜𝑙𝑢𝑚𝑛
Constraint
99.7% 𝑝𝑢𝑟𝑖𝑡𝑦 𝑜𝑓 𝑀𝐸𝐾 𝑖𝑛 𝑝𝑟𝑜𝑑𝑢𝑐𝑡 𝑜𝑟 0.997 𝑚𝑜𝑙𝑒 𝑓𝑟𝑎𝑐𝑡𝑖𝑜𝑛 𝑜𝑓 𝑀𝐸𝐾 𝑖𝑛 𝑡𝑜𝑝 𝑝𝑟𝑜𝑑𝑢𝑐𝑡
Sampled variable
𝑀𝑜𝑙𝑎𝑟 𝑓𝑙𝑜𝑤 𝑜𝑓 𝑀𝐸𝐾 𝑓𝑒𝑒𝑑 𝑡𝑜 𝑐𝑜𝑙𝑢𝑚𝑛
𝑀𝑜𝑙𝑎𝑟 𝑓𝑙𝑜𝑤 𝑜𝑓 𝑀𝐸𝐾 𝑖𝑛 𝑝𝑟𝑜𝑑𝑢𝑐𝑡
Manipulated variable
𝑅𝑒𝑓𝑙𝑢𝑥 𝑟𝑎𝑡𝑖𝑜𝑛
𝐷𝑖𝑠𝑡𝑖𝑙𝑙𝑎𝑡𝑒 𝑡𝑜 𝑓𝑒𝑒𝑑 𝑟𝑎𝑡𝑖𝑜