recn8 - A = 1-1 3 5 1 1 2 4 Extracting a column:...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
ORIE 3300/5300 RECITATION 8 Fall 2010 Wednesday October 27 – Tuesday November 2. Do this exercise with your declared partner (if you have one). Use the Revised Simplex Method to solve the following linear programming problem (in standard inequality form). maximize c T x subject to Ax b x 0 , where A = 1 2 1 1 3 2 3 1 2 , c = 1 7 4 , b = 5 9 8 . Use MATLAB to do the calculations. A quick review of MATLAB is below. Introduce slack variables first, and use them as the initial basic variables. Use the largest reduced cost rule to choose the entering variable. At each step, clearly show the basis, the current values of the basic variables, the vector y , the top-row coefficients ¯ c j you compute, the entering index, the vector d , the number t , and the leaving index. Also use MATLAB to compute the final tableau. Useful MATLAB commands Entering a vector: >> f = [1 0 2 -1] f = 1 0 2 -1 Transposition: >> c = f’ c = 1 0 2 -1 Entering a matrix: 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
>> A = [1 -1 3 5 ; 1 1 2 4]
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: A = 1-1 3 5 1 1 2 4 Extracting a column: >> A(:,2) ans =-1 1 A list of subscripts: >> B = [2 4] B = 2 4 Extracting the matrix with those corresponding columns: >> E = A(:,B) E =-1 5 1 4 b = [2 ; 7] b = 2 7 Solving the equation E * x = b: >> x = E\b x = 3 1 2 Checking the answer: >> E * x ans = 2 7 >> d = [6 ; 3] d = 6 3 Scalar multiplication: >> 2*d ans = 12 6 Vector addition: >> b+d ans = 8 10 Finding a subset of the indices of a vector: >> c c = 1 2-1 >> indpos = find(c > 0) indpos = 3 1 3 Elementwise division of vectors: >> b./d ans = 0.3333 2.3333 Computing the minimum entry in a vector: minrat = min(b./d) minrat = 0.3333 or [minrat,index] = min(b./d) minrat = 0.3333 index = 1 Keeping a record of your work in the le my-work : >> diary my-work Turning o the diary: >> diary off 4...
View Full Document

Page1 / 4

recn8 - A = 1-1 3 5 1 1 2 4 Extracting a column:...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online