ENG M 541 Assignment #2 Solutions c MG Lipsett 2008

19
ENG M 541 Assignment #2 Solutions c MG Lipsett 2008

Transcript of ENG M 541 Assignment #2 Solutions c MG Lipsett 2008

Page 1: ENG M 541 Assignment #2 Solutions c MG Lipsett 2008

ENG M 541Assignment #2Solutions

c MG Lipsett 2008

Page 2: ENG M 541 Assignment #2 Solutions c MG Lipsett 2008

ENGM 541 Assignment 2 Problem 1 a) Total Steps Iteration Method for Solving A Linear Equilibrium System [ A ] {x} = {c}MG Lipsett 2008

1 2 -2 x1 = 11 1 1 x2 = 3 note that row sum criterion is not satisfied, and so convergence is not guaranteed2 2 1 x3 = 5

x1 x2 x3 new x1 new x2 new x3initial guesses 0.5 0.5 0.5 1 n/a n/a Calculate new estimate of x1=1/a11[c1 - (a12*x2 = a13*x3)] using current set of x1, x2, x3

0.5 0.5 0.5 n/a 2 n/a Calculate new estimate of x2=1/a22[c2 - (a21*x1 = a23*x3)] using current set of x1, x2, x30.5 0.5 0.5 n/a n/a 3 Calculate new estimate of x3=1/a33[c3 - (a31*x1 = a32*x2)] using current set of x1, x2, x3

update guesses, and continue of not converged

1 2 3 3 n/a n/a Calculate new estimate of x1=1/a11[c1 - (a12*x2 = a13*x3)] using current set of x1, x2, x31 2 3 n/a -1 n/a Calculate new estimate of x2=1/a22[c2 - (a21*x1 = a23*x3)] using current set of x1, x2, x31 2 3 n/a n/a -1 Calculate new estimate of x3=1/a33[c3 - (a31*x1 = a32*x2)] using current set of x1, x2, x3

update guesses, and continue of not converged

3 -1 -1 1 n/a n/a Calculate new estimate of x1=1/a11[c1 - (a12*x2 = a13*x3)] using current set of x1, x2, x33 -1 -1 n/a 1 n/a Calculate new estimate of x2=1/a22[c2 - (a21*x1 = a23*x3)] using current set of x1, x2, x33 -1 -1 n/a n/a 1 Calculate new estimate of x3=1/a33[c3 - (a31*x1 = a32*x2)] using current set of x1, x2, x3

update guesses, and continue of not converged

1 1 1 1 n/a n/a Calculate new estimate of x1=1/a11[c1 - (a12*x2 = a13*x3)] using current set of x1, x2, x31 1 1 n/a 1.00000 n/a Calculate new estimate of x2=1/a22[c2 - (a21*x1 = a23*x3)] using current set of x1, x2, x31 1 1 n/a n/a 1 Calculate new estimate of x3=1/a33[c3 - (a31*x1 = a32*x2)] using current set of x1, x2, x3

update guesses, and continue of not converged

1 1 1 1 n/a n/a Calculate new estimate of x1=1/a11[c1 - (a12*x2 = a13*x3)] using current set of x1, x2, x31 1 1 n/a 1.00000 n/a Calculate new estimate of x2=1/a22[c2 - (a21*x1 = a23*x3)] using current set of x1, x2, x31 1 1 n/a n/a 1 Calculate new estimate of x3=1/a33[c3 - (a31*x1 = a32*x2)] using current set of x1, x2, x3

update guesses, and continue of not converged

1 1 1 1 n/a n/a Calculate new estimate of x1=1/a11[c1 - (a12*x2 = a13*x3)] using current set of x1, x2, x31 1 1 n/a 1.00000 n/a Calculate new estimate of x2=1/a22[c2 - (a21*x1 = a23*x3)] using current set of x1, x2, x31 1 1 n/a n/a 1 Calculate new estimate of x3=1/a33[c3 - (a31*x1 = a32*x2)] using current set of x1, x2, x3

update guesses, and continue of not converged

1 1 1 1 n/a n/a Calculate new estimate of x1=1/a11[c1 - (a12*x2 = a13*x3)] using current set of x1, x2, x31 1 1 n/a 1.00000 n/a Calculate new estimate of x2=1/a22[c2 - (a21*x1 = a23*x3)] using current set of x1, x2, x31 1 1 n/a n/a 1 Calculate new estimate of x3=1/a33[c3 - (a31*x1 = a32*x2)] using current set of x1, x2, x3

update guesses, and continue of not converged

1 1 1 1 n/a n/a Calculate new estimate of x1=1/a11[c1 - (a12*x2 = a13*x3)] using current set of x1, x2, x3

convergence to < E-03

solution:-1 -6 4 1

inv [ A ] = 1 5 -3 x = 10 2 -1 1

calculated using MINVERSE()

in Matlab, the solution to x is expressed as x = A\c, where c is the column vector of constants on the RHS

Page 3: ENG M 541 Assignment #2 Solutions c MG Lipsett 2008

ENGM 541 Assignment 2 Problem 1 b) Gauss-Siedel Iteration Method for Solving A Linear Equilibrium SystemMG Lipsett 2008 [ A ] {x} = {c}

1 2 -2 x1 = 11 1 1 x2 = 3 note that row sum criterion is not satisfied, and so convergence is not guaranteed2 2 1 x3 = 5

