You are on page 1of 7

The method of weighted residuals: 1 dimension

The finite element method originally evolved as a tool for computation of structural analysis problems.
However, today it is applied to diverse research areas like machines, waveguides, semiconductor
devices, EM radiation, etc. It is a powerful and versatile method. It can effectively handle problems
including complex geometries and inhomogeneous media. Its greatest strength is that it is relatively
easy to develop a general purpose computer program for solving a wide range of problems.
The solution method is first meshed into small domains or elements. We may have one-dimenional,
two-dimensional or three-dimensional elements depending on the dimension in which we seek a
solution.

We then need to derive the governing equation for a single typical element. Let us first discuss methods
for doing just that.

Method of weighted residuals

Let us first look at the method of weighted residuals for ordinary differential equations. Let us, for the
moment, limit ourselves to a one-dimensional problem. Let us consider the following sample problem:

d 2u
u = x, 0 < x < 1
2
dx
u (0) = 0, u (1) = 0

1. In this method, the first step is to assume an arbitrary trial function with unknown coefficients.
In this case, let us assume a trial function

u~ = ax(1 x)
The trial function is so chosen that it satisfies the boundary conditions, i.e. at x=0 and x=1.
The accuracy of the solution elsewhere in the domain, will, of course, depend on the choice of the trail
function. This may be a difficult task, given that the nature of the solution is unknown. In any case, w
would like to have a trial function that is simple.
2. Once a trial function is selected, the next step is to obtain the residual by substituting the trial
function into the original equation.

R=

d 2u~
u + x = 2a ax(1 x) + x
dx 2

With the exact solution, The residual should have been gone to zero. This does not happen with the
trial function, since it does not satisfy the equation exactly except at the boundaries.
3. The next step is to determine the unknown constant a such that trial function best
approximates the exact solution over the entire domain. In the method of weighted residuals,
this is done by choosing an appropriate weighting function w and then setting the weighted
average of the residual over the problem domain to zero.
1
1
1
d 2u~

I = wR dx = w 2 u~ + x dx = w{2a ax(1 x) + x} dx =0
dx

0
0
0

4. The next step is to decide the weighting function. Various methods of weighted residuals use
different techniques to choose the weight function. In the Least squares method, =
However, in the Galerkins method,

du~ . So, for the chose problem above,


w=
da

w = x(1 x)
And so the trial function reduces to

u~ = 0.2272 x(1 x)
This gives values which math reasonably well with the exact solution.

Weak Formulation and Piecewise continuity


Before applying the method of weighted residuals to Galerkins finite element formulation, we
need to learn the concept of weak formulation.
Continuing with the previous example, it may be noted that we applied the method of weighted
residuals to the equation as is, without modifying it in any way. This is called the strong
formulations. This then, in this case, required the evaluation of the weighted integral of the
second order derivative ( the highest order of derivative in the given equation).
i.e. 1 d 2u~

w dx
0

dx

Thus, we automatically impose the constraint that the integral of the highest order of the
derivative in the equation must have a non-zero finite value i.e. the trial function in the above
equation should be twice differentiable, and it second derivative should not vanish. This
requirement can be reduced by attempting to reduce the order of the highest derivative.
Applying integration by parts to the above term in the residual, we get
1
1
1
1
d 2u~

dw du~

du~
wu~ + xw dx + w =0
I = wR dx = w 2 u~ + x dx =
dx dx

dx 0
dx

0
0
0

As is obvious, the requirement now is only for the first order derivative. This formulation , in
which, in integrating the weighted residual over the domain, the highest order of the derivative
is reduced by one, is called the weak formulation. For a given trial function, both the strong and
weak formulation would normally yield the same accuracy.
The choice of the trial function presents a dilemma. Normally, in the absence of a knowledge of
the exact solution, it is difficult to predict the nature of the trial function that would give the
best approximations. But we have seen earlier, that a polynomial of any order might be wellapproximated by a piecewise linear function, provided we the pieces are small and their number
large. So therefore, to begin with, let us consider a piecewise linear function in one domain.

( x xi 1 ) / hi

i ( x) = ( xi +1 x) / hi +1
0

for xi i x xi
for xi x xi +1
otherwise

Further, we choose the trial function as a combination of the above linear functions.

u~ ( x) = 1 ( x)a1 + 2 ( x)a 2

The constants a1 and a2 are unknown constants that need to be determined.


1
1 (3),
0

1
2
= (2 3) + (3 1),

2
1
3
3

2 (3 3),
1

3
Using Galerkins method as before ( w =

du~
),
da

we obtain the weight functions as


(3),

1
3

2
1
1 = (2 3),

3
3

0,
1

And

2 =

0,

(3 1),

(3
3),

1
3

1
2

3
3
2
1
3

Thus, we obtain a particular nature of weight functions.

Galerkins method of weighted residuals

Let us now look at the formulation of the Galerkins method of weight residuals in a systematic manner.
Here, let us express the piecewise continuous functions in terms of the nodal variables, rather than in
terms of generalized coefficients ( a1 and a2). Let us consider a typical linear one-dimensional element
conained beten two nods. At the nodes ( xi and x i+1), the nodal variables ui and u i+1 are assigned.

Let us also assume a linear trial function over the element.

u = c1 x + c2
u ( xi ) = c1 xi +c 2 =u i
u ( xi +1 ) = c1 xi +1 +c 2 =u i +1

c1 =

ui +1 ui
xi +1 xi

c2 =

ui xi +1 ui +1 xi
xi +1 xi

Substituting the expressions for the coefficients thus obtained in the original linear trial function, we get

u = H i ( x)ui + H i +1 ( x)ui +1
H i ( x) =

xi +1 x
hi

H i +1 ( x) =

x xi
hi

hi = xi +1 xi

These will be called the shape functions and are identical to the weight functions obtained in the
previous section.
Thus we can conclude the following about the nature of the shape functions.

The shape function associated with node i has a unit value at node i and vanishes at other nodes. The
variation over the element is linear.

H i ( xi ) = 1, H i ( x j ) = 0
The sum of all shape functions is unity.
n

H ( x) = 1
i

i =1

Let us consider the following equation and apply the above method to this.

d 2u
du
+b
+ cu = f ( x), 0 < x < L; u (0) = u (1) = 0
2
dx
dx

We obtain the residual in weak form, by using integration by parts, and then setting the integration of
the weighted residual to zero.
L

du
dw du

du
0 a dx dx + bw dx + cwu dx = 0 wf ( x)dx aw dx
0
L

We assume that

u = H i ( x)ui + H i +1 ( x)ui +1
Written in matrix form, this is equivalent to:

+1 ] =[][]

= [

+1

w=[]

In the above equation, we need to evaluate the derivatives of u and w.


Doing so, and putting in the above equation, we have
LHS=[ ][], where

[K ] = aHH [H H ] + bHH [H H ] + cHH [H


xi +1

xi

H 2 ] dx

Is the local stiffness matrix.

[K ] = ha 11
e

Further rhs=

F =
e

xi +1

xi

1 b 1
+
1 2 1

1 chi 2
+
1 6 1

H
h 1
f ( x) 1 dx = i ,
2 1
H 2

is the local force vector.

1
2

if f ( x) = 1.

You might also like