Nonlinear finite elements/Solution of heat equation

Finite element solution for the Heat equation

Let us now try to create a finite element approximation for the variational initial boundary value problem for the heat equation . This problem can be stated as

{\displaystyle {\begin{aligned}&{\mathsf {Variational~IBVP~for~the~Heat~Equation}}\\&\\{\text{Find a function}}&~T(t)\in {\mathcal {S}}_{t},t\in [0,\tau ]~{\text{such that for all}}~w\in {\mathcal {V}}\\&\\&\int _{\Omega }\left(\rho ~C_{v}~{\frac {\partial T}{\partial t}}\right)~w~dV+\int _{\Omega }({\boldsymbol {\nabla }}w)\bullet ({\boldsymbol {\kappa }}\bullet {\boldsymbol {\nabla }}T)~dV=\int _{\Omega }s~w~dV-\int _{\Gamma _{q}}w~{\overline {q}}~dA\\&\int _{\Omega }w~\rho ~C_{v}~T(0)~dV=\int _{\Omega }w~\rho ~C_{v}~T_{0}~dV~.\end{aligned}}}


Let ${\displaystyle {\mathcal {V}}_{h}}$ be a finite dimensional approximation to ${\displaystyle {\mathcal {V}}}$ and let ${\displaystyle {\mathcal {S}}_{h}}$ be a finite dimensional approximation to ${\displaystyle {\mathcal {S}}}$. Let the weighting functions ${\displaystyle w_{h}\in {\mathcal {V}}_{h}}$ be such that ${\displaystyle w_{h}=0}$ on ${\displaystyle \Gamma _{T}}$. Similarly, any other function ${\displaystyle v_{h}\in {\mathcal {V}}_{h}}$ also goes to zero on the boundary ${\displaystyle \Gamma _{T}}$.

Assume that the trial solutions ${\displaystyle T_{h}\in {\mathcal {S}}_{h}}$ can be represented as

${\displaystyle T_{h}=v_{h}+{\overline {T}}_{h}~~~~~{\text{where}}~v_{h}\in {\mathcal {V}}_{h}~.}$

The additional quantity ${\displaystyle {\overline {T}}_{h}}$ results in the satisfaction of the boundary condition ${\displaystyle T={\overline {T}}}$ on ${\displaystyle \Gamma _{T}}$.

If we substitute these quantities into the variational initial boundary value problem, we get the Galerkin formulation. The steps in this process are shown below.

Approximate IBVP

The approximate form of the variational IBVP is

${\displaystyle \int _{\Omega }\left(\rho ~C_{v}~{\frac {\partial T_{h}}{\partial t}}\right)~w_{h}~dV+\int _{\Omega }({\boldsymbol {\nabla }}w_{h})\bullet ({\boldsymbol {\kappa }}\bullet {\boldsymbol {\nabla }}T_{h})~dV=\int _{\Omega }s~w_{h}~dV-\int _{\Gamma _{q}}w_{h}~{\overline {q}}~dA~.}$

Replacing ${\displaystyle T_{h}}$ with ${\displaystyle (v_{h}+{\overline {T}}_{h})}$ we get

${\displaystyle \int _{\Omega }\left(\rho ~C_{v}~{\frac {\partial (v_{h}+{\overline {T}}_{h})}{\partial t}}\right)~w_{h}~dV+\int _{\Omega }({\boldsymbol {\nabla }}w_{h})\bullet ({\boldsymbol {\kappa }}\bullet {\boldsymbol {\nabla }}(v_{h}+{\overline {T}}_{h}))~dV=\int _{\Omega }s~w_{h}~dV-\int _{\Gamma _{q}}w_{h}~{\overline {q}}~dA~.}$

After expanding and rearranging terms, we get

{\displaystyle {\begin{aligned}\int _{\Omega }w_{h}~\rho ~C_{v}~{\frac {\partial v_{h}}{\partial t}}~dV+\int _{\Omega }({\boldsymbol {\nabla }}w_{h})\bullet ({\boldsymbol {\kappa }}\bullet {\boldsymbol {\nabla }}v_{h})~dV=&\int _{\Omega }w_{h}~s~dV-\int _{\Gamma _{q}}w_{h}~{\overline {q}}~dA\\&-\int _{\Omega }w_{h}~\rho ~C_{v}~{\frac {\partial {\overline {T}}_{h}}{\partial t}}~dV-\int _{\Omega }({\boldsymbol {\nabla }}w_{h})\bullet ({\boldsymbol {\kappa }}\bullet {\boldsymbol {\nabla }}{\overline {T}}_{h})~dV~.\end{aligned}}}

