Welcome to our community

Be a part of something great, join today!

Numerical analysis,results of methods

evinda

Well-known member
MHB Site Helper
Apr 13, 2013
3,720
Hi!
I have written two codes in matlab,to implement the Jacobi and Gauss Seidel method.Both of the programs should stop either if the number of iterations surpass the maximum number of iterations MAXIT or if one of these conditions/or both of them:

[tex]\left \| x_{k}-x_{k-1} \right \|_{2}[/tex]<ε , [tex]\left \| b-Ax_{k} \right \|_{2}[/tex]<ε

are valid.

Could you give me the results of an example with an initial value [tex] x_{0} [/tex],an array A ,a specific b,a specific MAXIT and a specific small number ε,so I can check my output?
 
Last edited:

evinda

Well-known member
MHB Site Helper
Apr 13, 2013
3,720
If,for example:

A=[3 2 1 5;6 2 1 3;5 5 6 1;1 2 3 9]
[tex]x_{0}[/tex] =[0;0;0;0]
b=[1;2;3;4]
MAXIT=20
ε=0.00001

which should be the solution of x??