Higher Order Finite Difference Schemes for the Heat Eq (Part 5)

Higher Order Finite Difference Schemes for the Heat Eq (Part 5)

Perivious Part: Higher Order Finite Difference Schemes for the Heat Eq (Part 4)

Higher Order Finite Difference Schemes for the Heat Eq (Part 3)

Higher Order Finite Difference Schemes for the Heat Eq (Part 2)

First Part: Higher Order Finite Difference Schemes for the Heat Eq (Part 1)

BTCS

Heat Eq for BTCS can be written as

(1)   \begin{equation*} w_i^{m+1}=w_i^m+ r (w_{i+1}^{m+1}-2w_i^{m+1}+w_{i-1}^{m+1})\end{equation*}


By using

(2)   \begin{equation*} w(x, t) = \sum_{k=0}^{\infty} A_k(t)e^{ikx} \end{equation*}


Equation (1) will become

(3)   \begin{equation*} A^{m+1}=A^m + r (e^{-ik \Delta x} - 2 + e^{ik \Delta x}) A^{m+1}\end{equation*}


Since cos(k \Delta x)= \frac{e^{-ik \Delta x} + e^{ik \Delta x}}{2}, so we can write

(4)   \begin{equation*} A^{m+1}=A^m + 2 r (cos (k \Delta x) -1) A^{m+1} \end{equation*}

(5)   \begin{equation*} [1 + 4 r sin^2 (\dfrac{k \Delta x}{2})] A^{m+1}= A^m \end{equation*}

(6)   \begin{equation*} A^{m+1}= [1 + 4 r sin^2 (\dfrac{k \Delta x}{2})]^{-1} A^m \end{equation*}


So, the amplitude A is

(7)   \begin{equation*} A=[1 + 4 r sin^2 (\dfrac{k \Delta x}{2})]^{-1} \end{equation*}


which satisfies |A|\leq 1 for all values of r, k and \Delta x. So the scheme is unconditionally stable.

Crank-Nicolson

For Crank-Nicolson, heat Eq will be

(8)   \begin{equation*} w_i^{m+1}=w_i^m+ \dfrac{r}{2}[ (w_{i+1}^m-2w_i^m+w_{i-1}^m)+(w_{i+1}^{m+1}-2w_i^{m+1}+w_{i-1}^{m+1})]\end{equation*}

By using

(9)   \begin{equation*} w(x, t) = \sum_{k=0}^{\infty} A_k(t)e^{ikx} \end{equation*}


Equation (8) will become

(10)   \begin{equation*} A^{m+1}=A^m + \dfrac{r}{2}[(e^{-ik \Delta x} - 2 + e^{ik \Delta x}) A^{m+1}+ (e^{-ik \Delta x} - 2 + e^{ik \Delta x}) A^{m}] \end{equation*}


Since cos(k \Delta x)= \frac{e^{-ik \Delta x} + e^{ik \Delta x}}{2}, so we can write

(11)   \begin{equation*} [1 - r (cos (k \Delta x) -1)]A^{m+1}=[1 + r (cos (k \Delta x) -1)] A^m \end{equation*}

(12)   \begin{equation*} [1 + 2 r sin^2 (\dfrac{k \Delta x}{2})] A^{m+1}= [1 - 2 r sin^2 (\dfrac{k \Delta x}{2})] A^m \end{equation*}


(13)   \begin{equation*} A^{m+1}= \dfrac{1 - 2 r sin^2 (\dfrac{k \Delta x}{2})} {1 + 2 r sin^2 (\dfrac{k \Delta x}{2})} A^m \end{equation*}


So, the amplitude A is

(14)   \begin{equation*} A=\dfrac{1 - 2 r sin^2 (\dfrac{k \Delta x}{2})} {1 + 2 r sin^2 (\dfrac{k \Delta x}{2})} \end{equation*}


which satisfies |A|\leq 1 for all values of r, k and \Delta x. So this Crank Nicolson scheme is unconditionally stable.

Heat Eq: CN

Adams Basforth Method

For Adams Bashforth method, the heat equation has the form

(15)   \begin{equation*} w_i^{m+1}=w_i^m+ \dfrac{r}{2}[ 3(w_{i+1}^m-2w_i^m+w_{i-1}^m)-(w_{i+1}^{m-1}-2w_i^{m-1}+w_{i-1}^{m-1})]\end{equation*}


By using

(16)   \begin{equation*} w(x, t) = \sum_{k=0}^{\infty} A_k(t)e^{ikx} \end{equation*}


Equation (15) will become

(17)   \begin{equation*} A^{m+1}=A^m + \dfrac{r}{2} [3(e^{-ik \Delta x} - 2 + e^{ik \Delta x}) A^{m}- (e^{-ik \Delta x} - 2 + e^{ik \Delta x}) A^{m-1}] \end{equation*}


Since cos(k \Delta x)= \frac{e^{-ik \Delta x} + e^{ik \Delta x}}{2}, so we can write

(18)   \begin{equation*} A^{m+1}=A^m + 3r (cos (k \Delta x) -1)A^{m}-r (cos (k \Delta x) -1)A^{m-1} \end{equation*}


(19)   \begin{equation*} A^{m+1}+[-1-3r (cos (k \Delta x) -1)]A^{m}+r (cos (k \Delta x) -1)A^{m-1}=0 \end{equation*}


Which is a quadratic equation, where

(20)   \begin{eqnarray*} a=1, \quad b=-[1+3r (cos (k \Delta x) -1)], \quad c= r (cos (k \Delta x) -1) \end{eqnarray*}


Since quadratic formula is

(21)   \begin{equation*} A=\frac{-b\pm \sqrt{b^2-4ac}}{2a} \end{equation*}

