uwhpsc-2016 / homework2

Homework #2
0 stars 3 forks source link

General question regarding Gauss Seidel method #40

Open chengdang opened 8 years ago

chengdang commented 8 years ago

In HW1 exercise #3, we solved Ax=b using Gauss Seidel method, by reorganizing the system into (D+U) * x_k1 = b - L * x_k, backward substitution

But usually (from classes I have had), to implement Gauss_Seidel iteration (e.g. http://www.maa.org/press/periodicals/loci/joma/iterative-methods-for-solving-iaxi-ibi-gauss-seidel-method), the x_k1[i] calculated at each step will be used to calculate x_k1[i+1], which means the LHS needs to be a lower triangular matrix. (D+L) * x_k1 = b - U * x_k, forward substitution

It seems okay to do either way, but in term of programming or math, is there any difference? For HW#2, would either method be okay?

mvelegar commented 8 years ago

Either method will be OK for Homework 2, our tests will pass either way. There is really no difference in terms of "Math", in terms of programming only difference is back vs forward substitution as you pointed out. Your iterations will be different, but either way it will converge to the (unique) solution