A 1 Adj A where Adj A ij 1 ij det A ji and A ji is A with row j and column i deleted Use this to find the inverse of 2 Computing the ID: 423128
Download Presentation The PPT/PDF document "1 Jacobi’s formula:" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
1
Jacobi’s formula:A-1 = Adj(A) where Adj(A)i,j = (-1)i+j det(A[j,i]) and A[j,i] is A with row j and column i deleted.Use this to find the inverse of:
Slide2
2
Computing the Adjoint matrix:Slide3
3
Assignment #3 is available.Due: Monday Nov. 5, beginning of classSlide4
Initial dictionary:
X4 =5 -1 X1 -1 X2 +1 X3X5 =3 -1 X1 +0 X2 -2 X3X6 =4 +0 X1 -1 X2 -6 X3------------------------z = 0 +1 X1 +3 X2 +6 X3 Final dictionary:X2 =4 -6 X3 +0 X4 -1 X6 X1 =1 +7 X3 -1 X4 +1 X6 X5 =2 -9 X3 +1 X4 -1 X6 -----------------------z =13 -5 X3 -1 X4 -2 X6 What are B and B-1 for the final dictionary?4Slide5
The
initial matrix A: X1 X2 X3 X4 X5 X6 [ 1 1 -1 1 0 0 ][ 1 0 2 0 1 0 ][ 0 1 6 0 0 1 ]The final matrix: X1 X2 X3 X4 X5 X6[ 0 1 6 0 0 1 ] [ 1 0 -7 1 0 -1 ] [ 0 0 9 -1 1 1 ] 5Slide6
The
initial matrix A: X1 X2 X3 X4 X5 X6 [ 1 1 -1 1 0 0 ][ 1 0 2 0 1 0 ][ 0 1 6 0 0 1 ]The final matrix: X1 X2 X3 X4 X5 X6[ 0 1 6 0 0 1 ] [ 1 0 -7 1 0 -1 ] [ 0 0 9 -1 1 1
]
B
=
X2
X1
X5
[
1 1 0 ][ 0 1 1 ][ 1 0 0 ]
B-1 = X4 X5 X6 [ 0 0 1 ][ 1 0 -1 ][ -1 1 1 ]
6Slide7
Initial dictionary:
X4 =5 -1 X1 -1 X2 +1 X3X5 =3 -1 X1 +0 X2 -2 X3X6 =4 +0 X1 -1 X2 -6 X3------------------------z = 0 +1 X1 +3 X2 +6 X3 What of this information do we really need to know to decide where to pivot?7Slide8
Initial dictionary:
X4 =5 -1 X1 -1 X2 +1 X3X5 =3 -1 X1 +0 X2 -2 X3X6 =4 +0 X1 -1 X2 -6 X3------------------------z = 0 +1 X1 +3 X2 +6 X3 Look at z row to choose the pivot column.With smallest subscript rule, we would choose X1 to enter.8Slide9
Initial dictionary:
X4 =5 -1 X1 -1 X2 +1 X3X5 =3 -1 X1 +0 X2 -2 X3X6 =4 +0 X1 -1 X2 -6 X3------------------------z = 0 +1 X1 +3 X2 +6 X3 2. Look at entering column and b column to find tightest constraint (pivot row).9Slide10
After 1 pivot:
X4 = 2- 1 X2 + 3 X3 + 1 X5 X1 = 3+ 0 X2 - 2 X3 - 1 X5 X6 = 4- 1 X2 - 6 X3 + 0 X5 --------------------------------z = 3+ 3 X2 + 4 X3 - 1 X5 Idea behind the revised Simplex method:just keep track of what we need to know instead of the entire tableau.10Slide11
Note: A standard convention in matrix algebra is that a vector x is by default a
column vector and xT is a row vector. The text does not follow this standard convention, but I am using it. Hence, the notation here may differ a bit from the text. x= xT= [x1 x2 x3 ... x
n
]
11Slide12
In the Simplex Method, what information is needed to find the next basic feasible solution?
1. Coefficients of non-basic variables in the z row to determine the pivot column. 2. The pivot column and the current solution to determine the pivot row. The new solution is then determined from the pivot column and the old solution. 12Slide13
H
BT = indices of basic columns.HNT = indices of non-basic columns. Split the matrix A into two parts:AB = columns corresponding to HBT.AN = columns corresponding to HNT.Create cB, cN, and xB,
x
N
the same
way.
What are these for this initial
dictionary?
X4
=5 -1 X1 -1 X2 +1 X3
X5 =3 -1 X1 +0 X2 -2 X3
X6 =4 +0 X1 -1 X2 -6 X3
------------------------
z = 0 +1 X1 +3 X2 +6 X3 13Slide14
H
BT = indices of basic columnsHNT = indices of non-basic columnsSplit the matrix A into two parts:AB = columns corresponding to HBTAN = columns corresponding to HNTCreate cB, cN, and xB, xN the same way. What are these for this finaldictionary?
X2 =4 -6 X3 +0 X4 -1 X6
X1 =1 +7 X3 -1 X4 +1 X6
X5 =2 -9 X3 +1 X4 -1 X6
-----------------------
z =13 -5 X3 -1 X4 -2 X6
14Slide15
Another problem:
X4 = 5 - 2 X1 - 3 X2 - 1 X3 X5 = 11 - 4 X1 - 1 X2 - 2 X3 X6 = 8 - 3 X1 - 4 X2 - 2 X3 ------------------------------z = 0 + 5 X1 + 4 X2 + 3 X3 X1 enters. X4 leaves. X1 = 2.5 - 1.5 X2 -0.5 X3 - 0.5 X4 X5 = 1.0 + 5.0 X +0.0 X3 + 2.0 X4 X6 = 0.5 + 0.5 X2 -0.5 X3 + 1.5 X4
--------------------------------------
z
= 12.5
-
3.5 X2+ 0.5
X3 -
2.5
X4
15Slide16
For this problem we have:
Maximize cT xcT= [5 4 3 0 0 0] x=[x1 x2 x3 x4 x5 x6]Tsubject to A x = bA = [ 2 3 1 1 0 0 ] [ 5] [ 4 1 2 0 1 0 ] b= [11]
[
3 4 2
0
0
1
] [ 8]
Initially
, the basis corresponds to the slack variables
x
4
,
x5, x6: HBT= [ 4 5 6] // subscripts for basisThe non-basic variables are x1,
x2, and x3: HNT= [1
2 3]
// subscripts of non-basic variables.
16Slide17
Split the matrix A into two parts:
AB = columns corresponding to HBTAN = columns corresponding to HNTHBT =[4 5 6]AB =[1 0 0][0 1 0][0 0 1]Create cB, cN, and xB,
x
N
the same way:
c
B
= [0
0 0]
T
c
N
= [5 4 3]TxB= [x4 x5 x6]TxN= [x1 x2
x3]THNT =
[
1 2 3]
A
N
=
[
2 3 1]
[
4 1 2]
[
3 4 2]
17Slide18
The system of equations can then be expressed as:
(a) A x = b ⟹ AB xB + AN xN = b(b) z= cBT xB + cNT xNFrom (a), xB = A
B
-1
b -
A
B
-1
A
N
x
N = AB-1 [b - AN xN]Plugging this into the formula for z: z=
cBT AB-1 [ b - AN
x
N
]
+
c
N
T
x
N
So the dictionary with basis AB reads:
xB
= AB -1 * [ b - AN *
xN
]
-------------------------------------------
z=
cBT
* AB -1 * [ b - AN *
xN
] +
cNT
*
xN
18Slide19
From the previous slide:
xB = AB-1 [b - AN xN]z= cBT AB-1 [ b - AN xN ] + cNT xNSo the dictionary with basis A
B
reads:
x
B
= A
B
-1
[
b
– A
N xN ]-----------------------------z = cBT AB-1 [ b - AN xN ] +
cNT xN19Slide20
The
dictionary with basis AB reads: xB = AB-1 [ b – AN xN ]-----------------------------z = cBT AB-1 [ b - AN xN ] + cNT xNx
B
=
=
x4 = 5 - 2 x1 - 3 x2 - 1 x3
x5 = 11 - 4 x1 - 1 x2 - 2 x3
x6 = 8 - 3 x1 - 4 x2 - 2 x3
------------------------------
z
=
0 + 5 x1 + 4 x2 + 3 x3
20Slide21
z =
cBT AB-1 [ b - AN xN ] + cNT xNz=(0 0 0)
+
(5 4 3 )
x4
= 5 - 2 x1 - 3 x2 - 1 x3
x5 = 11 - 4 x1 - 1 x2 - 2 x3
x6 = 8 - 3 x1 - 4 x2 - 2 x3
------------------------------
z
=
0 + 5 x1 + 4 x2 + 3 x3
21Slide22
Step 1: Find coefficients of non-basic variables in the z row.
z = cBT AB-1 [ b - AN xN ] + cNT xNLet yT= cBT * AB-1Find yT by solving yT A
B
=
c
B
T
or equivalently A
B
T
y =
c
B
.Set z= yT b + [cNT - yT AN ] xN
22Slide23
Find
yT by solving ABT y = cB.Set z= yT b + [cNT - yT AN ] xN
=
z
= [0 0 0]
+
z
= 0 + 5 x1 + 4 x2 + 3 x3
The
y
T
b gives the constant term in the z row and the rest gives the terms corresponding to the non-basic variables.
23Slide24
Step 2: Determine the leaving variable.
Solve for entering column d in current dictionary: d= AB-1 a where a is the entering column taken from the initial problem.Or equivalently, solve for d: AB d = aIf tightest constraint corresponds to xleaving= v – t * xenteringthen the new value of xentering will bes= v/t.24Slide25
Solving A
B d = a: Recall: z = 0 + 5 x1 + 4 x2 + 3 x3 Choose x1 to enter. Which variable leaves? Solving AB d= a:
=
25Slide26
Which equation imposes the tightest constraint?
5 - 2x1 ≥ 0 ⟹ x1 ≤ 5/2 (*)11 - 4x1 ≥ 0 ⟹ x1 ≤ 11/4 8 - 3x1 ≥ 0 ⟹ x1 ≤ 8/3
The
first basis variable
x
4
leaves because the first equation is the tightest. The value of the entering variable is 5/2 because this is the tightest constraint
.
P
lug
in the value of the entering
variable:
x4= 5 - 2(5/2) = 0 x1= 5/2x5= 11 - 4(5/2) = 1x6= 8 - 3(5/2) = 1/226Slide27
Updating all the variables:
HBT =[1 5 6]AB =[2 0 0][4 1 0][3 0 1] cB = [5 0 0]TcN=
[
0
4 3]
T
x
B
= [
x
1
x
5 x6]TxN= [x4 x2 x3]TCurrent solution:
[5/2 1 1/2]HNT
=
[
4
2 3]
A
N
=
[
1
3 1]
[
0
1 2]
[
0
4 2
]
Z
is:
(previous value of Z)
+ (
coeff. of entering var. in Z row) * (new value of entering variable)
=
0 +
5*(5/2)
= 25/2
27Slide28
The Revised Simplex Method uses more
work to determine the z row coefficients, the column that should enter, and the pivot row number (exiting variable) but then it takes less work to pivot. 28Slide29
Summary of the steps of the Revised Simplex Method:
Maintain for each step: HB- the current basis header. HN- the header for the non-basic variables (optional). the current solution. AB- the columns from A which correspond to the basis in the same order as in HB. [Actually, most programs maintain some factorization of this matrix]. 29Slide30
5. A
N- the columns from A which correspond to the basis in the same order as in HN. [Actually, you can get these columns from A when you need them so you don't really have to store this.] 6. cB- the costs of the basic variables in the same order as HB. 7. cN- the costs of the non-basic variables in the same order as HN. 8. z- the current value of the objective function. 30Slide31
The Revised Simplex Algorithm
Step 1: Determine pivot column. Solve ABT y = cB for y.compute [cNT - yT AN] * xNto get coefficients of non-basic variables.Look for a positive coefficient, say r corresponding to non-basic xj.31Slide32
Step 2: Determine the leaving variable.
Solve for entering column d in current dictionary: d= AB-1 a where a is the entering column taken from the initial problem.Or equivalently, solve for d: AB d = aIf tightest constraint corresponds to xleaving= v – t * xenteringthen the new value of xentering will be s= v/t.32Slide33
Step 3: Update variables
(xj enters, xk leaves). Update basic variables headers HB by replacing k with j. Update HN by replacing j with k. Set xj = s in the new solution. Plug this value for xj into the other equations to update the values of the other basic variables. The leaving variable will be 0.Recall r = the coefficient of xj in the z row:Set z = z + r s.Update AB, AN
,
c
B
,
c
N
,
x
B
,
x
N to match basis headers.33