Project Report Matlab
Project Report Matlab
SUBMITTED TO:
Engr. Muhammad Usman
SUBJECT:
Applied Linear Algebra (LAB)
PROJECT TITLE:
Solution of Network Flow Problem using MATLAB.
PROJECT REPORT
Many types of real-world problems involve networks along with some sort of flow is observed. A
network of roads and network of irrigation system are examples of such problems. The system
headworks of canals and junctions of roads are the points where the flow of water and volume
of traffic are studied and analyzed. Mathematical model of the problem consists of linear
equations which can be solved by various methods.
Network Flow:
A network flow (also known as a transportation network) is a directed graph where each edge
has a capacity and each edge receives a flow. The amount of flow on an edge cannot exceed the
capacity of the edge. A network consists of a set of points called junctions, or nodes, with lines
or arcs called branches connecting some or all of the junctions. The direction of flow in each
branch is indicated, and the flow amount (or rate) is either shown or is denoted by a variable.
A flow must satisfy the restriction that the amount of flow into a node equals the amount of flow
out of it, unless it is a source, which has only outgoing flow, or sink, which has only incoming flow.
Systems of linear equations arise naturally when scientists, engineers, or economists study the
flow of some quantity through a network. For instance, urban planners and traffic engineers
monitor the pattern of traffic flow in a grid of city streets. A network can be used to model traffic
in a computer network, circulation with demands, fluids in pipes, currents in an electrical circuit,
or anything similar in which something travels through a network of nodes. Flows can pertain to
people or material over transportation networks, or to electricity over electrical distribution
systems.
Objective:
1. To determine the general flow pattern for a network using Computer Algebra System i.e.
MATLAB.
2. Upon closing one particular road, determining the traffic flow on all other roads.
Problem: The network in following figure shows the traffic flow (in vehicles per
hour) over several one-way streets in F-6, Islamabad during a typical early
afternoon.
i) Determine the general flow pattern for the network.
ii) The Capital Development Authority (CDA) needs to take this traffic count as
typical rush hour evening traffic in this area. In their planning of the annual
closure of road ‘AE’ for repair, how much traffic can be expected on all other
roads.
60
A B C
310 400
60
E D
70
F G
100
90
220
430
Solution:
The street intersections (junctions) and the unknown flows in the branches were labeled, as
shown below.
MATHEMATICAL MODEL
310 X1 60 400
A B C
X2 X3
60
D X7
70 E
X4
X5
XX16
F G
100
90
220 430
At each intersection, flow in was set equal to the flow out.
A X1+X2 310
B 60+X3 X1
C 400 60+X7
D X5 X3+60
E 60+X4 X2+70
F 100 X4+X6
G X6+220 X5
Also, the total flow into the network equals the total flow out of the network.
X 1 + X2 =310
X1 - X3 = 60
X7 = 340
- X3 + X5 = 60
- X2 + X4 = 10
X4 +X6 = 100
X 5 - X6 = 220
The augmented matrix of given network flow problem equations was written. The associated
augmented matrix was row reduced.
MATLAB COMMAnD WInDOW
X1 - X 6 = 220
X2 + X 6 = 90
X3 - X 6 = 160
X4 + X 6 = 100
X5 - X6 = 220
X7 = 340
After rearranging, the general flow pattern for the network is described by:
X1 = 220 + X6 (A)
X2 = 90 – X6 (B)
X3 = 160 + X6 (C)
X4 = 100 – X6 (D)
X5 = 220 + X6 (E)
X7 = 340 (F)
X6 is free.
A negative flow in a network branch corresponds to flow in the direction opposite to that shown
on the model. Since the streets in this problem are one-way, none of the variables here can be
negative. This fact leads to certain limitations on the possible values of the variables. For instance,
X6 ≤ 90 because X2 cannot be negative.
Since X6 ≤ 90 and X6 ≥ 0, the equation:
(A) for X1 implies that X1 ≥ 220, X1 ≤ 310. So 220 ≤ X1 ≤ 310
(B) for X2 implies that X2 ≥ 0, X2 ≤ 90. So 0 ≤ X2 ≤ 90
(C) for X3 implies that X3 ≥ 160, X3 ≤ 250. So 160 ≤ X3 ≤ 250
(D) for X4 implies that X4 ≥ 10, X4 ≤ 100. So 10 ≤ X4 ≤ 100
(E) for X5 implies that X5 ≥ 220, X5 ≤ 310. So 220 ≤ X5 ≤ 310
Part (ii)
On account of the closure of road AE for repair we must have X 2 equal to zero, then X6 (the
number of vehicles expected on all other lanes) can be obtained from using equations (B) and
(D).
X2 = 90 – X6
X6 = 90
Putting value of X6 in (A), (C), (D), (E):
X1 = 310
X3 = 250
X4 = 10
X5 = 310
Also, X2 = 0 and X7 = 340
Conclusion:
Network flows are a great area of research for solving a huge variety of problems. The purpose
of this project was to apply effective strategies for dealing with network flow problems that arise
at different locations and different situations.
We took a traffic flow problem of Sector F-6 Islamabad and found the traffic flow along its streets.
We made system of linear equations and solved the system in MATLAB using the function “rref”(
Row Reduced Echelon Form ). Moreover, assuming one road to be closed, the traffic flow along
other roads was also calculated.