Or Lab Reports
Or Lab Reports
Submitted by
SHEHZAD AHMAD
20PWIND0648
Submitted to
Dr. SIKANDAR BILAL KHATTAK
LAB NO. 01
LAB TITLE:
Introduction to Operation Research Lab.
Introduction
Operation research is a discipline in which we make decisions through certain analytical
methods to find the solution. Here we are using different software to solve the problems each software
has its own usage according to the uses and its requirement.
Objectives
To become familiar with different software packages
To know about the different commands using in these software
Explanation
Operation research is covering most areas that is from forces to even transport services. Now
in this world competition is very important and also whether you want to increase your productivity than
how much features that you want to made in order to optimize the process.
In this discipline we are using different kind of software which gave us accurate results and can solve a
problem fastly as compared to manual method. So here we will use the following software:
1. LINGO
2. TORA
3. AMPL
4. EXCEL
LINGO Software
It is the optimization modeling software which can be use to solve linear, non-linear,
quadratic and integer optimization problems. LINGO provides a completely integrated package that
includes a powerful language for expressing optimization models having full featured environment of
editing in the problems.
Page 1 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
TORA software
TORA is an algorithm i.e. a mathematical set of instructions or programs It is an
optimization system in the area of operations research which is very easy to use. Further, TORA is menu-
driven and Windows-based which is very helpful. The software can be executed in automated or tutorial
mode. The automated mode reports the final solution of the problem, usually in the standard format
followed in commercial packages, while the tutorial mode keeps on giving step-wise information about
the methodology and solution.
Uses Of TORA Software:-
There are following uses of Tora software.
Linear equation
Linear programming
Network model
Project planning
Page 2 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
AMPL Software
The AMPL system supports the entire optimization modeling lifecycle formulation,
testing, deployment, and maintenance in an integrated way promotes rapid development and reliable
results. Using a high-level algebraic representation that describes optimization models, AMPL can
provide the head start you need to successfully implement large-scale optimization projects AMPL
integrates a modeling language for describing optimization data, variables, objectives, and constraints a
command language for debugging models and analyzing results and a scripting language for manipulating
data and implementing optimization strategies. All use the same concepts to promote streamlined
application-building.
Page 3 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
EXCEL salver
It is a software which can be find in any version of Microsoft office in which it is in the form of
spreadsheet consisting of cells through which we can make different computations and solve many
problems. Besides this we can produced different kinds of command such is AND, IF, OR etc which are
really helping us to perform the different tasks automatically and this is its beauty to compute everything
easily that is in dragging mode.
Page 4 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
Comments
By doing this lab I understand different software packages. I will use these software in linear
programming to solve different problems.
This lab introduced me about different software packages which are used in programming.
Conclusion:
From this lab report we learnt about operation research software and how it is been used for the
application of mathematics to give us solution of difficult questions. We know about the main application
of operation research. And how we will work in the EXCEL.
Page 5 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
LAB NO:
02
LAB TITLE:
Maximization & Minimization Problem by TORA
INTRODUCTION
In this lab session we learnt about TORA software that aids in finding the optimized solution of a
given problem. It is comparatively easier to work with this software. Data once entered can be easily
edited. There are different modules of TORA software each is specified for a specific problem. In this lab
session we solved a problem containing two variables. Minimize Diet & Maximize Reddy Mikks Co.
Problem using TORA.
OBJECTIVES
To know about TORA software.
To know about how to solve maximization and minimization problems in TORA
software.
To know about the window interface of the TORA software.
To know about how to solve linear equation problems with two variables.
To know about how to enter data in TORA software.
Problem Statement
In this lab session we solved two different problems. One is the maximization problem and the second
one is minimization problem. Problem statements of both the problems are given below: Reddy Mikks
Maximization Problem.
Page 6 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
Constraints:
Statement:
Constraints:
Page 7 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
PROCEDURE
How to Operate TORA:
i. In the very first step open the TORA software by simply clicking on its icon. It will
show a window which looks like:
Page 8 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
Objective Function:
Maximize z =5x1+4x2
Constraints:
6x1+4x2≤24
X1+2X2≤6
-X1+X2≤1
X2≤2
X1, X2≥0
Solution:
Now enter the data and click on the tab shown in circle:
Page 9 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
After clicking on solve menu an option will pop-up to either save file or not. So, just click on YES to save
file. After this another window will pop-up:
If you want to obtain graphical solution then a new screen would display in the next step:
Page 10 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
Now just click on constraints listed at a side, then just click on "Click here to graph LP in one stroke"
An optimum result will be displayed over the graph. The point is your maximization result.
MINIMIZE DIET:
Minimization Diet problem is stated above in the problem statement.
Objective Function:
Minimize Z=0.3X1 + 0.9X2
Constraints:
1) X1 + X2 >=800
2) 0.23X1 - 0.30X2 <= 0
3) 0.03X1 - 0.01X2 >= 0
4) Non-negativity
Page 11 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
Solution:
Now follow the same procedure as mentioned for the above problem but in this case click on to change
maximize to minimize:
Page 12 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
Now just click on constraints listed at a side, then just click on "Click here to graph LP in one stroke"
Page 13 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
CONCLUSION:
Thus, from this lab session we concluded that it is very easy to solve any optimization real life
problem in TORA software. User just have to enter data and then simply click on solve. Solutions
obtained from this software are relatively more accurate. This software is also not intricate
LAB NO:
03
Page 14 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
LAB TITLE:
Maximization & Minimization Problem by LINGO
Introduction
In this lab we solved three problems by taking help of software LINGO. In this we learnt
how to use the software through different commands and get the answer of what have required. LINGO is
a easiest software or tool designed to solve Linear, Nonlinear Quadratic optimization model in accurate
manner, easier and more efficient.
Objective
To familiarize with LINGO software
To apply practically the LINGO software on minimization and maximization problem.
To compare result of LINGO with TORA software.
Problem statement
Reddy Mikks produces both interior and exterior paints from two raw materials, M1 and M2. The
following table provides the basic data of the problem
A market survey indicates that the daily demand for interior paint cannot exceed that for exterior paint by
more than 1 ton. Also, the maximum daily demand for interior paint is 2 tons.
Reddy Mikks wants to determine the optimum (best) product mix of interior and exterior paints that
maximizes the total daily profit.
The LP model, as in any OR model, has three basic components.
Decision Variable
In this problem, we have two decision variable
X1= Exterior paint, X2= Interior paint
Objectives Function
From the problem statement we find that we are going to maximize profit so let z represent profit
Page 15 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
Maximize Z= 5x1+9x2
Constraints
From problem statement we are having five constraints,
6x1+4x2<=24
X1+2x2<=6
X2-x1<=1
X2<=2
Procedure
1st run the LINGO software
Figure 4.1
Now select on solve button the following window will occur as shown in fig 4.2.
Result
The result shows that this is an LP MODEL which is globally opted which means it is an internationally
standard model. The total number of variables used are 2 and the constraint are 5 with the objective value
of 21.0000.
Page 16 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
Diet Problem
Ozark Farms uses at least 800 lb. of special feed daily. The special feed is a mixture of corn and
soybean meal with the following compositions:
lb. per lb. of feedstuff
Decision variables
In this problem our decision will be based on corn and soya bean, so we have two decision variables,
X1=pound of corn, x2=pound of soyabean
Objective function
Our objective is to minimize the cost, let z represent cost, the function is
Minimize z= 0.3x1+0.9x2
Constraint
Here we are having three constraints
a) X1+x2>=800
Page 17 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
b) 0.09x1+0.6x2>=.3(x1+x2)
-0.21x1+0.3x2>=0
c) 0.02x1+0.06x2<=0.05(x1+x2)
-0.03x1+0.01x2>=0
Enter the data in the starting window:
Now select the solver button we will get result as shown in fig 4.3.
RESULTS
Page 18 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
The result shows that this is an LP MODEL which is globally opted which means it is an internationally
standard model. The total number of variables used are 2 and the constraint are 5 with the objective value
of 21.0000.
CONCLUSIONS:
This lab report is about introduction to the use of LINGO, use of their syntax, discussion of the results,
and the deciding of the different constraints, variables and objective functions as well.
Page 19 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
LAB NO:
04
LAB TITLE:
“SOLVE LOAN POLICY MODELON TORA, LINGOAND
EXCEL SOLVER”
INTRODUCTION:
TORA and LINGO are two different software that are we using for both to solve the LP problems. Here
we are making the comparison of both in order to get the conclusion that which has the ability to give the
better solution. TORA is an operating software which is used mostly to solve mathematical models. It is
an easy and very interesting software as compare to others. It gives us very accurate results of the
problems. In this lab we will discuss the linear programming. Linear programming is a problem-solving
approach that has been developed to help managers making decisions
OBJECTIVE:
Objectives of this lab are
PROBLEM STATEMENT:
Page 20 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
PROCEDURE:
SOLVING ON TORA:
Put the data in the given window when started but first select the number of constraints
and variables
Then put the equations coefficient and go for the solving window:
Page 21 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
SOLVING ON LINGO:
First insert the data on the window in equation form
Then use a command max or min according to the requirement
Write all the constraints
Put the semicolon after each equation
Page 22 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
Page 23 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
LAB NO:
05
LAB TITLE:
“To solve Oil Refining blending problem on TORA, Excel Solver,
AMPL, LINGO”
Introduction
The process of oil refining can be start with distillation crude oil to produce intermediate gasoline
stocks and then blending these stocks to produce final gasolines. These are varying according to octane
number the more the octane number the better quality.
Objectives
To solve oil refining problem on TORA, LINGO, EXCEL SOLVER, AMPL and
LINDO.
To find better Software to find solution that is optimum.
To know about the basic concept of the octane number in this problem.
Page 24 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
Procedure
1st solving on TORA:
While solving on TORA the following procedure must follow:
1st Run the TORA software
Put the limits according to the decimal system
Insert the the number of problem title, variables and constraints:
Insert the required values as given below:
Go to for solution and select the output screen:
So the final solution will appear as shown in figure 7.1 and 7.2.
Page 25 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
Page 26 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
LINGO also helpful to solve the problem so here the following procedure should be
followed:
1st open the command window
Put all the constraints:
Go for the solution tab:
Output will be as shown in figure 7.3 and 7.4.
Page 27 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
Conclusion
From this lab we concluded that this problem can be solved by TORA, LINDO, Excel
Solver, AMPL and LINGO. All software’s gives same result with different approaches. So, in this lab we
learn have learnt about different software’s to solve this type of question.
Page 28 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
Lab#6
Solve Urban Planning problem on Excel Solver
Introduction
This lab deals with solving urban planning problem on excel solver using an already made
template. Urban planning deals with three general areas: (1) building new housing developments
(2) upgrading inner-city deteriorating housing and recreational areas, and (3) planning public
facilities. The constraints associated with these projects are both economic and social. The
objectives in urban planning vary. In new housing developments, profit is usually the motive for
undertaking the project. In the remaining two categories, the goals involve social, political,
economic and cultural considerations.
Objectives
To install solver in excel
To understand how to enter a problem in solver
To be able to interpret the results generated through excel solver
Problem Statement
Page 29 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
Decision variables:
X1 = number of units of single-family homes
X2 = number of units of double family homes
X3 = number of units of triple family homes
X4 = number of units of quadruple family homes
X5 = number of units of demolished homes
Objective function:
Constraints
x 5≤300 ;
0.18 x 1+ 0.28 x 2+0.4 x 3+0.5 x 4≤0.2125 x 5
50 x 1+70 x 2+130 x 3+160 x 4+2 x 5≤15000
x 1≥0.2( x 1+ x 2+ x 3+ x 4 )
x 2≥0.1(x 1+ x 2+ x 3+ x 4 )
x 3+ x 4≥0.25(x 1+ x 2+ x 3+ x 4)
Page 30 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
In the Set Objective box, enter a cell reference or name for the objective cell. The objective
cell must contain a formula (in this case, =SUMPRODUCT (B3:F3, B$10: F$10)).
Since this is a maximization problem, check the max box.
In the By Changing Variable Cells box, enter a name or reference for each decision variable
cell range. Separate the non-adjacent references with commas. The variable cells must be
related directly or indirectly to the objective cell.
In the Subject to the Constraints box, enter any constraints that you want to apply by doing
the following:
In the Solver Parameters dialog box, click Add.
In the Cell Reference box, enter the cell reference or name of the cell range for which you
want to constrain the value.
Choose <=, =, or >= for the relationship in the Constraint box, type a number, a cell
reference or name, or a formula.
Click solve. The result generated is shown in figure5.3.
Page 31 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
Conclusion
Solver is a Microsoft Excel add-in program which can be used for what-if analysis. Use Solver to
find an optimal (maximum or minimum) value for a formula in one cell — called the objective
cell — subject to constraints, or limits, on the values of other formula cells on a worksheet.
Solver works with a group of cells, called decision variables or simply variable cells that are
used in computing the formulas in the objective and constraint cells. Solver adjusts the values in
the decision variable cells to satisfy the limits on constraint cells and produce the result for the
objective cell.
Page 32 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
Lab#7
Solving Reddy Mikks on AMPL
Introduction
This lab deals with solving Reddy Mikks and diet problem on AMPL. A Mathematical
Programming Language (AMPL) is an algebraic modeling language to describe and solve high-
complexity problems for large-scale mathematical computing (i.e., large-scale optimization and
scheduling-type problems).
The Reddy Mikks problem is a two- variable maximization problem that requires determining
the daily amounts to be produced of exterior and interior paints. Similarly, the diet problem is a
two- variable minimization problem that seeks to minimize the total daily cost (in dollars) of the
feed.
Objectives
To understand the general layout of AMPL
To be able to write a program in AMPL
To solve a maximization and minimization problem using AMPL
To recall a model written in notepad in AMPL
To be able to interpret results generated by AMPL
Problem Statement#1
Reddy Mikks produces both interior and exterior paints from two raw material M1, M2. The
following table provides the basic data of problem:
A market survey indicates that the daily demand for interior paint cannot exceed that for exterior
paint more than 1 ton. Also, the maximum daily demand for interior paint is 2 tons. Reddy Mikks
wants to determine the optimum (best) product mix of interior and exterior paints that maximizes
the total daily profit?
Page 33 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
Maximize z=5 x 1+ 4 x 2
Constraints
6 x 1+ 4 x 2≤ 24
x 1+2 x 2≤ 6
x 2−x 1 ≤1
x2≤2
Page 34 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
In order to recall an already written problem in notepad in AMPL, use model (filename).txt. In
this case, it was salmank, as shown in figure 7.3.
Conclusion
AMPL is a comprehensive and powerful algebraic modeling language for linear and nonlinear
optimization problems, in discrete or continuous variables. It uses common notation and familiar
concepts to formulate optimization models and examine solutions, while the computer manages
communication with an appropriate solver. AMPL’s flexibility and convenience render it ideal
for rapid prototyping and model development, while its speed and control options make it an
especially efficient choice for repeated production runs.
Page 35 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
LAB NO:09
LAB TITLE:
“TO solve the Minimal Spanning Tree problem on TORA”
Introduction:
The minimal spanning tree algorithm directly come from network analysis in which there are
different kind of network so it deals with linking the nodes of the network, directly or indirectly using the
shortest total length of connecting branches.
Objectives:
To know minimal spanning tree algorithm
To study different problems regarding this algorithm
To find the possible shortest way for different connected network
Problem statement:
Page 36 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
Procedure:
First run the TORA software
Select minimal spanning tree and then go to input screen:
Now put the required data such as no. of nodes and name it as well:
Page 37 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
Conclusion:
From this lab we concluded that we can easily the minimal spanning tree problem on TORA.
Here is our interest to find the solution of the different routes with the shortest distance each and that path
we selected is our optimum solution.
Results:
In this lab we determine the solution of the shortest way for the cable distribution of the wire so
our purpose is also fulfilling and the customer satisfaction is also fulfilling
Page 38 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
LAB NO: 10
TRANSPORTAION MODEL SOLVING BY TORA & LINGO
PROBLEM STATEMENT:
MG Auto has three plants in Los Angeles, Detroit, and New Orleans, and two major distribution centers
in Denver and Miami. The capacity of the three plants during the next quarter are 1000, 1500, and 1200
cars. The quarterly demand in the two distribution centers are 2300 and 1400 cars. The transportation
costs per car on the different routes is given in the following table
Page 39 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
Page 40 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
Lab#11
Solving Networking Problems on TORA (shortest routing and
Maximum Flow)
Introduction
This lab deals with solving two network models on TORA. The network model is the most
efficient way to link a number of locations directly or indirectly, finding the shortest route
between two cities, determining the maximum flow in a pipeline network, determining the
minimum-cost flow in a network that satisfies supply and demand requirements at different
locations and scheduling the activities of a project.
The minimal spanning tree (a network optimization algorithm) deals with linking the nodes of a
network, directly or indirectly, using the shortest total length of connecting branches. The
shortest route model (a network optimization algorithm) determines the shortest route between a
source and destination in a transportation network. Other situations can also be represented be
the same model, as illustrated in this lab.
Objectives
To understand the general network problem.
To solve two network problems on TORA using shortest route and maximum flow model.
To interpret the results generated by TORA.
Page 41 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
Solution in TORA
Enter the data as shown in the figure 12.5.
Page 42 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
Also, distance between cities of desire can be seen too by entering the node names as shown
below. The shortest distance between cities 1 and 8 is 8 miles.
Determine the maximal flow in each arc for the network in figure 12.8
Solution in TORA
Page 43 of 45
SHEHZAD AHMAD
OPERATION RESEARCH
Conclusion
Shortest path algorithms are applied to automatically find directions between physical locations,
such as driving directions on web mapping websites like MapQuest or Google Maps. For this
application fast specialized algorithms are available.
This problem involves a directed network with arcs carrying flow. The only relevant parameter
is the upper bound on arc flow, called arc capacity. The problem is to find the maximum flow
that can be sent through the arcs of the network from some specified node s, called the source, to
a second specified node t, called the sink. Applications of this problem include finding the
maximum flow of orders through a job shop, the maximum flow of water through a storm sewer
system, and the maximum flow of product through a product distribution system, among others.
Page 44 of 45