Answers to Problems for An Introduction to the Finite Element Method, 4th Edition by Reddy
Answers to Problems for An Introduction to the Finite Element Method, 4th Edition by Reddy
1 General Introduction
sm
Mathematics is the language with which God has written the universe.
— Galileo Galilei
tb9
1.1 Newton’s second law can be expressed as
F = ma
where F is the net force acting on the body, m mass of the body, and a is the acceleration
of the body in the direction of the net force. Determine the mathematical model, that is,
the governing equation of a free-falling body. Consider only the forces due to gravity and
the air resistance. Assume that the air resistance is linearly proportional to the velocity
8@
of the falling body.
Fd = cv
v
Fg = mg
gm
Fig. P1.1
where v is the downward velocity (m/s) of the body, Fg is the downward force (N or kg
m/s2 ) due to gravity, Fd is the upward drag force, m is the mass (kg) of the body, g the
acceleration (m/s2 ) due to gravity, and c is the proportionality constant (drag coefficient,
kg/s). The equation of motion is
dv c
+ αv = g, α=
.co
dt m
1.2 A cylindrical storage tank of diameter D contains a liquid at depth (or head) h(x, t).
Liquid is supplied to the tank at a rate of qi (m3 /day) and drained at a rate of q0
(m3 /day). Use the principle of conservation of mass to arrive at the governing equation
of the flow problem.
Solution: The conservation of mass requires
m
1.3 Consider the simple pendulum of Example 1.3.1. Write a computer program to nu-
merically solve the linear equation (1.2.4) using Euler’s (or forward difference) finite
difference scheme. Tabulate the numerical results for two different time steps ∆t = 0.05
and ∆t = 0.025 along with the exact linear solution.
Solution: One needs to program the finite difference equations in Eq. (1.3.6). Table 1.3
contains representative numerical results.
Table 1.3 Comparison of various approximate solutions of the equation (d2 θ/dt2 ) + λ2 θ = 0 with
its exact linear solution.
1.4 Consider the simple pendulum of Example 1.3.1. Write a computer program to nu-
merically solve the nonlinear equation (1.2.3) using Euler’s (or forward difference) finite
difference scheme. Tabulate the numerical results for two different time steps ∆t = 0.05
and ∆t = 0.025 along with the exact linear solution.
Solution: In order to use the forward finite difference scheme in Eq. (1.3.2), we rewrite
the nonlinear equation in (1.2.3) as a pair of first-order equations
dθ dv
= v, = −λ2 sin θ
dt dt
Applying the scheme of Eq. (1.3.2) to the two equations at hand, we obtain
θi+1 = θi + ∆t vi ; vi+1 = vi − ∆t λ2 sin θi
GENERAL INTRODUCTION 3
The above equations can be programmed to solve for (θi , vi ). Table 1.4 contains repre-
sentative numerical results.
1.5 An improvement of Euler’s method is provided by Heun’s method, which uses the average
of the derivatives at the two ends of the interval to estimate the slope. Applied to the
equation
du
= f (t, u)
dt
Heun’s scheme has the form
∆t
f (ti , ui ) + f (ti+1 , u0i+1 ) , u0i+1 = ui + ∆t f (ti , ui )
ui+1 = ui +
2
Table 1.4 Comparison of various approximate solutions of the equation (d2 θ/dt2 ) + λ2 sin θ = 0
with exact linear solution.
The second equation is known as the predictor equation and the first equation is called
the corrector equation. Apply Heun’s method to Eq. (1.3.5) and obtain the numerical
solution for ∆t = 0.05.
Solution: Heun’s method applied to the pair
dθ dv
= v, = −λ2 sin θ
dt dt
yields the following discrete equations:
0
θi+1 = θi + ∆t vi
∆t
vi+1 = vi − λ2 0
sin θi + sin θi+1
2
∆t
θi+1 = θi + (vi + vi+1 )
2
4 GENERAL INTRODUCTION
The numereical results obtained with the Heun’s method and Euler’s method are pre-
sented in Table 1.5.
Table 1.5 Numerical solutions of the nonlinear equation d2 θ/dt2 + λ2 sin θ = 0 along with the
exact solution of the linear equation d2 θ/dt2 + λ2 θ = 0.
1.6 Show that the backward difference approximation of the boundary condition in Eq.
(1.2.20) yields
−1
β∆x
θN +1 = 1 + θN
k
β∆x
and that it is the same as that in Eq. (1.3.9) when k < 1.
Solution: Expanding in Taylor’s series and keeping the first two terms, we obtain the
required result:
−1
β∆x β∆x
θN +1 = 1 + θN ≈ 1 − θN
k k
1.7 Write a computer program to solve the rod problem of Example 1.3.2 using 8 intervals
(i.e., ∆x = 0.00625) and determine the solution at mesh points x = 0.00625, 0.0125,
0.01875, · · · , 0.05 m.
Solution: For a subdivision of 8 subintervals, we have ∆x = 0.00625, D = 2 + (20 ×
0.00625)2 = 2.015625, and D − 1 + (β∆x/k) = 1.028125. Hence, the finite difference
equations are
2.015625 θ1 −θ2 = 300
−θ1 +2.015625 θ2 −θ3 = 0
−θ2 +2.015625 θ3 −θ4 = 0
.. ..
. .
−θ6 +2.015625 θ7 −θ8 = 0
−θ7 +1.028125 θ8 = 0
GENERAL INTRODUCTION 5
1.8 Repeat Problem 1.7 for 16 subdivisions and compare the finite difference solution with
the analytical solution.
Solution: For a subdivision of 16 subintervals, we have ∆x = 0.003125, D = 2 + (20 ×
0.003125)2 = 2.00390625, and D −1+(β∆x/k) = 1.01015625. Hence, the finite difference
equations are
2.00391 θ1 −θ2 = 300
−θ1 2.00391 θ2 −θ3 = 0
−θ2 2.00391 θ3 −θ4 = 0
.. ..
. .
−θ13 2.00391 θ14 −θ15 = 0
−θ15 1.01016 θ16 = 0
The solution of these equations is
{θ} = {285.36, 271.84, 259.37, 247.92, 237.44, 227.89, 219.22, 211.42, · · · , 176.78}T
The analytical solution at the same points is
{θ} = {285.56, 272.25, 259.99, 248.75, 238.48, 229.15, 220.71, 213.13, · · · , 180.66}T
2 Mathematical Preliminaries and
Classical Variational Methods
The fact that an opinion has been widely held is no evidence whatever that it is not utterly
absurd; indeed in view of the silliness of the majority of mankind, a widespread belief is more
likely to be foolish than sensible. — Bertrand Russell
2.1 Let R denote a position vector R = x = xi êi (R2 = xi xi ) and A an arbitrary constant
vector. Show that:
(a) ∇2 (Rp ) = p (p + 1)Rp−2 (b) grad (R · A) = A
1
(c) div (R × A) = 0 (d) div (RA) = (R · A)
R
2.2 Let A and B be continuous vector functions of the position x with continuous first
derivatives, and let F and G be continuous scalar functions of position x with continuous
first and second derivatives. Show that:
(a) ∇(A · x) = A + ∇A · x
(b) ∇ · (F A) = A · ∇F + F ∇ · A
Solution:
(a) Since A=A(x), we have
∂ ∂Aj ∂xj
grad(A · x) = êi (Aj xj ) = êi x j + Aj
∂xi ∂xi ∂xi
= ∇A · x + A
∂x
where Aj ∂xji = Aj δij = Ai is used in arriving at the final expression.
(b) Since F = F (x) and A=A(x), we have
∂ ∂Aj ∂F
∇ · (F A) = êi · (êj Aj F ) = δij F + Aj
∂xi ∂xi ∂xi
∂Ai ∂F
= F + Ai = ∇ · AF + A · ∇F
∂xi ∂xi
2.3 Let a be continuous second-order tensor function of the position x with continuous first
derivatives, and let u be a continuous scalar function of the position x with continuous
first and second derivatives. Show that
1 ∂ ∂u 1 ∂u ∂u
∇ · (a · ∇u) = r arr + arθ + arz
r ∂r ∂r r ∂θ ∂z
1 ∂ ∂u 1 ∂u ∂u
+ aθr + aθθ + aθz
r ∂θ ∂r r ∂θ ∂z
∂ ∂u 1 ∂u ∂u
+ azr + azθ + azz
∂z ∂r r ∂θ ∂z
a = arr êr êr + arθ êr êθ + arz êr êz + aθr êθ êr + aθθ êθ êθ + aθz êθ êz
+ azr êz êr + azθ êz êθ + azz êz êz
∂u 1 ∂u
a · ∇u = (arr êr + aθr êθ + azr êz ) + (arθ êr + aθθ êθ + azθ êz )
∂r r ∂θ
∂u
+ (arz êr + aθz êθ + azz êz )
∂z
PRELIMINARIES AND VARIATIONAL METHODS 9
In Problems 2.4–2.9, construct the weak forms and, whenever possible, the associated
quadratic functionals (I).
Solution: First, compare the given equations with the model equation in (2.4.1) and its
boundary conditions (2.4.2). We find that a(x) = 1 + 2x2 , c(x) = 1, f (x) = x2 , L = 1,
u0 = 1, β = 0, and QL = 3 × 2. Hence, the weak form is obtained directly from (2.4.18)
as
Z Lh
dwi dun i
0= (1 + 2x2 ) + wi un − wi x2 dx − 6wi (1) (2)
0 dx dx
The bilinear and linear forms are given by Eq. (2.4.19) as
Z 1
2 dwi dun
B(wi , un ) = (1 + 2x ) + wi un dx (symmetric)
0 dx dx
Z 1 (3)
`(wi ) = x2 wi dx + 6wi (1)
0
Since B(·, ·) is symmetric in its arguments and `(wi ) is linear in wi , a quadratic functional
can be constructed and it is given by [see Eq. (2.4.25)]
1
I(un ) = B(un , un ) − `(un )
2
Z " 2 #
1 1
Z 1
2 du n 2
= (1 + 2x ) + un dx − x2 un dx − 6un (1)
2 0 dx 0
10 PRELIMINARIES AND VARIATIONAL METHODS
Solution: Compared to the model equation (2.4.1), we have a(x) = un (x), f (x) →
−f (x), and L = 1. Following the three-step procedure, we write the weak form
Z 1
d dun
0= wi − un + f dx (1)
0 dx dx
Z 1 1
dwi dun dun
= un + wi f dx − wi un (2)
0 dx dx dx 0
d2 w
dw
u=w=0 at x = 0, L; = 0; EI 2 = M0
dx x=0 dx x=L
where EA, EI, f , and q are functions of x and M0 is a constant. Here u denotes the
axial displacement and w the transverse deflection of the beam.
Solution: The first step of the formulation is to multiply each equation with a weight
function, say v1i for the first equation and v2i for the second equation, and integrate
over the interval (0, L). In the second step, carry out the integration-by-parts once in
the first equation, twice in the first term of the second equation, and once in the second
PRELIMINARIES AND VARIATIONAL METHODS 11
part of the second equation. Then use the fact that v1i (0) = v1i (L) = 0 (because u
is specified there), v2i (0) = v2i (L) = 0 (because w is specified), and (dv2i /dx)(0) = 0
(because dw/dx is specified at x = 0). In addition, we have EI(d2 w/dx2 ) = M0 at
x = L. The final weak forms are given by (assuming m-parameter approximation of u
and n-parameter approximation of w)
Z L( " 2 # )
dv1i dum 1 dwn
0= EA + − v1i f dx (i = 1, 2, · · · , m) (1a)
0 dx dx 2 dx
Z L( " 2 # )
d2 v2i d2 wn
dv2i dwn dum 1 dwn
0= EI + EA + − v2i q dx
0 dx2 dx2 dx dx dx 2 dx
dv2i
− M0 (i = 1, 2, · · · , n) (1b)
dx
L
Note that for this case the weak form is not linear in um or wn . However, a functional
can be constructed for this using the potential operator theory (see Oden and Reddy [10]
and Reddy [3]). The functional is given by
Z L( "
2 2 4 # 2
EI d2 w
EA du du dw 1 dw
Π(u, w) = + + +
0 2 dx dx dx 2 dx 2 dx2
)
dw
+ uf + wq dx − M0
dx
L
where wi = 0 on Γ1 . The bilinear form (which is symmetric only if a12 = a21 ) and linear
form are:
Z
∂wi ∂un ∂wi ∂un ∂wi ∂un ∂wi ∂un
B(wi , un ) = a11 + a12 + a21 + a22 dxdy
Ω ∂x ∂x ∂x ∂y ∂y ∂x ∂y ∂y
Z Z
`(wi ) = − wi f dxdy + wi t0 ds
Ω Γ2
Solution: The weak form of this equation can be developed following the three-step
procedure with the area element being dA = rdrdz and wi = 0 on ΓT :
Z
1 ∂ ∂Tn ∂ ∂Tn
0=− wi rk + k + g rdrdz
Ω r ∂r ∂r ∂z ∂z
Z
∂wi ∂Tn ∂wi ∂Tn
= k + − wi g rdrdz
Ω ∂r ∂r ∂z ∂z
I
∂Tn ∂Tn
− rkwi nr + nz ds
Γ ∂r ∂z
Z Z
∂wi ∂Tn ∂wi ∂Tn
= k + − wi g rdrdz − wi q̂n ds (3)
Ω ∂r ∂r ∂z ∂z Γq
where (nr , nz ) are the direction cosines of unit normal to the boundary. The bilinear and
linear forms are
Z
∂wi ∂Tn ∂wi ∂Tn
B(wi , Tn ) = k + rdrdz
∂r ∂r ∂z ∂z
ZΩ Z (4)
`(wi ) = wi g rdrdz + wi q̂n ds
Ω Γq
Solution: For this set of three differential equations in two dimensions (see Chapter
11 and Reddy [7] for the physics behind the equations), we follow exactly the same
procedure as before: use the three-step procedure for each equation. In the second step
of the formulation, we must integrate by parts the terms involving P , u, and v, because
these terms are required as a part of the natural boundary conditions given in Eq. (3). No
integration by parts is used in the third equation, because the boundary terms resulting
from such integration-by-parts do not constitute physical variables. We have
Z 2
∂ vx ∂ ∂vx ∂vy ∂P
0= w1i −µ 2 2 + + + − fx dxdy
Ω ∂x ∂y ∂y ∂x ∂x
Z Z
∂w1i ∂vx ∂w1i ∂vx ∂vy
= 2µ −P +µ + − w1i fx dxdy − w1i t̂x ds
Ω ∂x ∂x ∂y ∂y ∂x Γ2
(4)
Z 2
∂ vy ∂ ∂vx ∂vy ∂P
0= w2i −µ 2 2 + + + − fy dxdy
Ω ∂y ∂x ∂y ∂x ∂y
Z Z
∂w2i ∂vx ∂w2i ∂vx ∂vy
= 2µ −P +µ + − w2i fy dxdy − w2i t̂y ds
Ω ∂y ∂y ∂x ∂y ∂x Γ2
(5)
Z
∂u ∂v
0= w3i + dxdy (6)
Ω ∂x ∂y
where (w1i , w2i , w3i ) are weight functions such that w1i = w2i = 0 on Γ1 . The bilinear
form may be identified by adding all three equations in (4)–(6) and grouping the terms
14 PRELIMINARIES AND VARIATIONAL METHODS
Since B(·, ·) is symmetric and `(·) is linear in their arguments, we can construct the
quadratic functional using Eq. (2.4.25) as follows [set w1i = vx , w2i = vy , and w3i = P
in B(·, ·) and `(·) before substituting into Eq. (2.4.25)]:
Z " 2 2 2 #
1 ∂vx ∂vy ∂vx ∂vy
I(v, P ) = µ + + + dxdy
2 Ω ∂x ∂y ∂y ∂x
Z Z
∂vx ∂vy
− + P + (fx vx + fy vy ) dxdy − (t̂x vx + t̂y vy ) ds (9)
Ω ∂x ∂y Γ2
2.10 Compute the coefficient matrix and the right-hand side of the n-parameter Ritz approx-
imation of the equation
d du
− (1 + x) = 0 for 0 < x < 1
dx dx
u(0) = 0, u(1) = 1
Use algebraic polynomials for the approximation functions. Specialize your result for
55 20
n = 2 and compute the Ritz coefficients. Answer: c1 = 131 and c2 = − 131 .
Solution: The weak form for this problem is given by
Z 1
dw du
0= (1 + x) dx = B(w, u); `(w) = 0
0 dx dx
The variational problem is given by Eqs. (2.5.1) and (2.5.2), where [`(φi ) = 0 because
there is no source term], and the Ritza equations are given by Eqs. (2.5.5) and (2.5.6)
with
Z 1
dφi dφj
Kij = B(φi , φj ) = (1 + x) dx (1a)
0 dx dx
Z 1
dφi dφ0
Fi = −B(φi , φ0 ) = − (1 + x) dx (1b)
0 dx dx
The approximation functions φ0 and φi should be chosen such that
φ0 (0) = 0, φ0 (1) = 1 ; φi (0) = φi (1) = 0, (i = 1, 2, ..., n) (2)
The following algebraic polynomials satisfy the above requirements:
φ0 = x , φi = xi (1 − x) (i = 1, 2, . . . , n) (3)