Home > Software engineering >  Vb gauss seidel iteration cycle, cycle statement is what
Vb gauss seidel iteration cycle, cycle statement is what

Time:10-12

Example
Assuming an initial temperature field, first six node temperature are assumed to 0
That started a (I)=0
B (I)=a (I) 'b (I) is used to record store initial temperature compare
Wucha=1
The do while wucha> 0.001 'know error can satisfy the demands of convergence to exit the loop
For I=1 to 6
A (I)=(a (I + 1) + a (I - 1))/2.05 '(I) using a two point temperature constant iterative calculation before and after the
A (5)=a (4)
Wucha=0
Wucha=wucha + (abs (a (I) - b (I)))/7
Loop
Print a (I)


Only program is only a cycle 1 to 6 will be the new a (I) alternative does not go in, can't judge convergence, how to judge the convergence condition (error is less than 0) cycle is over??

CodePudding user response:

http://download.csdn.net/detail/veron_04/3058640
  • Related