0% found this document useful (0 votes)
23 views33 pages

08 Numerical Solution of Elliptic PDEs

Uploaded by

mohameed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views33 pages

08 Numerical Solution of Elliptic PDEs

Uploaded by

mohameed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

Numerical Solution of Elliptic

PDEs
Mostafa Abobaker 2018
Figure: Efficient method is needed for solution of such systems of equations! Nine point
approximation in 2D has 9-diagonal matrix!
1. Jacoby Method
• Solution techniques are either direct or iterative.
• Direct methods give theoretically exact solutions, but for large
system truncation error becomes significant. Time to solve
such system also increases with 𝒃𝟐 . n! (Gauss method)
• Iterative methods are approximate in nature, slower, but
each new iteration improves it ancestor, at end it gives more
accurate results for large system of equations than direct
methods, since number of operations per iteration is
relatively small.
Jacoby Method
Jacoby Method
Jacoby Method
Jacoby Method
Jacoby Method
Jacoby Method
Jacoby Method

We use two
matrices u(k) and
u(k+1)
2. Gauss-Seidel Method
• Only one u matrix is used.
• As soon as some value is calculated it is available for use in calculations of
other values.
• This method is twice as fast as Jacoby method.
Gauss-Seidel Method

For j-1 and i-1 which was


already calculated (k+1) :
we use them immediately
for u(I,j,k+1)
Gauss-Seidel Method
3- Gauss-Seidel Over-relaxation Method

Figure: How to accelerate solution procedure without physical grounds?


Gauss-Seidel Over-relaxation Method
Gauss-Seidel Over-relaxation Method
4- Line Gauss-Seidel Method
Line Gauss-Seidel Method
Line Gauss-Seidel Method
5. Alternate Direction Method (ADI)
Method combines implicit sweeps in both matrix directions (i , j ).
Alternate Direction Method (ADI)
Example
• Homogeneous plate of width a = 2 m and height b = 1 m is exposed to
fixed temperatures on its sides. Determine stationary temperature
distribution inside the plate, if coefficient 𝛼 = 1.
Apply Gauss-Seidel over-relaxation method. Apply 𝐿2 norm as a criteria for
convergence 𝜀 ≤ 0.01. Use the following steps in space
∆𝑥 = ∆𝑦 = 0.05.

a=2; b=1;
T1=100 C
T2=100 C
T3=100 C
T4=0 C
Example
Example
Problem code
• a=2;b=1;Dx=0.05;Dy=Dx;epsmax=0.01;
• T1=100;T2=100;T3=100;T4=0;omega=1.8;
• Nx=round(a/Dx)+1;
• Ny=round(b/Dy)+1;
• bet=Dy/Dx;
• T(1:Ny,1:Nx)=0;
• % GRU
• for i = 1:Nx % note that T (y,x) === T(j,i)
• T(1,i)=T3;
• T(Ny,i)=T1;
• end
• for j=1:Ny
• T(j,1) = T4;
• T(j,Nx)=T2;
• end
Problem code pp2
• epsi=10*epsmax;
• iter=0;
• while epsi>=epsmax
• epsi = 0.0;
• for i=2:Nx-1
• for j=2:Ny-1
• DT = (bet^2*(T(j,i+1)+T(j,i-1))+T(j+1,i)+T(j-1,i))...
• /(2*(1+bet^2)) - T(j,i);
• epsi = epsi+DT^2;
• T(j,i)=T(j,i)+omega*DT;
• end
• end
• iter=iter+1;
• disp([iter, epsi])
• end
• surf(T), shading interp

You might also like