In compact notation

${\displaystyle \langle w_{h},~\rho ~C_{v}~{\dot {v}}\rangle _{h}+a(w_{h},~v_{h})=\langle w_{h},~s\rangle -\langle w_{h},~{\overline {q}}\rangle _{\Gamma }-\langle w_{h},~\rho ~C_{v}~{\dot {\overline {T}}}\rangle _{h}-a(w_{h},~{\overline {T}}_{h})~.}$

Similarly, the initial condition can be written as

${\displaystyle \int _{\Omega }w_{h}~\rho ~C_{v}~T_{h}(0)~dV=\int _{\Omega }w_{h}~\rho ~C_{v}~T_{0}~dV~.}$

Substituting for ${\displaystyle T_{h}}$ and expanding out terms, we have

${\displaystyle \int _{\Omega }w_{h}~\rho ~C_{v}~v_{h}(0)~dV=\int _{\Omega }w_{h}~\rho ~C_{v}~T_{0}~dV-\int _{\Omega }w_{h}~\rho ~C_{v}~{\overline {T}}_{h}(0)~dV~.}$

In compact form,

${\displaystyle \langle w_{h},~\rho ~C_{v}~v_{h}(0)\rangle =\langle w_{h},~\rho ~C_{v}~T_{0}\rangle -\langle w_{h},~\rho ~C_{v}~{\overline {T}}_{h}(0)\rangle ~.}$

Therefore the approximate form of the variational BVP can be written as

{\displaystyle {\text{(40)}}\qquad {\begin{aligned}&{\mathsf {Approximate~Variational~IBVP~for~the~Heat~Equation}}\\&\\{\text{Find a function}}&~T_{h}(t)=v_{h}+{\overline {T}}_{h}\in {\mathcal {S}}_{h},t\in [0,\tau ]~{\text{such that for all}}~w_{h}\in {\mathcal {V}}_{h}\\&\\\int _{\Omega }w_{h}~\rho ~C_{v}~{\frac {\partial v_{h}}{\partial t}}~dV&+\int _{\Omega }({\boldsymbol {\nabla }}w_{h})\bullet ({\boldsymbol {\kappa }}\bullet {\boldsymbol {\nabla }}v_{h})~dV=\int _{\Omega }w_{h}~s~dV-\int _{\Gamma _{q}}w_{h}~{\overline {q}}~dA\\&-\int _{\Omega }w_{h}~\rho ~C_{v}~{\frac {\partial {\overline {T}}_{h}}{\partial t}}~dV-\int _{\Omega }({\boldsymbol {\nabla }}w_{h})\bullet ({\boldsymbol {\kappa }}\bullet {\boldsymbol {\nabla }}{\overline {T}}_{h})~dV~.\\\int _{\Omega }w_{h}~\rho ~C_{v}~v_{h}(0)~dV&=\int _{\Omega }w_{h}~\rho ~C_{v}~T_{0}~dV-\int _{\Omega }w_{h}~\rho ~C_{v}~{\overline {T}}_{h}(0)~dV~.\end{aligned}}}


Note that the derivatives with respect to time are still continuous in this approximate variational BVP.

Finite element approximation

