Finite Difference Method To Solve The
Finite Difference Method To Solve The
Finite Difference Method To Solve The
SAHIWAL
AFFILIATED WITH
UNIVERSITY OF ENGINEERING AND TECHNOLOGY LAHORE
SUBJECT:
NUMERICAL ANYLISIS LAB(MA-240)
TOPIC:
FINITE DIFF METHOD FOR PDE’s
SUBMITTED BY:
USMAN MUHEEB [2019-UET-QET-SWL-CIVIL-68]
• Laplace
solve all at once for steady state conditions
• Parabolic
(heat) and Hyperbolic (wave) equations. Integrate initial conditions forward through
time.
Methods:
Solving PDE's:
∂2 U ∂2 U ∂U ∂U
2 + 2 = -D( x, y, u, + )
∂x ∂y ∂x ∂y
Problem:
Consider the isothermal packed-bed reactor. The governing differential equation
1 d2 y dy
Np dx 2 + dx
R y n= g(x)
1 d y ( 0)
y 0 (0) = 0, y(1) + N =1
p dx
Maximum absolute errors in both y and y 0 for different values of Npe, order n of reaction and
the range of values of R with the exact solution
2 3
y(x) = N pe e (x − x ) /( N pe − 1.0)
Results:
h
8 16 32 64 128 256
y .116733(-1) .339170(-2) .931260(-3) .245032(-3) .629093(-4) .159420(-4)
y’ .309695(-1) .828688(-2) .269651(-2) .753022(-3) .198104(-3) .507542(-4)
N = 2, R = 1/8, Npe = 2
y .136306(1) .402905(-2) .111447(-3) .294187(-3) .756419(-4) .191822(-4)
y’ .31777(1) .777896(-2) .251621(-3) .704275(-3) .185440(-4) .475274(-4)
Coding:
end
figure(2); mesh(X,Y,U); hold on
figure(3);plot(X,U(j,:)); hold on
for j=2:M
for i=2:N
numsol(j,i)=U(j,i);
end
end
%%
Flowchart: