0% found this document useful (0 votes)
41 views14 pages

PDE Problems & Solutions

Here are the steps to solve this problem using the Crank-Nicolson scheme: 1. Discretize the space and time domains into grids with spacing h = 0.25 and k = 0.04. 2. Derive the Crank-Nicolson scheme using central difference approximations for the spatial and backward difference for the time derivative. 3. Implement the Crank-Nicolson scheme iteratively to obtain the numerical solution at each grid point and time level. 4. Compute the absolute percentage error between the numerical and analytical solutions at t = 0.12.
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)
41 views14 pages

PDE Problems & Solutions

Here are the steps to solve this problem using the Crank-Nicolson scheme: 1. Discretize the space and time domains into grids with spacing h = 0.25 and k = 0.04. 2. Derive the Crank-Nicolson scheme using central difference approximations for the spatial and backward difference for the time derivative. 3. Implement the Crank-Nicolson scheme iteratively to obtain the numerical solution at each grid point and time level. 4. Compute the absolute percentage error between the numerical and analytical solutions at t = 0.12.
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/ 14

3

4. One dimensional diffusion equation is given by


∂ u(x,t) ∂ 2 u(x,t)
= α2 ; t > 0, 0 ≤ x ≤ l
∂t ∂ x2
Where α ∈ R.
i Using finite central difference approximation for spatial derivative with sub-
interval size h and back-ward difference approximation for time derivative
with sub-interval size k, obtain the scheme of Crank-Nicolson in the form,
−λ ui−1, j + (1 + 2λ )ui, j − λ ui+1, j = ui, j−1
α 2k
Where λ = h2
(7 marks)
ii a) Use the above derived Crank-Nicolson scheme to solve the following
problem where sizes of space and time sub-intervals are h = 0.5 and
k = 0.05,respectively.

∂ u(x,t) ∂ 2 u(x,t)
= ; 0 ≤ t ≤ 0.1, 0 ≤ x ≤ 2
∂t ∂ x2
Where
u(0,t) = u(2,t) = 0
 πx 
u(x, 0) = sin
2
(13 marks)
b) Find the absolute percentage errors of your numerical solution at t = 0.05
where the corresponding analytical solution is given as,
π2
 πx 
u(x,t) = e− 4 t sin
2
(5 marks)
(Total marks:25)
End of Question Paper
4

4.
One dimensional diffusion equation is given by
∂ u(x,t) ∂ 2 u(x,t)
= α2 ; t > 0, 0 ≤ x ≤ l
∂t ∂ x2
Where α ∈ R.
i Using the finite central difference approximation for spatial derivative with
sub-interval size h and back-ward difference approximation for time derivative
with sub-interval size k, obtain the Crank-Nicolson numerical scheme.
(5 marks)
ii
a) Use the above derived Crank-Nicolson scheme to solve the following
problem where the sizes of space and time sub-intervals are h = 0.25 and
k = 0.05,respectively.

∂ u(x,t) 1 ∂ 2 u(x,t)
= ; 0 ≤ t ≤ 0.1, 0 ≤ x ≤ 1
∂t 16 ∂ x2
Where
u(0,t) = u(1,t) = 0
u(x, 0) = 2 sin(2πx)
(15 marks)
b) Find the absolute percentage errors of your numerical solution at t = 0.05
where the corresponding analytical solution is given as,
2
u(x,t) = 2e−0.25π t sin(2πx)
(5 marks)
(Total marks:25)
End of Question Paper
1

1. i Use the above derived Crank-Nicolson scheme to solve the following prob-
lem where the sizes of space and time sub-intervals are h = 0.25 and k =
0.04,respectively.

∂ u(x,t) 1 ∂ 2 u(x,t)
= ;t > 0, 0 ≤ x ≤ 1
∂t π ∂ x2
Where
u(0,t) = u(1,t) = 0
1
u(x, 0) = cos π(x − )
2
ii Find the absolute percentage errors of your numerical solution at t = 0.12
where the corresponding analytical solution is given as,
1
u(x,t) = e−t cos π(x − )
2

You might also like