u1 u2 u1 u2 u1 u2

©1 ©2 ©3 u4

u1 u2 u3

x1 x2 x3 x4

Figure 14.4

Element distribution and unknowns at local and global levels.

241 14.5 Galerkin approximation

ue

ue = 1 . (14.28)

ue

∼

2

For instance in case of the second element the element array ue contains

∼

u2 u2

u2 = =

1 . (14.29)

u2

∼

u3

2

Clearly, in the case of quadratic elements the element array ue contains three

∼

unknowns, while for cubic elements ue contains four unknowns, and so on.

∼

Within each element a polynomial approximation for both the unknown func-

tion u( x) and the weighting function w( x) is introduced. Use of the shape function

approach as outlined in the previous section yields

n

uh | = Ni ( x) ue = N T ue , (14.30)

i ∼∼

e

i=1

n

wh | = Ni ( x) we = N T we , (14.31)

i ∼∼

e

i=1

where Ni are the shape functions

N T = [N1 N2 · · · Nn ] , (14.32)

∼

and ue and we contain the unknowns ue and the weighting values we , respectively,

i i

∼ ∼

associated with element e . The fact that the same shape functions (and hence

polynomial interpolation order) are chosen for both the unknown function uh and

the weighting function wh means that the so-called (Bubnov) Galerkin method is

used.

As a consequence of the interpolation of uh governed by the shape functions Ni ,

the differentiation of uh is straightforward since the nodal values ui are indepen-

dent of the coordinate x, while the shape functions Ni are simple, known, functions

of x:

n

duh d

= Ni ( x) ue

i

dx dx

e i=1

n

dNi ( x) e

= u

dx i

i=1

dN T

= ∼ ue . (14.33)

dx ∼

Numerical solution of one-dimensional diffusion equation

242

Clearly a similar expression holds for the weighting function:

dN T

dwh

= ∼

w. (14.34)

dx ∼ e

dx e

Substitution of this result into the left-hand side of Eq. (14.25) and considering

one element only yields:

dN T dN T

dwh duh

dx = ∼

we c ∼ ue dx

c

dx ∼

dx ∼

dx dx

e e

dN T

dN

= wT ∼ c ∼ ue dx

∼e

dx ∼

dx

e

dN dN T

= wT ∼

c ∼ dx ue . (14.35)

∼e ∼

dx dx

e

In the last step use has been made of the fact that we and ue are both independent

∼

∼

of the coordinate x. Likewise, the integral expression on the right-hand side of Eq.

(14.25) yields for a single element:

wh f dx = N T we f dx = wT N f dx. (14.36)

∼e

∼∼ ∼

e e e

Notice that the integral appearing on the right-hand side of Eq. (14.35) is in fact a

matrix, called the element coef¬cient or (in mechanical terms) stiffness matrix:

dN dN T

Ke = ∼

c ∼ dx. (14.37)

dx dx

e

Similarly, the integral on the right-hand side of Eq. (14.36) is the element array

corresponding to the internal source or distributed load:

f= N f dx. (14.38)

∼

∼e

e

Substitution of the expression for the element coef¬cient matrix and element

column in Eq. (14.25) yields

nel nel

= wT f e + B.

wT K e ue (14.39)

∼e ∼e

∼ ∼

e=1 e=1

Step 3. Assembling the global set of equations The individual element contri-

butions

wT K e ue , (14.40)

∼e ∼

using the local unknowns and weighting values (ue and we , respectively) only, may

∼ ∼

also be rewritten in terms of the global unknowns u and the associated weighting

∼

243 14.5 Galerkin approximation

ˆ

function values w. This can be done by introducing an auxiliary matrix K e on

∼

element level such that

ˆ

wT K e ue = wT K e u. (14.41)

∼e ∼ ∼

∼

To illustrate this, consider once more the element distribution of Fig. 14.4. For the

second element it holds that

2 2 u2

K11 K12

=

wT K 2 u2 w2 w2 1 (14.42)

∼2 2 2 u2

∼ 1 2 K21 K22 2

2 2

K11 K12 u2

= . (14.43)

w2 w3 2 2

K21 K22 u3

Notice that in Eq. (14.42) the local nodal values have been used, while in Eq.

(14.43) the global values have been used. Eq. (14.43) may also be rewritten as

2 2

K11 K12 u2

=

wT K 2 u2 w2 w3

∼2 2 2

∼

K21 K22 u3

⎡ ¤⎡ ¤

0 0 0 0 u1

⎢0 ⎥⎢ u ⎥

2 2

⎢ ⎥⎢ 2 ⎥

K11 K12 0

= ⎢ ⎥⎢ ⎥

w1 w2 w3 w4

⎣0 ¦ ⎣ u3 ¦

2 2

K21 K22 0

0 0 0 0 u4

ˆ

K2

ˆ

= wT K 2 u. (14.44)

∼

∼

Consequently,

Nel Nel

ˆ

=

wT K e ue wT K e u, (14.45)

∼e ∼ ∼

∼

e=1 e=1

ˆ

and by summing the individual K e matrices the result:

Nel

wT K e ue = wT K u, (14.46)

∼e ∼ ∼

∼

e=1

is obtained, with

Nel

ˆ

K= Ke. (14.47)

e=1

Numerical solution of one-dimensional diffusion equation

244

In the case of the element distribution of Fig. 14.4, it holds that

⎡ ¤

1 1

K11 K12 0 0

⎢1 ⎥

1

⎢ K21 K22 0 0 ⎥

ˆ

K1 = ⎢ ⎥ (14.48)

⎣0 0 0¦

0

0 0 00

⎡ ¤

0 0 0 0

⎢ ⎥

2 2