Higher Order Finite Difference Schemes (Part 2)

Higher Order Finite Difference Schemes for the Heat Equation

Higher Order Finite Difference Schemes for the Heat Equation (Part 1)

Modeling and Analytical solution of Parabolic Equation

The analytical solution of a PDE is not always easy to calculate. We usually use method of separation of variables to obtain the analytical solution of One-dimensional and Two-dimensional heat equation. This process convert the PDE into a set of ODE’s which can be solve to obtain analytical solution. The numerical solution of partial differential can be solved by using different numerical schemes. We used MATLAB to numerically solve heat equation and graph the results.

Heat Conduction Equation

We consider a long strip having homogeneous material and of invariant cross-section and oriented along x-axis. We assume that the strip is possessing thermal insulation and that is sufficiently thin so that heat flows in x-direction only. Temperature w of the strip at any point depends upon x-coordinate and time t. One-dimensional heat equation

(1)   \begin{equation*} \dfrac{\partial w}{\partial t}= \alpha \dfrac{\partial^2 w}{\partial x^2}\end{equation*}

Higher Order Finite Difference Schemes for the Heat Equation (Part 1)

where we have \alpha as a positive constant. In fact \alpha ={\frac {k}{c_{p}\rho }} sometimes called the thermal diffusivity of the strip, where \kappa= represents the thermal conductivity of the of the strip’s material.

The heat equation (1) is first-order in t, which shows that we need only one initial condition at t = 0, with two BCs, to seek a solution that is unique. The IC by which the temperature distribution initially specified in the strip w(x,0)=f(x), and here f(x) is known. Different types of BCs are possible, but we will only use the following;

which means that ends of the strip have constant temperatures T_1 and T_2.

The two dimensional heat conduction equation is

(2)   \begin{equation*} \dfrac{\partial w}{\partial t}= \alpha \big[\dfrac{\partial^2 w}{\partial x^2}+\dfrac{\partial^2 w}{\partial y^2}\big]\end{equation*}

where w(x,y,t) is flat plate’s temperature. We suppose that the plate is thin and the tops of the plate are insulated as well as the bottom surface to avoid the heat flow that happens other than O_{xy} plane. We need initial as well as the BCs to obtain a unique solutions of (1). For example if we have a rectangular plate then the typical BCs could be written as

(3)   \begin{eqnarray*} w(x,0)= T_1 \qquad 0\leq x \leq a\\ \dfrac{\partial w}{\partial x}(a,y)=0 \qquad 0\leq y \leq b\\ w(x,b)= T_2 \qquad 0\leq x \leq a\\ w(0,y)=0 \qquad 0\leq y \leq b \end{eqnarray*}

w(x,y,0) = f (x,y) is an initial condition a given function f(x,y).

Higher Order Finite Difference Schemes for the Heat Equation (Part 1)

The general solution by separation of variables for the above given one-dimensional heat equation with boundary and ICs;

(4)   \begin{eqnarray*} w(0,t)=0= w(L,t)\\w(x,0) =f(x)\end{eqnarray*}


In order to solve this problem using separation of variable, we assume

(5)   \begin{equation*} w(x,t) = X(x)T(t)\end{equation*}

Then the equation (1) becomes