We now discretize our domain into elements ${\displaystyle \Omega _{e}}$ where ${\displaystyle 1 and ${\displaystyle E}$ is the total number of elements. Nodes may exist anywhere within the element domains. But the most common locations are at the element vertices and along the interelement boundaries.

Let the set of global node numbers be

${\displaystyle \eta =\{1,2,\dots ,N\}~.}$

Let the set nodes at which a temperature (essential BC) is prescribed be

${\displaystyle \eta ^{T}\subset \eta ~.}$

Then the set of nodes at which a temperature is to be determined is the complement

${\displaystyle \eta -\eta ^{T}~.}$

Let ${\displaystyle n}$ be the number of nodes in ${\displaystyle \eta -\eta ^{T}}$. Then the number of equations to be solved is also ${\displaystyle n}$. See Figure 1 to get an idea about what these sets of nodes refer to.

 Figure 1. FEM discretization for the heat conduction problem.

As we have seen before, a typical weighting function ${\displaystyle w_{h}\in {\mathcal {V}}_{h}}$ is assumed to have the form

${\displaystyle {\text{(42)}}\qquad {w_{h}(\mathbf {x} )=\sum _{i=1}^{n}b_{i}N_{i}(\mathbf {x} )\equiv \sum _{i\in \eta -\eta ^{T}}b_{i}N_{i}(\mathbf {x} )~.}}$

Note that ${\displaystyle w_{h}=0}$ only if ${\displaystyle b_{i}=0}$ for every ${\displaystyle i\in \eta -\eta ^{T}}$. On the other hand ${\displaystyle w_{h}=0}$ for every node in ${\displaystyle \eta ^{T}}$.

Similarly, a typical trial solution ${\displaystyle v_{h}\in {\mathcal {V}}_{h}}$ can be written as

${\displaystyle {\text{(43)}}\qquad {v_{h}(\mathbf {x} ,t)=\sum _{i\in \eta -\eta ^{T}}T_{i}(t)N_{i}(\mathbf {x} )}}$

where ${\displaystyle T_{i}(t)}$ is the unknown temperature at node ${\displaystyle i}$ at time ${\displaystyle t}$.

We also often represent the approximate form of the essential BCs in a similar way, i.e.,

${\displaystyle {\text{(44)}}\qquad {{\overline {T}}_{h}(\mathbf {x} ,t)=\sum _{i\in \eta ^{T}}{\overline {T}}_{i}(t)N_{i}(\mathbf {x} ),\qquad {\overline {T}}_{i}(t)={\overline {T}}(\mathbf {x} _{i},t)~.}}$

Substitute equations (42), (43), and (44) into the first of equations (40). You will get

{\displaystyle {\begin{aligned}\int _{\Omega }\left(\sum _{j}b_{j}N_{j}\right)~&\rho ~C_{v}~\left(\sum _{i}{\frac {\partial T_{i}}{\partial t}}N_{i}\right)~dV+\int _{\Omega }\left(\sum _{j}b_{j}{\boldsymbol {\nabla }}N_{j}\right)\bullet \left[\sum _{i}T_{i}\left({\boldsymbol {\kappa }}\bullet {\boldsymbol {\nabla }}N_{i}\right)\right]~dV=\\&\int _{\Omega }\left(\sum _{j}b_{j}N_{j}\right)~s~dV-\int _{\Gamma _{q}}\left(\sum _{j}b_{j}N_{j}\right)~{\overline {q}}~dA\\&-\int _{\Omega }\left(\sum _{j}b_{j}N_{j}\right)~\rho ~C_{v}~\left(\sum _{k}{\frac {\partial {\overline {T}}_{k}}{\partial t}}N_{k}\right)~dV\\&-\int _{\Omega }\left(\sum _{j}b_{j}{\boldsymbol {\nabla }}N_{j}\right)\bullet \left[\sum _{k}{\overline {T}}_{k}\left({\boldsymbol {\kappa }}\bullet {\boldsymbol {\nabla }}N_{k}\right)\right]~dV,\qquad i,j\in \eta -\eta ^{T},\quad k\in \eta ^{T}~.\end{aligned}}}

Assuming that ${\displaystyle \Omega }$ does not change with time, we can take the constants and time-dependent parameters outside the integrals to get

{\displaystyle {\begin{aligned}\sum _{j}b_{j}&\left[\sum _{i}{\frac {\partial T_{i}}{\partial t}}\left(\int _{\Omega }\rho ~C_{v}~N_{i}~N_{j}~dV\right)+\sum _{i}T_{i}\left(\int _{\Omega }{\boldsymbol {\nabla }}N_{j}\bullet ({\boldsymbol {\kappa }}\bullet {\boldsymbol {\nabla }}N_{i})~dV\right)\right]=\\&\sum _{j}b_{j}\left[\int _{\Omega }N_{j}~s~dV-\int _{\Gamma _{q}}N_{j}~{\overline {q}}~dA-\sum _{k}{\frac {\partial {\overline {T}}_{k}}{\partial t}}\left(\int _{\Omega }\rho ~C_{v}~N_{j}~N_{k}~dV\right)\right.\\&-\left.\sum _{k}{\overline {T}}_{k}\left(\int _{\Omega }{\boldsymbol {\nabla }}N_{j}\bullet ({\boldsymbol {\kappa }}\bullet {\boldsymbol {\nabla }}N_{k})~dV\right)\right],\qquad i,j\in \eta -\eta ^{T},\quad k\in \eta ^{T}~.\end{aligned}}}

Using the usual argument about the arbitrary nature of ${\displaystyle b_{j}}$, we get

{\displaystyle {\begin{aligned}\sum _{i}&{\frac {\partial T_{i}}{\partial t}}\left(\int _{\Omega }\rho ~C_{v}~N_{i}~N_{j}~dV\right)+\sum _{i}T_{i}\left(\int _{\Omega }{\boldsymbol {\nabla }}N_{j}\bullet ({\boldsymbol {\kappa }}\bullet {\boldsymbol {\nabla }}N_{i})~dV\right)=\\&\int _{\Omega }N_{j}~s~dV-\int _{\Gamma _{q}}N_{j}~{\overline {q}}~dA-\sum _{k}{\frac {\partial {\overline {T}}_{k}}{\partial t}}\left(\int _{\Omega }\rho ~C_{v}~N_{j}~N_{k}~dV\right)\\&-\sum _{k}{\overline {T}}_{k}\left(\int _{\Omega }{\boldsymbol {\nabla }}N_{j}\bullet ({\boldsymbol {\kappa }}\bullet {\boldsymbol {\nabla }}N_{k})~dV\right),\qquad i,j\in \eta -\eta ^{T},\quad k\in \eta ^{T}~.\end{aligned}}}

In compact notation,

${\displaystyle {\sum _{i}\langle N_{j},~\rho C_{v}N_{i}\rangle ~{\dot {T_{i}}}+\sum _{i}a(N_{j},N_{i})~T_{i}=\langle N_{j},~s\rangle -\langle N_{j},~{\overline {q}}\rangle _{\Gamma }-\sum _{k}\langle N_{j},~\rho C_{v}N_{k}\rangle ~{\dot {\overline {T}}}_{k}-\sum _{k}a(N_{j},N_{k})~{\overline {T}}_{k}}}$

where ${\displaystyle i,j\in \eta -\eta ^{T}}$, and ${\displaystyle k\in \eta ^{T}}$.

Let us rename parts of the above equation as follows:

{\displaystyle {\begin{aligned}M_{ij}&:=\langle N_{i},~\rho C_{v}N_{j}\rangle \\K_{ij}&:=a(N_{i},N_{j})\\f_{j}&:=\langle N_{j},~s\rangle -\langle N_{j},~{\overline {q}}\rangle _{\Gamma }-\sum _{k}\langle N_{j},~\rho C_{v}N_{k}\rangle ~{\dot {\overline {T}}}_{k}-\sum _{k}a(N_{j},N_{k})~{\overline {T}}_{k}~.\end{aligned}}}

Then we get

${\displaystyle {\sum _{i}M_{ji}~{\dot {T_{i}}}+\sum _{i}K_{ji}~T_{i}=f_{j}~.}}$

In matrix form,

${\displaystyle {\text{(45)}}\qquad {\mathbf {M} ~{\dot {\mathbf {T} }}+\mathbf {K} ~\mathbf {T} =\mathbf {f} ~.}}$

As before, we can break up the global matrices into sums over elements. Thus,

{\displaystyle {\begin{aligned}\mathbf {M} &=\sum _{e=1}^{E}\mathbf {M} ^{e}\\\mathbf {K} &=\sum _{e=1}^{E}\mathbf {K} ^{e}\\\mathbf {f} &=\sum _{e=1}^{E}\mathbf {f} ^{e}\end{aligned}}}

where

{\displaystyle {\begin{aligned}M_{ij}^{e}&=\int _{\Omega ^{e}}\rho ~C_{v}~N_{i}~N_{j}~dV~,\\K_{ij}^{e}&=\int _{\Omega ^{e}}{\boldsymbol {\nabla }}N_{i}\bullet ({\boldsymbol {\kappa }}\bullet {\boldsymbol {\nabla }}N_{j})~dV\equiv \int _{\Omega ^{e}}\mathbf {B} _{i}^{T}~\mathbf {D} ~\mathbf {B} _{j}~dV~,\\f_{j}^{e}&=\int _{\Omega ^{e}}N_{j}~s~dV-\int _{\Gamma _{q}^{e}}N_{j}~{\overline {q}}~dA-\sum _{k=1}^{n^{e}}\left[M_{jk}^{e}{\dot {\overline {T}}}_{k}-K_{jk}^{e}{\overline {T}}_{k}\right]\end{aligned}}}

and ${\displaystyle n^{e}}$ is the number of nodes in an element.

We can do the same for the initial conditions. However, a more common approach is to specify the values of ${\displaystyle \mathbf {T} _{0}}$ directly at the nodes instead of going through an assembly process.

Computing ${\displaystyle \mathbf {M} }$, ${\displaystyle \mathbf {K} }$, ${\displaystyle \mathbf {f} }$

The finite element system of equations at time ${\displaystyle t}$:

{\displaystyle {\begin{aligned}M_{ij}^{e}&=\int _{\Omega ^{e}}\rho ~C_{v}~N_{i}~N_{j}~dV~,\\K_{ij}^{e}&=\int _{\Omega ^{e}}{\boldsymbol {\nabla }}N_{i}\bullet ({{\boldsymbol {\kappa }}\bullet {{\boldsymbol {\nabla }}N_{j}})}~dV\equiv \int _{\Omega ^{e}}\mathbf {B} _{i}^{T}~\mathbf {D} ~\mathbf {B} _{j}~dV~,\\f_{j}^{e}&=\int _{\Omega ^{e}}N_{j}~s~dV-\int _{\Gamma _{q}^{e}}N_{j}~{\overline {q}}~dA-\sum _{k=1}^{n^{e}}\left[M_{jk}^{e}{\dot {\overline {T}}}_{k}-K_{jk}^{e}{\overline {T}}_{k}\right]\end{aligned}}}

Isoparametric Map

 Isoparametric map.

Coordinate Transformation

{\displaystyle {\begin{aligned}x&=x_{1}^{e}~N_{1}^{e}(\xi ,\eta )+x_{2}^{e}~N_{2}^{e}(\xi ,\eta )+x_{3}^{e}~N_{3}^{e}(\xi ,\eta )+x_{4}^{e}~N_{4}^{e}(\xi ,\eta )\\&\\y&=y_{1}^{e}~N_{1}^{e}(\xi ,\eta )+y_{2}^{e}~N_{2}^{e}(\xi ,\eta )+y_{3}^{e}~N_{3}^{e}(\xi ,\eta )+y_{4}^{e}~N_{4}^{e}(\xi ,\eta )\end{aligned}}}

Integrating Stiffness Matrix

Stiffness matrix terms:

${\displaystyle K_{ij}^{e}=\int _{\Omega ^{e}}{\boldsymbol {\nabla }}N_{i}\bullet ({\boldsymbol {\kappa }}\bullet {\boldsymbol {\nabla }}N_{j})~dV}$

Index notation:

${\displaystyle K_{ij}^{e}=\int _{\Omega ^{e}}N_{i,m}~\kappa _{mn}~N_{j,n}~dV}$

Expanded out (in 2D) (assume ${\displaystyle \kappa _{12}=0}$):

${\displaystyle K_{ij}^{e}=\int _{\Omega ^{e}}\left({\frac {\partial N_{i}}{\partial x}}\kappa _{11}{\frac {\partial N_{j}}{\partial y}}+{\frac {\partial N_{i}}{\partial x}}\kappa _{22}{\frac {\partial N_{j}}{\partial y}}\right)~dx~dy}$

Transformation

Chain Rule:

{\displaystyle {\begin{aligned}{\frac {\partial N_{i}}{\partial \xi }}&={\frac {\partial N_{i}}{\partial x}}{\frac {\partial x}{\partial \xi }}+{\frac {\partial N_{i}}{\partial y}}{\frac {\partial y}{\partial \xi }}\\{\frac {\partial N_{i}}{\partial \eta }}&={\frac {\partial N_{i}}{\partial x}}{\frac {\partial x}{\partial \eta }}+{\frac {\partial N_{i}}{\partial y}}{\frac {\partial y}{\partial \eta }}\\\end{aligned}}}

Matrix notation:

${\displaystyle {\begin{bmatrix}{\frac {\partial N_{i}}{\partial \xi }}\\\\{\frac {\partial N_{i}}{\partial \eta }}\end{bmatrix}}={\begin{bmatrix}{\frac {\partial x}{\partial \xi }}&&{\frac {\partial y}{\partial \xi }}\\\\{\frac {\partial x}{\partial \eta }}&&{\frac {\partial y}{\partial \eta }}\end{bmatrix}}{\begin{bmatrix}{\frac {\partial N_{i}}{\partial x}}\\\\{\frac {\partial N_{i}}{\partial y}}\end{bmatrix}}=\mathbf {J} ^{e}{\begin{bmatrix}{\frac {\partial N_{i}}{\partial x}}\\\\{\frac {\partial N_{i}}{\partial y}}\end{bmatrix}}}$

Inverse Transformation

${\displaystyle {\begin{bmatrix}{\frac {\partial N_{i}}{\partial x}}\\\\{\frac {\partial N_{i}}{\partial y}}\end{bmatrix}}=(\mathbf {J} ^{e})^{-1}{\begin{bmatrix}{\frac {\partial N_{i}}{\partial \xi }}\\\\{\frac {\partial N_{i}}{\partial \eta }}\end{bmatrix}}~;~~\mathbf {J} ^{*}=(\mathbf {J} ^{e})^{-1}~{\text{exists if}}~\det(\mathbf {J} ^{e})\neq 0~.}$

with

{\displaystyle {\begin{aligned}{\frac {\partial x}{\partial \xi }}&=x_{1}^{e}~{\frac {\partial N_{1}^{e}}{\partial \xi }}+x_{2}^{e}~{\frac {\partial N_{2}^{e}}{\partial \xi }}+x_{3}^{e}~{\frac {\partial N_{3}^{e}}{\partial \xi }}+x_{4}^{e}~{\frac {\partial N_{4}^{e}}{\partial \xi }}\\{\frac {\partial y}{\partial \xi }}&=y_{1}^{e}~{\frac {\partial N_{1}^{e}}{\partial \xi }}+y_{2}^{e}~{\frac {\partial N_{2}^{e}}{\partial \xi }}+y_{3}^{e}~{\frac {\partial N_{3}^{e}}{\partial \xi }}+y_{4}^{e}~{\frac {\partial N_{4}^{e}}{\partial \xi }}\\{\frac {\partial x}{\partial \eta }}&=x_{1}^{e}~{\frac {\partial N_{1}^{e}}{\partial \eta }}+x_{2}^{e}~{\frac {\partial N_{2}^{e}}{\partial \eta }}+x_{3}^{e}~{\frac {\partial N_{3}^{e}}{\partial \eta }}+x_{4}^{e}~{\frac {\partial N_{4}^{e}}{\partial \eta }}\\{\frac {\partial y}{\partial \eta }}&=y_{1}^{e}~{\frac {\partial N_{1}^{e}}{\partial \eta }}+y_{2}^{e}~{\frac {\partial N_{2}^{e}}{\partial \eta }}+y_{3}^{e}~{\frac {\partial N_{3}^{e}}{\partial \eta }}+y_{4}^{e}~{\frac {\partial N_{4}^{e}}{\partial \eta }}\end{aligned}}}

Returning to the integration of the stiffness matrix terms:

${\displaystyle K_{ij}^{e}=\int _{\Omega ^{e}}\left({\frac {\partial N_{i}}{\partial x}}\kappa _{11}{\frac {\partial N_{j}}{\partial y}}+{\frac {\partial N_{i}}{\partial x}}\kappa _{22}{\frac {\partial N_{j}}{\partial y}}\right)~dx~dy}$

In parent element coordinates:

{\displaystyle {\begin{aligned}K_{ij}^{e}&=\int _{-1}^{1}\left(\kappa _{11}\left(J_{11}^{*}{\frac {\partial N_{i}}{\partial \xi }}+J_{12}^{*}{\frac {\partial N_{i}}{\partial \eta }}\right)+\left(J_{11}^{*}{\frac {\partial N_{j}}{\partial \xi }}+J_{12}^{*}{\frac {\partial N_{j}}{\partial \eta }}\right)+\right.\\&\left.\kappa _{22}\left(J_{21}^{*}{\frac {\partial N_{i}}{\partial \xi }}+J_{22}^{*}{\frac {\partial N_{i}}{\partial \eta }}\right)+\left(J_{21}^{*}{\frac {\partial N_{j}}{\partial \xi }}+J_{22}^{*}{\frac {\partial N_{j}}{\partial \eta }}\right)\right)~d\xi ~d\eta \end{aligned}}}

${\displaystyle \int _{-1}^{1}F_{ij}(\xi ,\eta )~d\xi ~d\eta =\sum _{I=1}^{M}\sum _{J=1}^{N}F_{IJ}(\xi _{I},\eta _{J})~W_{I}~W_{J}}$

Find the constants Co, C1, and X so that the quadrature formula

${\displaystyle \int _{0}^{1}f(x)\,dx=Cof(0)+C1f(x_{1}).}$

This has the highest possible degree of precision.

Solution.

Since there are three unknowns, Co, C1 and X1, we will expect the formula to be exact for

${\displaystyle f(x)=1,x,and\,\ x^{2}}$

Thus

${\displaystyle f(x)=1,\ \int _{0}^{1}f(x)\,dx=1=C_{0}+C_{1}\ \qquad \ Equation1,\qquad f(x)=x,\ \int _{0}^{1}f(x)\,dx={\frac {1}{2}}=C_{1}x_{1}\ \qquad \ Equation2.\qquad f(x)=x^{2},\ \int _{0}^{1}f(x)\,dx={\frac {1}{3}}=C_{1}x_{1}^{2}.}$

Equation 2 and 3 will yield.

${\displaystyle {\frac {c_{1}x_{1}}{c_{1}x_{1}^{2}}}=x_{1}={\frac {2}{3}}.\qquad c_{1}={\frac {3}{4}}.\qquad c_{0}={\frac {1}{4}}.}$

Hence

${\displaystyle \int _{0}^{1}f(x)\,dx={\frac {1}{4}}f(0)+{\frac {3}{4}}f({\frac {2}{3}})}$

Now,

${\displaystyle f(x)=x^{3}.\qquad \int _{0}^{1}x^{3}\,dx={\frac {1}{4}}}$

And

${\displaystyle {\frac {1}{4}}(0)^{3}+{\frac {3}{4}}({\frac {2}{3}})^{3}={\frac {2}{9}}.}$

Thus the degree of the precision is 2

Robin boundary conditions

A similar approach can be used when w:Robin boundary conditions are needed to be applied. Let us assume that the Robin boundary conditions take the form

${\displaystyle \alpha ~T+\beta ~({\boldsymbol {\nabla }}T\cdot \mathbf {n} )=h\qquad \qquad {\text{on}}~\Gamma ~.}$

Recall from the previous section that the boundary term in the weak form of the heat equation is

${\displaystyle \int _{\Gamma }w~{\overline {q}}~dA}$

where

${\displaystyle {\overline {q}}=({\boldsymbol {\kappa }}\cdot {\boldsymbol {\nabla }}T)\cdot \mathbf {n} ~.}$.

Let us assume, for simplicity, that the material is isotropic. In that case ${\displaystyle {\boldsymbol {\kappa }}}$ becomes a scalar quantity ${\displaystyle \kappa \,}$ and we can write

${\displaystyle {\overline {q}}=\kappa ~({\boldsymbol {\nabla }}T\cdot \mathbf {n} )~.}$

Now, we can write the Robin boundary condition as

${\displaystyle {\boldsymbol {\nabla }}T\cdot \mathbf {n} ={\cfrac {h}{\beta }}-{\cfrac {\alpha }{\beta }}~T\equiv {\hat {h}}-{\hat {\alpha }}~T\qquad \qquad {\text{on}}~\Gamma ~.}$

Using this expression we can get of the flux term in ${\displaystyle {\overline {q}}}$ to get

${\displaystyle {\overline {q}}=\kappa ~({\hat {h}}-{\hat {\alpha }}~T)~.}$

Then the boundary term takes the form

${\displaystyle \int _{\Gamma }w~{\overline {q}}~dA=\int _{\Gamma }w~\kappa ~({\hat {h}}-{\hat {\alpha }}~T)~dA~.}$

If we ignore the contributions to the trial function from the Dirichlet boundary conditions we can write

${\displaystyle w_{h}(\mathbf {x} )=\sum _{j=1}^{n}b_{j}N_{j}(\mathbf {x} )~;~~T_{h}=v_{h}(\mathbf {x} ,t)=\sum _{i=1}^{n}T_{i}(t)N_{i}(\mathbf {x} )}$

Plugging these expressions into the boundary term leads to

{\displaystyle {\begin{aligned}\sum _{j}b_{j}\int _{\Gamma }N_{j}~{\overline {q}}~dA&=\sum _{j}b_{j}\int _{\Gamma }N_{j}~\kappa ~({\hat {h}}-{\hat {\alpha }}~\sum _{i}T_{i}N_{i})~dA\\&=\sum _{j}b_{j}\left(\int _{\Gamma }\kappa ~{\hat {h}}~N_{j}~dA-\sum _{i}T_{i}~\int _{\Gamma }\kappa ~{\hat {\alpha }}~N_{i}~N_{j}~dA\right)\end{aligned}}}

Now recall that spatially discretized equation for transient heat conduction can be expressed as (in simplified form; after getting rid of contributions due to Dirichlet boundary conditions and with a scalar ${\displaystyle \kappa \,}$)

{\displaystyle {\begin{aligned}\sum _{j}b_{j}&\left[\sum _{i}{\frac {\partial T_{i}}{\partial t}}\left(\int _{\Omega }\rho ~C_{v}~N_{i}~N_{j}~dV\right)+\sum _{i}\kappa ~T_{i}\left(\int _{\Omega }{\boldsymbol {\nabla }}N_{j}\bullet {\boldsymbol {\nabla }}N_{i}~dV\right)\right]=\\&\sum _{j}b_{j}\left[\int _{\Omega }N_{j}~s~dV-\int _{\Gamma }N_{j}~{\overline {q}}~dA\right]\end{aligned}}}

Substituting the last term on the right hand side with the new expression for the boundary term, we have

{\displaystyle {\begin{aligned}\sum _{j}b_{j}&\left[\sum _{i}{\frac {\partial T_{i}}{\partial t}}\left(\int _{\Omega }\rho ~C_{v}~N_{i}~N_{j}~dV\right)+\sum _{i}\kappa ~T_{i}\left(\int _{\Omega }{\boldsymbol {\nabla }}N_{j}\bullet {\boldsymbol {\nabla }}N_{i}~dV\right)\right]=\\&\sum _{j}b_{j}\left[\int _{\Omega }N_{j}~s~dV-\kappa ~\int _{\Gamma }{\hat {h}}~N_{j}~dA+\sum _{i}\kappa ~T_{i}~\int _{\Gamma }{\hat {\alpha }}~N_{i}~N_{j}~dA\right]\end{aligned}}}

Invoking the arbitrariness of ${\displaystyle b_{j}}$ and rearranging, we get

{\displaystyle {\begin{aligned}\sum _{i}{\frac {\partial T_{i}}{\partial t}}\left(\int _{\Omega }\rho ~C_{v}~N_{i}~N_{j}~dV\right)&+\sum _{i}\kappa ~T_{i}\left(\int _{\Omega }{\boldsymbol {\nabla }}N_{j}\bullet {\boldsymbol {\nabla }}N_{i}~dV-\int _{\Gamma }{\hat {\alpha }}~N_{i}~N_{j}~dA\right)=\\&\int _{\Omega }s~N_{j}~dV-\int _{\Gamma }\kappa ~{\hat {h}}~N_{j}~dA~.\end{aligned}}}

Define

{\displaystyle {\begin{aligned}M_{ji}&:=\int _{\Omega }\rho ~C_{v}~N_{j}~N_{i}~dV\\K_{ji}&:=\int _{\Omega }{\boldsymbol {\nabla }}N_{j}\bullet {\boldsymbol {\nabla }}N_{i}~dV-\int _{\Gamma }{\hat {\alpha }}~N_{j}~N_{i}~dA\\f_{j}&:=\int _{\Omega }s~N_{j}~dV-\int _{\Gamma }\kappa ~{\hat {h}}~N_{j}~dA~.\end{aligned}}}

Then the finite element system of equations is

${\displaystyle \sum _{i}M_{ji}~{\dot {T}}_{i}+\sum _{i}K_{ji}~T_{i}=f_{j}~.}$

or, in matrix form

${\displaystyle \mathbf {M} ~{\dot {\mathbf {T} }}+\mathbf {K} ~\mathbf {T} =\mathbf {f} ~.}$

Note that the ${\displaystyle \mathbf {K} }$ matrix and the ${\displaystyle \mathbf {f} }$ vector are different from the case where there are no Robin boundary conditions. The boundary terms in the discretized system of equations can be computed in the usual manner and will add terms to the diagonal of the ${\displaystyle \mathbf {K} }$ matrix.