I. Variational Formulation.: Student: Victor Pugliese R#: 11492336 Course: MATH 5345 Numerical Analysis Project 01
I. Variational Formulation.: Student: Victor Pugliese R#: 11492336 Course: MATH 5345 Numerical Analysis Project 01
I. Variational Formulation.: Student: Victor Pugliese R#: 11492336 Course: MATH 5345 Numerical Analysis Project 01
R#: 11492336
Course: MATH 5345 Numerical Analysis
Project 01
The equation (1) is a linear second order elliptic equation known as Poisson equation. If 𝑓 =
sin 𝑥 + sin 𝑦; thus, 𝑢 = sin 𝑥 + sin 𝑦 is the analytical solution of equation (1). It is important to
note that the model has inhomogeneous boundary condition.
I. Variational 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
𝐸𝑞. (2) ∫ ∇𝑢 ∙ ∇𝑣𝑑𝑥 = ∫ 𝑓𝑣𝑑𝑥 , ∀𝑣 ∈ 𝑉0
Ω Ω
𝑛𝑖
Let {𝜙𝑖 }𝑖=1 be the basis for 𝑉ℎ,0 .
𝜙𝑖 are the hat functions associated with the 𝑛𝑖 interior nodes within the mesh.
𝑛𝑝 𝑛𝑖 𝑛𝑔
𝑢ℎ = ∑ 𝜉𝑗 𝜙𝑗 = ∑ 𝜉𝑖 𝜙𝑖 + ∑ 𝜉𝑔 𝜙𝑔 , 𝑤𝑖𝑡ℎ 𝑛𝑖 𝑢𝑛𝑘𝑛𝑜𝑤𝑛𝑠 𝜉𝑖
𝑗=1 𝑖=1 𝑔=1
Now, we can write 𝑛𝑝 equations using the finite element method equation (3).
∫ ∇𝑢ℎ ∇𝜙𝑖 𝑑𝑥 = ∫ 𝑓𝜙𝑖 𝑑𝑥 , 𝑖 = 1,2, … , 𝑛𝑝
Ω Ω
𝑛𝑝
𝑛𝑝
𝑛𝑝
∑ 𝐴𝑖𝑗 𝜉𝑗 = 𝑏𝑖 , 𝑖 = 1,2, … , 𝑛𝑝
𝑗=1
Where
𝐴𝑖𝑗 = ∫ ∇𝜙𝑗 ∇𝜙𝑖 𝑑𝑥 , 𝑏𝑖 = ∫ 𝑓𝜙𝑖 𝑑𝑥 , 𝑖, 𝑗 = 1, 2, … , 𝑛𝑝
Ω Ω
𝐴𝜉 = 𝑏
𝐴 𝐴0𝑔 𝜉𝑖 𝑏0
[ 00 ][ ] = [ ]
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𝑔 𝜉𝑔
𝑢ℎ = ∑ 𝜉𝑗 𝜙𝑗
𝑗=1
|𝐾| is the area of the triangle element. The gradient of 𝜙 is the constant vector:
𝑏
∇𝜙𝑖 = [ 𝑖 ]
𝑐𝑖
The information of the triangulation is storage in Point matrix P and a Connectivity
matrix T. The number of columns in P are equal to the number of nodes in Ω. The
first and second rows are the 𝑥1 and 𝑥2 coordinates of the node.
The number of columns in T are equal to the number of elements in Ω. The first
three rows are the indexes of the corner points, clockwise order.
𝑏12 + 𝑐12 𝑏2 𝑏1 + 𝑐2 𝑐1 𝑏3 𝑏1 + 𝑐3 𝑐1
𝐴𝐾 = [𝑏2 𝑏1 + 𝑐2 𝑐1 𝑏22 + 𝑐22 𝑏2 𝑏3 + 𝑐2 𝑐3 ] |𝐾|
𝑏3 𝑏1 + 𝑐3 𝑐1 𝑏2 𝑏3 + 𝑐2 𝑐3 𝑏32 + 𝑐32
‖𝑢 − 𝑢ℎ ‖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.
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.