# 2D Poisson equation. Weighted Jacobi relaxation

 n it ω This GPU based script draws 10 cross-sections ui,n/2 after every 2it weighted Jacobi iterations. fi,j = sin(πi/n) sin(πj/n).
We consider 2D Poisson equation with fixed borders uborder = 0
Δu(x,y) = f(x,y).
On square n×n grid we get
ui-1,j + ui+1,j + ui,j-1 + ui,j+1 - 4ui = h2fi,j.
Weighted Jacobi iterations are
ui,jnew = (1 - ω)ui,j + ω(ui-1,j + ui+1,j + ui,j-1 + ui,j+1 - h2fi,j )/4     (*)
Transformation (*) has eigenvectors (we put fi,j = 0)
ui,j(m,k) = sin(πmi/n) sin(πkj/n)
with eigenvalues
λm,k = 1 - ω (sin2πm/2n + sin2πk/2n),
λn,n = 1 - 2ω,   λn/2,n/2 = λ0,n = 1 - ω,   λ0,n/2 = 1 - ω/2
.
From n,n| = |λ0,n/2| we get ω = 4/5 and λ0,n/2 = 3/5.
At last for small m,k we get approximately
λm,k = 1 - ωπ2(m2 + k2)/4n2,
so relaxation is very slow for long wave harmonics. As since convergence is faster for small n we need coarse grids to accelerate relaxation. We consider multigrid algorithm next.
Simulations on GPU     updated 6 Aug 2012