![]() of Unsteady Gauss-Seidel Iterations(IMPLICIT) = %d', Gauss_Seidel_iteration)) pause(0. %Calculation of 2D steady heat conduction EQUATION by Gauss-seidel methodįor k = 1:nt error = 9e9 while(error > tolerance) for i = 2:nx - 1 for j = 2:ny - 1 T(i,j)= T_intial(i,j).*(1-4*A) + A *(T(i-1,j)+ T_old(i+1,j)+T(i,j+1)+T_old(i,j-1)) end end error = max(max(abs(T_old - T))) T_old = T Gauss_Seidel_iteration = Gauss_Seidel_iteration + 1 end T_intial = T %Plotting figure(1) contourf(x,y,T) clabel(contourf(x,y,T)) colorbar colormap(jet) set(gca, 'ydir', 'reverse') xlabel('X-Axis') ylabel('Y-Axis') title(sprintf('No. %Calculating Average temperature at corners %Solving the Unsteady state 2D heat conduction by Gauss Seidel Method(IMPLICIT SCHEME) This program implements GaussSeidel Method in python programming language. I found optimum omega values with GAuss-Seidel (here I am showing this for XX part of the conductivity. ![]() ![]() This method is also known as Liebmann method or the method of successive displacement. For the SOR, you need a parameter called omega. I Wrote the code for 2d unsteady state using jacobi method. 2 lines (2 sloc) 368 Bytes Raw Blame Gauss-Seidel-Method-Python GaussSeidel method is an iterative method to solve a set of linear equations and very much similar to Jacobi's method. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |