I. Weak Formulation.: Student: Victor Pugliese R#: 11492336 Course: MATH 5345 Numerical Analysis Project 03
I. Weak Formulation.: Student: Victor Pugliese R#: 11492336 Course: MATH 5345 Numerical Analysis Project 03
R#: 11492336
Course: MATH 5345 Numerical Analysis
Project 03
If 𝑓 = −2 sin 𝑥 cos 𝑦 ; thus, 𝑢 = sin 𝑥 cos 𝑦 is the analytical solution of equation (1). It is
important to note that the model has inhomogeneous boundary condition. Thus the problem we
have:
I. Weak Formulation.
This problem has different trial and test space due to the boundary condition 𝑢 =
𝑔𝐷 . The trial space is given by
𝑉𝑔𝐷 = {𝑣: ‖𝑣‖𝐿2 + ‖∇𝑣‖𝐿2 < ∞, 𝑣|𝜕Ω = 𝑔𝐷 }
The test space is given by
𝑉0 = {𝑣: ‖𝑣‖𝐿2 + ‖∇𝑣‖𝐿2 < ∞, 𝑣|𝜕Ω = 0}
Then,
We multiply −Δ𝑢 = 𝑓 by a test function 𝑣, which is in 𝑉0.
∫ Δ𝑢𝑣𝑑𝑥 = ∫ 𝑓𝑣𝑑𝑥
Ω Ω
Using Green’s formula:
∫ ∇𝑢 ∙ ∇𝑣𝑑𝑥 − ∫ 𝑛 ∙ ∇𝑢𝑣𝑑𝑠 = ∫ 𝑓𝑣𝑑𝑥
Ω 𝜕Ω Ω
𝑣 is zero on the boundary, thus we have the following variational formulation of
(1): find 𝑢 ∈ 𝑉𝑔𝐷 such that
∫ ∇𝑢 ∙ ∇𝑣𝑑𝑥 = ∫ 𝑓𝑣𝑑𝑥 , ∀𝑣 ∈ 𝑉0
Ω Ω
On each element 𝑇 ∈ 𝑇ℎ , the following local weak finite element space is defined:
𝑉(𝑘, 𝑗, 𝑇) ≔ {𝑣 = {𝑣0 , 𝑣𝑏 }: 𝑣0 ∈ 𝑃𝑘 (𝑇), 𝑣𝑏 |𝑒 ∈ 𝑃𝑗 (𝑒), 𝑒 ⊂ 𝜕𝑇}
𝑉ℎ0 is the subspace of 𝑉ℎ consisting of all finite element functions with vanishing
boundary value.
𝑉ℎ0 = {𝑣 ∈ 𝑉ℎ : 𝑣𝑏 |𝜕Ω = 0}
Now, 𝑎(𝑢, 𝑣) ≔ (∇𝑢, ∇𝑣), 𝑢, 𝑣 ∈ 𝐻1 (Ω) is the bilinear form defined by:
2
𝑎ℎ (𝑢, 𝑣) = ∑ (∇𝑤 𝑢, ∇𝑤 𝑣) 𝑇 , 𝑢, 𝑣 ∈ 𝑉ℎ
𝑇∈𝑇ℎ
Replacing 𝑉0 with 𝑉ℎ,𝑔𝐷 in equation (2), we obtain the finite element method: find
𝑢ℎ ∈ 𝑉ℎ,𝑔𝐷 such that
∫ ∇𝑢ℎ ∙ ∇𝑣𝑑𝑥 = ∫ 𝑓𝑣𝑑𝑥 , ∀𝑣 ∈ 𝑉ℎ,0
Ω Ω
Theorem 1. Assume that the coercivity (4) holds true. Then, the weak Galerkin
finite element discretization scheme (3) has one and only one solution.
1
−
Theorem 2. Assume that 𝑙 ≥ 𝑘 − 1, 𝑗𝜕 (𝑣) = ℎ𝑇 2 𝑄𝑚 (𝑣𝑏 − 𝑣0 |𝜕𝑇 ) where
𝑄𝑚 : 𝐿2 (𝑒) → 𝑃𝑚 (𝑒) is the 𝐿2 projection operator and 𝑚 = max{𝑗, 𝑙}. Then the
estimate (4) holds true.
1
−
Theorem 3. Assume that 𝑙 ≥ 𝑘 − 1, 𝑗𝜕 (𝑣) = ℎ𝑇 2 (𝑣𝑏 − 𝑣0 |𝜕𝑇 ). Then the estimate
(4) holds true.
3
𝑢ℎ = 𝑢ℎ,0 + 𝑢ℎ,𝑔𝐷 , 𝑢ℎ,𝑜 ∈ 𝑉ℎ,0 & 𝑢ℎ,𝑔𝐷 ∈ 𝑉ℎ,𝑔𝐷
Because 𝑢ℎ,𝑔𝐷 is known it only remains to determine 𝑢ℎ,0 .
|𝑒1 | |𝑒1 |
0 0 0 0
3 6
|𝑒1 | |𝑒1 |
0 0 0 0
6 3
|𝑒2 | |𝑒2 |
0 0 0 0
ℎ−1 −1 3 6
𝑇 〈𝜙𝑏,𝑖 , 𝜙𝑏,𝑗 〉𝜕𝑇 = ℎ 𝑇 |𝑒2 | |𝑒2 |
0 0 0 0
6 3
|𝑒2 | |𝑒3 |
0 0 0 0
3 6
|𝑒3 | |𝑒2 |
( 0 0 0 0
6 3 )
The local element load vector 𝑏 𝐾 , formed by the nodes 𝑖, 𝑗, 𝑘, is calculated as
follow:
𝑓𝑖
𝑏𝑖𝐾 = ∫ 𝑓𝜙𝑖 𝑑𝑥 = |𝐾|
K 3
𝑓1
𝑓2
𝑓3
1 0
𝑏 𝐾 = |𝐾| 0
3
0
0
0
[0]
Finally, 𝑏 𝐾 is added to the appropriate places in 𝑏 using the information in the
connectivity matrix T.
𝐴𝜉 = 𝑏
𝐴00 𝐴0𝑔 𝜉𝑖 𝑏0
[ ][ ] = [ ]
0 𝐼 𝜉𝑔 𝑏𝑔
Where 𝐴00 is the upper left 𝑛𝑖 × 𝑛𝑖 block of A, 𝐴0𝑔 in the 𝑛𝑖 × 𝑛𝑔 upper right
block of A, 𝐼 is the 𝑛𝑔 × 𝑛𝑔 identity matrix, 𝑏0 is the first 𝑛𝑖 × 1 block of 𝑏, 𝑏𝑔 is
the 𝑛𝑔 × 1 vector with nodal values of 𝑢ℎ,𝑔𝐷 , 𝜉𝑖 is the 𝑛𝑖 × 1 vector with nodal
values of 𝑢ℎ,0 , and 𝜉𝑔 is the 𝑛𝑔 × 1 vector with nodal values of 𝑢ℎ,𝑔𝐷 . Rearranging
the first 𝑛𝑖 equations we obtain the 𝑛𝑖 × 𝑛𝑖 linear system
𝐴00 𝜉0 = 𝑏0 − 𝐴0𝑔 𝜉𝑔
‖𝑢 − 𝑢ℎ ‖2 𝐻 1 (Ω) ≤ 𝐶 ∑ 𝜂𝐾2
𝐾
Where the residual 𝜂𝐾 is defined by
1 1/2
𝜂𝐾 = ℎ𝐾 ‖𝑓 + Δ𝑢ℎ ‖𝐿2 (K) + ℎ𝐾 ‖[𝑛 ∙ ∇𝑢ℎ ]‖𝐿2 (𝜕𝐾/𝜕Ω)
2
Here, [𝑛 ∙ ∇𝑢ℎ ] denotes the jump in the normal derivative of 𝑢ℎ on the interior
edges of the element K. Also, since 𝑢ℎ is linear on K, Δ𝑢ℎ = 0.
7
Now, the results of the implementation of FEM in Matlab is presented:
The bounded two-dimensional domain [-1,1]2 is shown in Figure 1. In this case, the mesh size
ℎ𝐾 = 1. This mesh was generated with the function initmesh.
The total number of columns correspond to the total number of degree of freedom.
In order to evaluate the performance of the Finite Element Method, we will compare the
numerical solution with the analytical solution for a simple solution:
𝑢=𝑥
Now, using problem (1), the error estimation based on 𝐿2 and 𝐻1 norms were used to assess the
FEM. FEM was implemented using different mesh size (dx = [1, 0.5, 0.25, 0.125, 0.0625]) in order
to estimate the convergence order.
8
The theoretical order of convergence of the error, estimated based in L2-norm, is 2. If we use the
H1-norm, the convergence order is 1. presents the plot of log10 of error vs log10 of mesh size.
The slope of the straight line represent the convergence order.
a) b)
Figure 3 Error Estimation. a) L2 error. b) H1 error
References
Larson, Mats G., and Fredrik Bengzon. The Finite Element Method: Theory, Implementation, and
Applications. Berlin: Springer-Verlag, 2013.
MathWorks. n.d. https://www.mathworks.com.