Solve Poissons Equation using 5-Point Stencil with SOR method
Solution Poisson's Equation In a Rectangular Domain Using 5-Point Stencil
Poisson's equation in a square domain 0≤x,y≤1 with source term given by q(x)=100∗sin(πx)∗sin(πy). The boundaries of the domain are maintained at u=0. Determine the solution using finite difference method.
Solution:
Discretizing domain uniformly with step size h and k along x and y direction. Using five point stencil, equation at each node is given by
ui+1,j−2ui,j+ui−1,jh2+ui,j+1−2ui,j+ui,j−1k2=−q(i,j)
ui,j=12h2+2k2(ui+1,j+ui−1,jh2+ui,j+1+ui,j−1k2+q(i,j))
where q(i,j)=100∗sin(πxi)∗sin(πyj)
Here a MATLAB code is given below. Choosen m=n=11 grid to solve the problem using SOR (successive overrelaxation).
Mathematica Code:
- In this algorithm, changing the value of sor=1 gives the "Gauss-Seidel iteration", and sor=0 gives "Jacobi iteration" and 1<sor<2 gives the "successive overrelaxation result(SOR)".
- The successive overrelaxation method generally used for elliptical pdes.
Comments
Post a Comment
If you have any doubts, please let me know!