(6)   \begin{equation*} \dfrac{X''(x)}{X}=\dfrac{T'(t)}{ \alpha T}=- \lambda^2\end{equation*}


where \lambda is a constant.
From equation (6) we can write

(7)   \begin{equation*} X''=-\lambda^2 X\end{equation*}


(8)   \begin{equation*} T'=- \alpha \lambda^2 T\end{equation*}


The solution of second order ODE (7) in x is given by

(9)   \begin{equation*} X(x)=c_1 sin(\lambda x )+c_2 cos(\lambda x)\end{equation*}


Applying BCs, we get

    \[c_2= 0 \quad and \quad \lambda= \dfrac{n \pi}{L}, \quad where \quad n=1,2,3,\cdots\]


Thus the solution is

(10)   \begin{equation*} X(x)=c_1 sin(\dfrac{n \pi x}{L} ) , \quad for \quad n=1,2,3, \cdots\end{equation*}


The solution of first order ODE (8) in t will be

(11)   \begin{equation*} T(t)=c_3 e^{- \dfrac{ \alpha n^2 \pi^2 t}{L^2}} \qquad n=1,2,3, \cdots\end{equation*}


By the principle of superposition the general solution will be

(12)   \begin{equation*} w(x,t)= \sum_{n=1}^{\infty} c_n sin(\dfrac{n \pi x}{L} ) e^{- \dfrac{ \alpha n^2 \pi^2 t}{L^2}}\end{equation*}

Model Example

Consider the following heat equation with given initial and BCs.

(13)   \begin{equation*} w_t = w_{xx}, \qquad 0 < x < \pi, t > 0,\end{equation*}


    \[w(x,0)= sin(x)+ 3 sin(2x)\]

    \[w(0, t)= 0=w(\pi,t)\]


In order to solve this problem using separation of variable, we assume

(14)   \begin{equation*} w(x,t) = X(x)T(t)\end{equation*}


Equation (13) become

(15)   \begin{equation*}\dfrac{X''(x)}{X}=\dfrac{T'(t)}{T}=- \lambda^2\end{equation*}


where \lambda is a constant.
From equation (15) we can be considered into the following two ordinary differential equations.

(16)   \begin{equation*} X''=-\lambda^2 X\end{equation*}


(17)   \begin{equation*} T'=- \lambda^2 T\end{equation*}


The solution of second order ordinary differential equation (16) in x is given by

(18)   \begin{equation*} X(x)=c_1 sin(\lambda x )+c_2 cos(\lambda x)\end{equation*}


Applying BCs, we get

    \[c_2= 0 \quad and \quad \lambda= {n}\]


where n=1,2,3,\cdots.
Thus, the solution is

    \[\quad X(x)=c_1 sin({n x}), \quad for \quad n=1,2,3, \cdots\]


The solution of first order ODE (17) in t will be

(19)   \begin{equation*} T(t)=c_3 e^{-n^2 t},\quad for \quad n=1,2,3, \cdots\end{equation*}

Higher Order Finite Difference Schemes for the Heat Equation (Part 1)

By the principle of superposition the general solution will be

(20)   \begin{equation*} w(x,t)= \sum_{n=1}^{\infty} c_n sin({nx} ) e^{-n^2 t} \end{equation*}

or

(21)   \begin{equation*}w(x,t)= c_1 sin({ x} ) e^{- t}+ c_2 sin({ 2x} ) e^{- 4t}+c_3 sin({3 x} ) e^{- 9t}+ \cdots\end{equation*}


where c_n is arbitrary constant.
Substitute t=0 for initial conditions,

(22)   \begin{equation*}sin({ x} )+ 3sin({2 x} )= c_1 sin({ x} ) e^{- t}+ c_2 sin({ 2x} ) e^{- 4t}+c_3 sin({3 x} ) e^{- 9t}+ \cdots\end{equation*}

By comparing the coefficients

(23)   \begin{equation*} c_1=1 ,\quad c_2=3, \quad c_k=0,\quad for \quad k\geq 3. \end{equation*}


So, the final solution will be

(24)   \begin{equation*} w(x,t)=sin({ x} ) e^{- t}+ 3 sin({ 2x} ) e^{- 4t}\end{equation*}

To find the error-free solution of a PDE is a challenging problem. Till now mathematics do not give a closed form solution, and more refinements in solutions are yet to come. Many numerical techniques have been developed for solving PDE’s. We will discuss some of these numerical techniques in this post. The finite difference approximation is used to numerically approximate the solution w(x,t) of heat equation (1).

ThesisPk.com

Higher Order Finite Difference Schemes for the Heat Equation

Leave a Comment