x1 x2 x3 new x1 new x2 new x3initial guesses 0.5 0.5 0.5 1 n/a n/a Calculate new estimate of x1=1/a11[c1 - (a12*x2 = a13*x3)] using current set of x1, x2, x3update x1 1 0.5 0.5 n/a 1.50000 n/a Calculate new estimate of x2=1/a22[c2 - (a21*x1 = a23*x3)] using current set of x1, x2, x3update x2 1 1.5 0.5 n/a n/a 0 Calculate new estimate of x3=1/a33[c3 - (a31*x1 = a32*x2)] using current set of x1, x2, x3update x3; converged? 1 1.5 0 -2 n/a n/a Calculate new estimate of x1=1/a11[c1 - (a12*x2 = a13*x3)] using current set of x1, x2, x3update x1 -2 1.5 0 n/a 5.00000 n/a Calculate new estimate of x2=1/a22[c2 - (a21*x1 = a23*x3)] using current set of x1, x2, x3update x2 -2 5 0 n/a n/a -1 Calculate new estimate of x3=1/a33[c3 - (a31*x1 = a32*x2)] using current set of x1, x2, x3update x3; converged? -2 5 -1 -11 n/a n/a Calculate new estimate of x1=1/a11[c1 - (a12*x2 = a13*x3)] using current set of x1, x2, x3update x1 -11 5 -1 n/a 15.00000 n/a Calculate new estimate of x2=1/a22[c2 - (a21*x1 = a23*x3)] using current set of x1, x2, x3update x2 -11 15 -1 n/a n/a -3 Calculate new estimate of x3=1/a33[c3 - (a31*x1 = a32*x2)] using current set of x1, x2, x3update x3; converged? -11 15 -3 -35 n/a n/a Calculate new estimate of x1=1/a11[c1 - (a12*x2 = a13*x3)] using current set of x1, x2, x3update x1 -35 15 -3 n/a 41.00000 n/a Calculate new estimate of x2=1/a22[c2 - (a21*x1 = a23*x3)] using current set of x1, x2, x3update x2 -35 41 -3 n/a n/a -7 Calculate new estimate of x3=1/a33[c3 - (a31*x1 = a32*x2)] using current set of x1, x2, x3update x3; converged? -35 41 -7 -95 n/a n/a Calculate new estimate of x1=1/a11[c1 - (a12*x2 = a13*x3)] using current set of x1, x2, x3update x1 -95 41 -7 n/a 105.00000 n/a Calculate new estimate of x2=1/a22[c2 - (a21*x1 = a23*x3)] using current set of x1, x2, x3update x2 -95 105 -7 n/a n/a -15 Calculate new estimate of x3=1/a33[c3 - (a31*x1 = a32*x2)] using current set of x1, x2, x3update x3; converged? -95 105 -15 -239 n/a n/a Calculate new estimate of x1=1/a11[c1 - (a12*x2 = a13*x3)] using current set of x1, x2, x3update x1 -239 105 -15 n/a 257.00000 n/a Calculate new estimate of x2=1/a22[c2 - (a21*x1 = a23*x3)] using current set of x1, x2, x3update x2 -239 257 -15 n/a n/a -31 Calculate new estimate of x3=1/a33[c3 - (a31*x1 = a32*x2)] using current set of x1, x2, x3update x3; converged? -239 257 -31 -575 n/a n/a Calculate new estimate of x1=1/a11[c1 - (a12*x2 = a13*x3)] using current set of x1, x2, x3update x1 -575 257 -31 n/a 609.00000 n/a Calculate new estimate of x2=1/a22[c2 - (a21*x1 = a23*x3)] using current set of x1, x2, x3update x2 -575 609 -31 n/a n/a -63 Calculate new estimate of x3=1/a33[c3 - (a31*x1 = a32*x2)] using current set of x1, x2, x3update x3; converged? -575 609 -63 -1343 n/a n/a Calculate new estimate of x1=1/a11[c1 - (a12*x2 = a13*x3)] using current set of x1, x2, x3

Gauss-Siedel diverges for this system

solution:-1 -6 4 1

inv [ A ] = 1 5 -3 x = 10 2 -1 1

calculated using MINVERSE()

in Matlab, the solution to x is expressed as x = A\c, where c is the column vector of constants on the RHS

Page 4: ENG M 541 Assignment #2 Solutions c MG Lipsett 2008
Page 5: ENG M 541 Assignment #2 Solutions c MG Lipsett 2008
Page 6: ENG M 541 Assignment #2 Solutions c MG Lipsett 2008
Page 7: ENG M 541 Assignment #2 Solutions c MG Lipsett 2008
Page 8: ENG M 541 Assignment #2 Solutions c MG Lipsett 2008
Page 9: ENG M 541 Assignment #2 Solutions c MG Lipsett 2008
Page 10: ENG M 541 Assignment #2 Solutions c MG Lipsett 2008
Page 11: ENG M 541 Assignment #2 Solutions c MG Lipsett 2008
Page 12: ENG M 541 Assignment #2 Solutions c MG Lipsett 2008
Page 13: ENG M 541 Assignment #2 Solutions c MG Lipsett 2008
Page 14: ENG M 541 Assignment #2 Solutions c MG Lipsett 2008
Page 15: ENG M 541 Assignment #2 Solutions c MG Lipsett 2008
Page 16: ENG M 541 Assignment #2 Solutions c MG Lipsett 2008
Page 17: ENG M 541 Assignment #2 Solutions c MG Lipsett 2008
Page 18: ENG M 541 Assignment #2 Solutions c MG Lipsett 2008
Page 19: ENG M 541 Assignment #2 Solutions c MG Lipsett 2008