Higher Order Finite Difference Schemes for the Heat Eq: Adams Bash fourth and explicit Euler.

The stability of Adams Bashforth and Euler method is discussed in the given figure.
In this figure \Delta x^2 is along x-axis and \alpha \Delta t along y-axis.
From the graphical analysis we see that Adams-Bashforth method stability is much better
then explicit Euler method for fine grids. However for course grids, the stability of
explicit Euler becomes better. In practice, one oftenly requires use of fine grids in order to improve the reliability of numerical schemes, hence Adams Bashforth will be preferred in such cases.

FTCS for three points

The heat equation when discretised using forward finite difference scheme in time and three points central finite difference scheme in space, given as

(22)   \begin{equation*} w_i^{m+2} =4w_i^{m+1}-2r(w_{i-1}^m+w_{i+1}^m)+(4r-3)w_i^m\end{equation*}


By using

(23)   \begin{equation*} w(x,t) = \sum_{k=0}^{\infty} A_k(t)exp(ikx) \end{equation*}


Then equation (22) will become

(24)   \begin{equation*} A^{m+2}=4 A^{m+1}+A^m + r (exp(-ik \Delta x) - 2 + exp(ik \Delta x)) A^m\end{equation*}


(25)   \begin{equation*} A^{m+2}-4 A^{m+1}+(4 r (cos(k\Delta x)-1)+3)A^m=0\end{equation*}


where

(26)   \begin{eqnarray*} a=1, \quad b=-4, \quad c= 4r (cos (k \Delta x) -1)+3 \end{eqnarray*}

Higher Order Finite Difference Schemes for the Heat Eq: FTCS

The quadratic equation (25) can be easily solved on matlab. By using a matlab code we have seen that the graph between \Delta x and \alpha \Delta t is given in the figure. The region under this straight line represents stable domain of the scheme. From the Von Neumann stability analysis of two points formula for FTCS, we have seen that there is a restriction on \Delta t and \Delta x i.e \Delta t \leq \dfrac{ \Delta x^2}{2 \alpha }.
Similarly here stability of FTCS is also depends on the value of \Delta x and \Delta t.
The graph depicts that time discretization possesses maximum value initially, it gradually decreases in the interval 0 < \Delta x^2 <0.5 and vanishes at \Delta x^2=0.5.

BTCS for three points

From heat Eq. we can write

(27)   \begin{equation*} -2rw_{i-1}^m+(3+4r)w_i^{m}-2rw_{i+1}^m=4w_i^{m-1}-w_i^{m-2}\end{equation*}


By using

(28)   \begin{equation*} w(x,t) = \sum_{k=0}^{\infty} A_k(t)exp(ikx) \end{equation*}


Equation (27) will be

(29)   \begin{equation*} -2r (exp(-ik \Delta x)A^m +(3+4r)A^m-2r (exp(ik \Delta x) A^m=4A^{m-1}-A^{m-2} \end{equation*}


(30)   \begin{equation*} [4r(cos(k\Delta x)-1)-3] A^m+4A^{m-1}-A^{m-2}=0\end{equation*}


where

(31)   \begin{eqnarray*} a=4r(cos(k\Delta x)-1)-3, \quad b=4, \quad c=-1. \end{eqnarray*}

Higher Order Finite Difference Schemes for the Heat Eq: BTCS

By using equation (30) a graph has draw in figure above.
This graph has the maximum stability, as the we have the intervals 0 < \Delta x^2 <1 and 0 <\alpha \Delta t<1. If we increase the values then region of stability also increases and remains its maximum position. Which shows that this scheme (BTCS) is unconditionally stable.

Crank-Nicolson

(32)   \begin{equation*} (3+2r)w_i^m-r(w_{i-1}^m+w_{i+1}^m)=r(w_{i-1}^{m-1}+w_{i+1}^{m-1})+2(2-r)w_i^{m-1}-w_i^{m-2}, \end{equation*}


By using

(33)   \begin{equation*} w(x,t) = \sum_{k=0}^{\infty} A_k(t)exp(ikx) \end{equation*}

(34)   \begin{equation*} (3+2r)A^m-r(e^{(-ik \Delta x)} + e^{(ik \Delta x)})A^m=r(e^{(-ik \Delta x)} + e^{(ik \Delta x)})A^{m-1}+2(2-r)A^{m-1}-A^{m-2} \end{equation*}

(35)   \begin{equation*} (3+2r)A^m-2rcos(k\Delta x)A^m-2r cos(k\Delta x) A^{m-1}+2(r-2)A^{m-1}+A^{m-2}=0 \end{equation*}


(36)   \begin{equation*} [3+2r(1-cos(k\Delta x))]A^m+2r[(1- cos(k\Delta x))-4] A^{m-1}+A^{m-2}=0\end{equation*}

From the equation (36) we have draw graph as shown in figure below.
The graph depicts that time discretization has maximum value initially then it decreases to
\Delta x^2=0.1 after that it shows increasing graph. So for greater values of \Delta x^2
we obtain more region for stability.

Higher Order Finite Difference Schemes for the Heat Eq: Crank Nicolson

Conclusion

In this post we have worked on the schemes; Explicit Euler, Implicit Euler, Crank Nicolson and Adams Bashforth method for the solution of the heat equation. For this purpose we have chosen two points in time and three points in space, finite difference approximations and then compare it with the three points in time and three points in space discretization.
The order of the two point schemes is first order in time step but the order of three points schemes is second order in time and space. The results from the three points schemes are more closer to the exact solution as compared to the solution given by the two points schemes. The work includes the schemes of three points in time the two dimensional heat equation.

Thank you for visiting our website ThesisPk.com

Leave a Comment