engg2013 unit 3 rref and applications of linear equations jan, 2011
Post on 22-Dec-2015
217 Views
Preview:
TRANSCRIPT
A Traffic flow problem
• A round-about connecting 5 roads• The traffic within the circle is counter-clockwise.• Question: model the traffic in each section of the round-about
kshum ENGG2013 3
http
://w
ww
.bey
ond.
ca/h
ow-t
o-na
viga
te-a
-tra
ffic-
circ
le-r
ound
abou
t/210
.htm
l
Modeling a round-about
kshum ENGG2013 4
100
150
50
150 10050
300
400
200100
x1
x2
x4
x3
x5
Can we find x1, x2, x3, x4 and x5?
The unit is numberof vehicles perhour.
Last time: Gaussian elimination
• Step 1: Try to transform the matrix into upper triangular form
• Step 2: Backward substitution
kshum ENGG2013 7
Row operations
kshum ENGG2013 8
(5) (5)+(1)
(5) (5)+(2)
(5) (5)+(3)
(5) (5)+(4) Equation 5 is redundant
Choose a free variable• In this example, we can pick
any variable as the “free variable”.
• Let’s pick x5 as the free variable for example.
• Expressed in terms of x5, we get:
kshum ENGG2013 9
x4 = x5 – 100
x3 = (x5 – 100) + 50 = x5 – 50
x2 = (x5 – 50) – 100 = x5 – 150
x1 = (x5 – 150) + 50 = x5 – 100
But x1 to x5 are trafficflow in the round-aboutand cannot be negative.This restricts the value ofx5 to be at least 150. 0
0
0
0
General solution
kshum ENGG2013 10
where f is a real numberlarger than or equal to 150
Solution:
System of linear equations:
This is called the general solutionbecause all possible solutionscan be put in this form
Discussions• The system of linear equations is
underdetermined.– A car endlessly going around the circle without
exiting is undetectable in this model.– We cannot determine the traffic flow uniquely– There are infinitely many solutions.– How to remove redundant equalities in general?
• The variables in this example are subject to non-negativity constraint.– In many applications, the variables cannot be
negative.kshum ENGG2013 11
Sometimes we cannot find pivot
kshum ENGG2013 14
(2) (2) – 2(1)
(3) (3) – 3(1)
Cannot find a pivotin the second column
Row Echelon Form (REF)• A leading entry in a row means the first nonzero entry
from the left.• A rectangular matrix is in row echelon form if
– All nonzero rows are above any all-zero row.– All entries below a leading entry are zeros.– In any pair of adjacent nonzero row, say row i and row i+1,
the leading entry in row i is to the left of the leading entry of row i+1.
• Examples (triangles indicate the leading entries)
kshum ENGG2013 15
Non-examples of REF
kshum ENGG2013 16
– All nonzero rows are above any all-zero row.– All entries below a leading entry are zeros.– In any pair of adjacent nonzero row, say row i and row i+1, the leading
entry in row i is to the left of the leading entry of row i+1.
Reduced Row Echelon Form (RREF)
kshum ENGG2013 17
– All nonzero rows are above any all-zero row.– All entries above and below a leading entry are zeros.– In any pair of adjacent nonzero row, say row i and row i+1, the leading
entry in row i is to the left of the leading entry of row i+1.– All leading entries are equal to 1.
Examples
The concept of RREF appliesto all matrices in general, not just augmented matrix.
Theorem
• By applying the three types of elementary row operations, we can reduce any rectangular matrix to a matrix in reduced row echelon form (RREF).(In other words, any matrix is row equivalent to a matrix in RREF)
• Furthermore, the RREF of a matrix is unique.
kshum ENGG2013 19
A row reduction algorithm
1. Scan the columns from left to right.2. Start from the 1st column.3. If this column contains a pivot (a nonzero
entry), move the pivot to the top by exchanging rows
kshum ENGG2013 20
Algorithm (cont’d)
4. Make all entries below and above the pivot equal to 0.
5. Move to the next column and try to locate a nonzero entry which is not in any row already containing a pivot.
6. Repeat step 5 until you can find such column.
kshum ENGG2013 21
Algorithm (cont’d)
• Repeat step 3 to step 6 until we reach the right-most column.
• Finally, normalize all leading entries to 1.
kshum ENGG2013 22
The RREF of is
Parametric representation
• How to represent a solution set?• Example: How to plot points on a straight line?
kshum ENGG2013 24
y
x
2x+3y=2
We can solve for yin terms of xy = (2 – 2x) / 3
x (2 – 2x) / 3
0 2/3
1 0
2 -2/3
3 -4/3
x is a parameter whose value can be freely chosen.
Parametric representation of circle
• How about a circle x2+y2=1?
kshum ENGG2013 25
y
x
We can also solve for yin terms of xy = (1 – x2)^(1/2)
x (1 – x2)^0.5
0 1
0.2 0.9798
0.4 0.9165
0.6 0.8
0.8 0.6
1 0
x is a parameter whose value can be freely chosen.
There are many choices for parameters
kshum ENGG2013 26
y
x
2x+3y=2
x = (2 –3y)/2y = free
We can pick y as the parameter
y
x
We can pick as the parameter
x = cos y = sin
between 0 and 2
Parametric representations of a plane
• 2x + 3y – z = 5
kshum ENGG2013 27
-2-1
01
2
-2
-1
0
1
2-15
-10
-5
0
5
xy
z
x = freey = freez = 2x+3y–5
If x and y are the parameters,the representation is
x = (5+z–3y)/2 y = freez = free
If y and z are the parameters,the representation is
x = freey = (5+z–2x)/3 z = free
If x and z are the parameters,the representation is
Parametric representation ofthe solutions to a linear system
1. First row reduce the system of linear equations to a reduced row echelon form.
kshum ENGG2013 28
Solve
Transform to RREF
Pick the free variable(s)
2. Pick the variable(s) which is/are not associated with a column with pivot as “free variable”.
kshum ENGG2013 29
Pick z as a free variable
x y z
Solve for the non-free variables
• Express the “non-free” variables in terms of the “free” variables.
kshum ENGG2013 30
General solution
• The general solution to
can be represented parametrically as
kshum ENGG2013 31
General solution means1) All solutions can bewritten in this form2) Every (x,y,z) in thisform is a solution.
The solutions in set notation
kshum ENGG2013 32
stands for the set of all triples with real numbers as components
means “belong to”
How to plot the solutions?
kshum ENGG2013 33
z x = 2+z y= – 1 – 2z
-2 0 3
-1 1 1
0 2 –1
1 3 –3
2 4 –5
3 5 –7
We get (0,3,-2), (1,1,-1), (2,-1,0) etc, as solutions to
z is the parameter
Solution Set
kshum ENGG2013 34
-5
0
5 -5
0
5
-10
-5
0
5
10
y
x
z
The solutions form a straightline in the 3-D space.
A production model in economics• Consider a close economy
– one steel plant– one coal mine
• To produce 1 ton of steel, 0.5 ton of coal is consumed by the steel plant.• To produce 1 ton of coal, 0.1 ton of steel is used.
kshum ENGG2013 36
Steel Plant
50 tons of coal
100 tons of steel
10 tons of steel
Coal mine
100 tons of coal
Question• We want to produce 400 tons of steel and 300 tons of coal.
kshum ENGG2013 37
30
300
400
200To produce 1 ton of steel, we need 0.5 ton of coal.To produce 1 ton of coal, we need 0.1 ton of steel.
Does not work!
Formulation as a linear system• Suppose that the total output of steel plant is xS and the total output of coal mine
is xC.
kshum ENGG2013 38
400
0.1 xCTotal output ofthe steel plant
0.1 xC goes tothe coal mine
400 tonsare exported
300
0.5 xS
Total output ofthe coal mine
0.5 xS goes tothe steel plant
300 tonsare exported
Solve a system of two equations
kshum ENGG2013 39
Solution:xS = 452.63 xC = 526.32
In augmented matrix form
Internal consumption
kshum ENGG2013 40
Steel Plant
300 tons of coal
Coal mine
400 tons of steel
226.32 tonsof coal
52.63 tonsof steel
xS = 452.63
xC = 526.32
The red links indicate internal consumption
Leontief’s input-output model
• Proposed by Prof. Wassily Leontief (1905~1999) from Harvard.
• He modeled the economy of USA using linear algebra.
• From wikipedia: “Around 1949, Leontief used the primitive computer systems available at the time at Harvard to model data provided by the U.S. Bureau of Labor Statistics to divide the U.S. economy into 500 sectors. Leontief modeled each sector with a linear equation based on the data and used the computer, the Harvard Mark II, to solve the system, one of the first significant uses of computers for mathematical modeling”.
• Nobel prize in economics (1973)kshum ENGG2013 41
http
://e
n.w
ikip
edia
.org
/wik
i/Was
sily
_Leo
nti
ef
An example of three industries
kshum ENGG2013 43
Steel
Coal
Electric Power
0.5
0.4
0.10.6
0.3
0.1
0.2
0.1
0.7
0.1 of the total output fromcoal industry goes to thesteel industry, and 0.7 ofthe total output goes to the electric power industry.
0.4 of the total output fromthe electric power industrygoes to the coal mines, and0.5 of the total output goesto the steel plants
0.6 of the total output from the steel industry goes to the electric powerindustry, 0.3 of the output goes to the coal industry.
Distribution of outputs
kshum ENGG2013 44
Steel
Coal
Electric Power
0.5
0.4
0.10.6
0.3
0.1
0.2
0.1
0.7
Output FromPurchased bySteel Coal Power
0.1 0.1 0.5 Steel
0.3 0.2 0.4 Coal
0.6 0.7 0.1 Power
Question
• Can we find the prices of steel, coal, power, such that the cost to each industry is balanced with the income – can we find an equilibrium price ?
kshum ENGG2013 45
Balancing income and expenditure
• Let the price, or value, of steel, coal and electric power be Ps, Pc and Pe respectively.
• From “Expenditure = Income”, we get three equations
kshum ENGG2013 46
Output FromPurchased bySteel Coal Power
0.1 0.1 0.5 Steel
0.3 0.2 0.4 Coal
0.6 0.7 0.1 Power
Find the solutions from reduced row echelon form
kshum ENGG2013 48
Transform to RREF
Ps Pc Pe
Choose Pe as the free variable
Ps = 44/69 Pe
Pc = 17/23 Pe
Pe = any positive real number
Pivots
free
The equilibrium price• There are infinitely many solutions.
– Any constant multiple of them is also a solution.• For example, if Pe =1, we have
– Ps = 44/69 = 0.64– Pc = 17/23 = 0.74– Pe = 1 (electric power is the most valuable in this example)
• If Pe =100, the equilibrium prices are– Ps = 44/69 = 64– Pc = 17/23 = 74– Pe = 100
• There is no unique solution. It depends on the currency, RMB, Yen, USD etc.
kshum ENGG2013 49
Summary
• In many problems, the solutions are not unique.
• Reduced row echelon form is a useful in solving for the general solution, especially when the system of linear equations is under-determined.
• Linear algebra has applications in economics, for example in finding equilibrium.
kshum ENGG2013 50
top related