Académique Documents
Professionnel Documents
Culture Documents
d 0
0
(4)
Integrating the first term in equation (4) by parts gives
EAu w x EAu w EAu w x
L
L
L
[ ]
d d
0
0
0
(5)
Using equation (3) and noting that we assumed w(0) = 0, equations (4) and (5) give
pw E Au w x Pw L
L
( ) +
0
0 d ( ) (6)
Equation (6) is the virtual work theorem for the bar, with w(x) being interpreted as the virtual
displacement. The equation is true for the exact solution, u
ex
, coupled with all continuous
w(x) subject to w(0) = 0. Thus, the solution of equation (6) satisfies equations (1)(3) pro-
vided it is continuous.
Fig. 1. Sign convention for axially loaded bar.
Untitled-4 10/2/00, 3:27 pm 15
*
Integration by parts in the current context.
( ) u 0 0 such that
pw E Au w x Pw L
L
( )
+
( )
0
0 d (7)
for all w(x) from U(x) with w(0) = 0.
Equation (7) is the weak form of the problem [5], and is a more general version of the
original statement of the problem in equations (1)(3). In particular, equation (7) still makes
sense even if
( ) u x does not possess a second derivative. However, if the set U(x) includes
the exact solution, and the solution of equation (7) possesses a second derivative, then the
solution of equation (7) is also the solution of equations (1)(3). For an approximate
solution, U(x) is restricted to a finite set of suitable functions, typically polynomials, and
equation (7) is satisfied for these functions only.
The above derivation critically relies on integration by parts, and yet there is disagree-
ment in the literature on its use or value. For example, Strang and Fix [6, p. 10] state that
indeed the whole theory of differential operators rests on this rule. In contrast, having
written an equation analogous to equation (4) above, Ames [7, p. 29] states that it is useful,
but not mandatory, to apply Greens theorem
*
to incorporate second and third boundary
conditions
although he does not elaborate further on this point. Finally, Mohr [8, p. 414]
states that the Galerkin method will yield better results if integration by parts is used to
reduce the order of the governing differential equation.
The usual justification for the integration by parts is that
(a) it allows approximation functions with lower continuity requirements and this is
crucial for finite elements, and
(b) it allows the natural boundary conditions to be incorporated into the formulation.
While this is true from a theoretical point of view, and the final result (equation (7)) is
correct, from a teaching point of view the preceding formulation is likely to be confusing or
misleading.
Firstly, although equation (7) was derived from equation (4), the two equations are not
generally equivalent for u u
0
0
(8)
Secondly, the derivation seems to imply that the natural boundary condition will be
satisfied exactly by the approximate solution since it was incorporated in the derivation via
equation (5). Again, this is not generally the case. For example, using the above approxima-
tion in equation (7) leads to E Au L pL
,
(
( )
(
( )
+ < <
0
0
(9)
For the exact solution we have
R u R u R u
D ex P ex U ex
( ) ( ) ( ) 0 (10)
but for the approximation we have, in general,
R u R u R u
D P U
(
) , (
) , (
) 0 0 0 (11)
Note that R
D
is defined over an interval whereas R
P
and R
U
are point functions.
The goal of any approximation scheme is to force the residuals in equation (9) to zero in
some sense. There is considerable latitude in choosing the criterion to be used, for example
collocation and least squares methods are also used [9]. One possible formulation is to
satisfy
R u w x
R u w
R u w
L
D D
P P
U U
d (
)
(
)
(
)
0
0
0
0
(12)
for some specified weights w
D
(x), w
P
and w
U
. Note that w
P
and w
U
are not strictly required
in equation (12), but they are required in the following development for dimensional
consistency.
While this type of formulation is quite general, it is likely to be too demanding. For
example, using a one-parameter approximation
) (
) (
) + +
0
0 (13)
Untitled-4 10/2/00, 3:27 pm 17
In this approach it is clear that, in general, we no longer will force each residual to be zero
identically. Equation (13) is a general formulation that includes all possible errors arising
from the approximation. However, it is common practice to satisfy the essential boundary
condition, i.e. to enforce R u
U
(
0
0
D P
d (15)
To discuss the accuracy of the approximate solution, we will introduce two errors
measures. The displacement error is defined as
u
px L x
EA
ex
( ) 2
2
(19)
The magnitude of w
P
determines the relative importance associated with the errors in the
differential equation and the natural boundary condition (see equation (15)). Hence, there is
no unique best value of w
P
. We can study the influence of w
P
by considering the resulting
error in the approximation. For the problem under consideration, the exact solution is
However, from the physical situation we expect a positive displacement of the bar under this
loading, and hence C should be positive. Hence, we conclude from equation (17) that
w
P
> 0 (18)
C
pL
EAw
2
2
P
(17)
We can simplify equation (16) by choosing w
P
= w
D
(L). Making this choice gives
equation (7), and the above derivation reduces to the standard formulation. However, the
derivation avoids the conceptual difficulties associated with the usual derivation. It is clear
from the above derivation that the natural boundary condition will not generally be exactly
satisfied, and that integration by parts has been used as a simplifying tool. It also clarifies the
issue of signs in the various terms in equation (15). This contrasts with derivations that start
with a combined weighted residual equation such as equation (15) with w
P
= w
P
(L), but
without any justification for the signs of the terms in the equation, e.g. [11, p. 84]. Finally, it
shows that Galerkins method arises from one possible choice for w
P
, and hence other
choices for w
P
could be explored.
Further motivation for the choice w
P
= w
D
(L) can be provided as follows. We consider
the case p = constant and P = 0, together with a linear approximation
( ) , u x Cx and corre-
sponding weight function w(x) = x. In this case, equation (16) gives
pw EAu w x EAu L w L P EAu L w
L
D D D P
d
( )
+ +
( )
( ) ( )
( )
0
0 (16)
Integrating the first term in equation (15) by parts gives
R u w x R u w
L
D D P P
d (
) (
) +
0
0 (14)
or
18 J. Petrolito
International Journal of Mechanical Engineering Education Vol 28 No 1
Untitled-4 10/2/00, 3:27 pm 18
E u u x
L
u ex
d
)
0
2
(20)
Noting that the strain energy in the bar, U, is given by
U
EA
u x
L
2
2
0
( ) d (21)
the strain energy error is defined as
E u u x
L
s ex
d
)
2
0
(22)
The variations of E
u
and E
s
with w
P
are shown in Fig. 2. We can see from the figure that
there is an optimum value of w
P
depending on which error we choose to minimize. Choosing
the value of w
P
according to Galerkins method is equivalent to minimizing the strain energy
error, as is well-known [9]. A different optimum value of w
P
arises if we choose to minimize
the displacement error. For the present example, the optimum values are
Fig. 2. Energy and displacement errors for continuous example.
w L E
L
E
P s
P u
for minimum (Galerkin' s method)
w for minimum
4
5
(23)
International Journal of Mechanical Engineering Education Vol 28 No 1
Approximate solutions of differential equations using Galerkins method 19
Untitled-4 10/2/00, 3:27 pm 19
The resulting approximate displacements associated with these optimum values are shown
in Fig. 3, together with the exact solution. While Galerkins method produces exact nodal
displacements for this example, it results in a large relative error in the displacement at other
points. In contrast, minimizing E
u
produces smaller errors in displacement on average
throughout the whole bar. Of course, in a practical problem the exact solution is unknown,
and we would not be able to determine the optimum value of w
P
associated with E
u
.
However, the calculations confirm that, in principle, other choice for w
P
are possible.
We can extend the above ideas to a multi-parameter approximation. In this case, we
assume that the approximate displacement is taken as
( ) u x C
j j
j
N
1
(24)
where N is the number of unknown parameters, and each
j
x ( ) is an independent basis
function. Since we have N unknowns, equation (14) is replaced by
Integrating by parts gives
Fig. 3. Solutions for continuous example.
R u w x R u w j N
j
L
j D D P P
d (
) (
) , , , ,
0
0 1 2
+ (25)
20 J. Petrolito
International Journal of Mechanical Engineering Education Vol 28 No 1
Untitled-4 10/2/00, 3:27 pm 20
pw EAu w x EAu L w L P EAu L w
j j
L
j j D D D P
d
( )
+ +
( )
( ) ( )
( ) ,
0
0
j N 1 2 , , , (26)
Equation (26) reduces to Galerkins method if we use w
Pj
= w
Dj
(L), giving
pw EAu w x Pw L j N
j j
L
j D D D
d
( )
+
( ) , , , ,
0
0 1 2 (27)
where N is the total number of mesh variables.
5. APPLICATION TO FINITE ELEMENTS
We now extend the above discussion to finite elements. For this purpose, we consider a two-
element discretization as shown in Fig. 4. This discretization is sufficient to illustrate the
features of the finite element formulation.
Fig. 4. Two-element discretization for bar.
We assume that the approximate displacement is piecewise-continuous at x = a, and
identically satisfies the essential boundary condition
( ) . u 0 0 The derivative,
( ), u x is
generally discontinuous at x = a, and the natural boundary condition at x = L is not identi-
cally satisfied by the approximation. Finally, the second derivative of
( ) u x is undefined in
the classical sense at x = a.
For the stated assumptions, the residuals are
R u EAu p x a
R u EAu p a x L
R u EA u a u a
R u P EAu L
D1
D2
I
P
(
,
(
,
(
( )
( )
(
( )
+ < <
+ < <
( )
+
0
(28)
where
( )
+
u a is the derivative of
( )
u a is the
derivative of
u at a point just to the left of x = a.
As for the continuous case, we generally cannot force each residual to zero identically.
Hence, we introduce piecewise-continuous weight functions, w
Dj
(x), such that
w
Dj
(a
+
) = w
Dj
(a
) (
) (
) (
) ,
, , ,
+ + +
+
(29)
International Journal of Mechanical Engineering Education Vol 28 No 1
Approximate solutions of differential equations using Galerkins method 21
Untitled-4 10/2/00, 3:27 pm 21
Since the approximate displacement and weight functions are continuous within each
element, integration by parts gives
EAu w x EAu w x EAu a w a
EAu w x EAu w x EAu L w L EAu a w a
j
a
j
a
j
j
a
L
j
a
L
j j
( ) ( )
( ) ( )
( ( )
)
+
+
+ +
+
D D D
D D D D
d d
d d
0 0
(30)
Combining equations (28)(30) and noting that the products
u w
j D
and pw
Dj
are well-
defined over the entire interval (0, L) gives
pw EAu w x EAu a w a EAu L w L
EAu a w a EA u a u a w
P EAu L w j N
j j
L
j j
j j
j
D D D D
D I
P
d
( )
+ +
+
( )
+
( )
+ +
( ) ( )
( ) ( )
( ) ( )
( )
( )
( ) , , , ,
0
0 1 2
(31)
As before, we can simplify equation (31) by choosing w
Ij
= w
Dj
(a) and w
Pj
= w
Dj
(L), giving
pw EAu w x Pw L j N
j j
L
j D D D
d
( )
+
( ) , , , ,
0
0 1 2 (32)
which is the same equation as for the continuous case (equation (27)).
We can again study the influence of w
Ij
and w
Pj
on the solution for the example problem.
For simplicity, we approximate the displacement by a piecewise-linear function, and use
elements of equal lengths (see Fig. 5(a)). Hence,
( ) ( ) ( ) u x x C x C +
1 1 2 2
(33)
where the basis functions
1
( ) x and
2
( ) x are shown in Fig. 5(b). Applying equation (31)
and w
Dj
(x) taken as each basis function in turn gives
2
2
2 4
2
1
1
2
1
2
EA
L
w w w w
w w w w
C
C
pL I P1 P1 I1
I2 P P2 I2
1
]
1
1
'
'
(34)
or
KC = R (35)
It is clear from equation (34) that not all choices for the point weights will work. For
example, the choice w
I1
= w
I2
, w
P1
= w
P2
leads to an inconsistent set of equations. For a
unique solution, we require K to have a nonzero determinant, that is
det( ) K w w w w
I1 P2 P1 I2
0 (36)
We also see that K is not symmetrical for arbitrary values of the weights, which is a
computational disadvantage for large problems. For a symmetrical K, we require
2w
I2
w
I1
w
P1
w
P2
= 0 (37)
Solving equation (34) gives
22 J. Petrolito
International Journal of Mechanical Engineering Education Vol 28 No 1
Untitled-4 10/2/00, 3:27 pm 22
Fig. 5. Piecewise linear approximation and associated basis functions.
(39)
C
pL w w w w
EA w w w w
C
pL w w w w
EA w w w w
1
2
2
2
2 4 2
8
2 2
8
+
( )
( )
+
( )
( )
I1 I2 P1 P2
I1 P2 I2 P1
I1 I2 P1 P2
I1 P2 I2 P1
(38)
We can again attempt to find the optimum values of the weights based on minimizing either
E
s
or E
u
. In this case, the optimum values of the weights are
w
w
w w w w E
w
w
w
w
w w E
I1
P1
P2 I2 I2 P1 s
I1
P1
P2
I2
I2 P1 u
and arbitrary, for minimum
and arbitrary, for minimum
+
1
2
1 2
7
8
13
32
14
13
32
13
, ,
, ,
International Journal of Mechanical Engineering Education Vol 28 No 1
Approximate solutions of differential equations using Galerkins method 23
Untitled-4 10/2/00, 3:27 pm 23
C
pL
EA
C
pL
EA
E
C
pL
EA
C
pL
EA
E
1
2
2
2
1
2
2
2
3
8 2
45
112
29
56
,
,
for minimum
for minimum
s
u
(40)
The resulting optimum displacements are shown in Fig. 6, and show a similar trend to the
results for the continuous case.
Fig. 6. Solutions for finite element example.
24 J. Petrolito
There is no unique solution for the weights in both cases. Galerkins method uses the
solution for minimum E
s
together with w
I2
= w
P1
= 0. This choice also results in a symmetri-
cal K matrix.
In contrast to the weights, the resulting optimum values of the displacement parameters
are unique, and are given by
International Journal of Mechanical Engineering Education Vol 28 No 1
R u w x R u w j N
L
j j D D P P
d
0
0 1 2
+ (
) (
) , , , , (41)
In the above formulation, the inter-element residual, R
I
, was explicitly included, and
differential equation residuals, R
D1
and R
D2
, were defined for each element. An alternative
approach is to define the differential equation residual over the entire region, and take the
weighted residual scheme as
Untitled-4 10/2/00, 3:27 pm 24
However, since
u at x = a, we have
R u w x R u w x R u w x R w a
L
j j
a
a
L
j j D D D D D D I D
d d d
0 0
+ +
+
(
) (
) (
) ( ) (43)
Combining equations (41) and (43) gives
R u w x R u w x R w a R u w
j N
j
a
a
L
j j j D D D D I D P P
d d (
) (
) ( ) (
) ,
, , ,
0
0
1 2
+
+ + +
(44)
Comparing equations (29) and (44), we see that in this approach w
Ij
does not explicitly
appear as it is automatically set equal to w
Dj
(a). This approach is therefore slightly less
general than the previous one.
The treatment of the inter-element residual, R
I
, varies considerably in textbooks. Most
books ignore R
I
by simply starting with equation (7), and disregard the fact that the integra-
tion by parts in equation (5) is not valid for the discontinuous case. Some authors include R
I
,
but then either claim or assume it is zero on the basis of the exact solution having a
continuous first derivative at the inter-element boundaries. Neither treatment is logically
consistent. Again, the problems stem from basing the derivation on only the differential
equation error, rather than all possible errors.
REFERENCES
[1] Livesley, R. K., Finite Elements: An Introduction for Engineers, Cambridge University Press,
Cambridge, 1983.
[2] Becker, E. B., Carey, G. F., and Oden, J. T., Finite Elements: An Introduction, Prentice Hall,
Englewood Cliffs, NJ, 1981.
[3] Mikhlin, S. G., Variational Methods in Mathematical Physics, Pergamon Press, New York, 1963.
[4] Finlayson, B. A., The Method of Weighted Residuals and Variational Principles, Academic Press,
New York, 1972.
[5] Stakgold, I., Greens Functions and Boundary Value Problems, WileyInterscience, New York,
1979.
6. CONCLUSIONS
The paper has discussed some of the issues that arise in the derivation of approximate
methods for the solution of differential equations. The usual textbook approach to Galerkins
method can be misleading, and fails to highlight all the possible errors that arise in an
approximation scheme. A general weighted residual method has been presented that explic-
itly includes all possible errors. In this way, all the inherent approximations are made trans-
parent to students. The conventional form of Galerkins method was shown to be just one
particular case of this method. An example was studied to demonstrate the effect of the point
weights on the approximation.
International Journal of Mechanical Engineering Education Vol 28 No 1
Approximate solutions of differential equations using Galerkins method 25
where in this case
R u EAu p x L
D
(