Académique Documents
Professionnel Documents
Culture Documents
University of Babylon
Subject : Fortran 90
College of Engineering
Now to find xi s, one assumes an initial guess for the xi s and then uses the
rewritten equations to calculate the new estimates. Remember, one always
uses the most recent estimates to calculate the next estimates, xi . At the end
of
each
iteration, one calculates the
absolute
relative approximate error for each
xi as
Where new i x is the recently obtained value of xi , and old xi is the previous
value of xi . When the absolute relative approximate error for each xi is less
than the pre-specified tolerance, the iterations are stopped.
GAUSS-SEIDEL
SEIDEL CONVERGENCE THEOREM:
If A is diagonally dominant, then the Gauss-Seidel
Gauss
method converges for any
starting vector x. A sufficient, but not necessary condition.
For all i
Use x1=1 , x2=0 , and x3=1 as the initial guess and conduct two iterations.
Solution
is diagonally dominant as
Iteration 1
The absolute relative approximate error at the end of the first iteration is
s=0
do j=1,n
if(i.ne.j)s=s+abs(a(i,j
if(i.ne.j)s=s+abs(a(i,j))
enddo
if(abs(a(i,i)).lt.s)then
write(*,*) "these equtions are not diagonal-dominance
diagonal
stop
endif ;
enddo
do i=1,n
dummy=a(i,i)
do j=1,n
a(i,j)=a(i,j)/dummy
enddo
c(i)=c(i)/dummy
k=0
enddo
iter=0