Professional Documents
Culture Documents
x
2
Z
x
2
x
1
dx
Z
x
2
x
1
xdx
!
=
=
1
x
2
x
1
_
_
x
2
(x
2
x
1
)
1
2
(x
2
2
x
2
1
)
_
_
=
1
2
(x
2
x
1
)
2
(x
2
x
1
)
Z
x
2
x
1
N
1
dx =
1
2
(x
2
x
1
)
Similarly,
Z
x
2
x
1
N
2
dx =
1
2
(x
2
x
1
)
Therefore,
Z
x
2
x
1
udx =
1
2
(x
2
x
1
)(u
1
+ u
2
)
The above result represents a simple application of the trape-
zoidal rule.
Optimal Fit of the Function to the Solution
The equations governing the behaviour of the function within an
element must be developed. These equations represent a t of the
function to the solution of the underlying dierential equation.
Several methods are available for this purpose but the Galerkin
method will be adopted in this case. The resulting element equa-
tions will often consist of a set of linear algebraic equations that
can be expressed in matrix form as
[k]{u} = {f}
where [k] is the element matrix, {u} is a column vector of nodal
unknowns and {f} is a column vector reecting the eect of any
external inuences, applied at the nodes.
Assembly
After the individual element equations are derived, they must
be linked together or assembled to characterize the unied be-
haviour of the entire system. The assembly process is governed
by the concept of continuity. That is, the solutions for adja-
cent elements are matched so that the unknown values at their
common nodes are equivalent. Thus, the total solution will be
continuous.
When all the individual elements are nally assembled, the entire
system is expressed in matrix form as
[K]{U} = {F}
where [K] is the global matrix, {U} and {F} are column vec-
tors containing the unknowns and external forces for the whole
system.
Boundary Conditions
Before the above system can be solved, it must be modied to
account for the boundary conditions of the problem.
Solution
Solutions of the nal system of simultaneous equations can be
obtained by direct or iterative methods.
Postprocessing
Upon obtaining a solution, it can be output in tabular form or
displayed graphically. In addition, secondary variables can be
determined and output.
Finite Element Application to a Simple Heat Con-
duction Problem
Apply the nite element method to solve the boundary-value
ODE
d
2
T
dx
2
= 0
given that T = 0
C at x = 0, T = 60
C at x = 30 cm. Divide
the region into 3 nite elements.
It can be noted that this simple problem has the exact solution
T = 2x, i.e. a linear function. Therefore, one linear nite el-
ement would be sucient to reproduce the exact solution; the
division into 3 elements used here is purely for illustration pur-
poses.
Element Equations
We start from the weighted residual statement:
Z
x
2
x
1
d
2
T
dx
2
dx = 0
for a generic element with end points x
1
, x
2
, with a weighting
function. Integrating by parts gives:
Z
x
2
x
1
d
2
T
dx
2
dx =
_
_
dT
dx
_
_
x
2
x
1
Z
x
2
x
1
dT
dx
d
dx
dx = 0
and since = 0 at the end points:
Z
x
2
x
1
dT
dx
d
dx
dx = 0
We now introduce the linear approximation for the temperature
T within the element
T = N
1
T
1
+ N
2
T
2
and, calling x
2
x
1
= h (the element length), we know that
dT
dx
=
1
h
(T
2
T
1
)
Since the Galerkin method will be used for derivation of the
element equations, the approximations for and its derivative
d/dx are the same as for the temperature,
= N
1
1
+ N
2
2
d
dx
=
1
h
(
2
1
)
Substituting the above expressions and integrating:
Z
x
2
x
1
dT
dx
d
dx
dx =
Z
x
2
x
1
1
h
2
(T
2
T
1
)(
2
1
)dx =
=
1
h
(T
2
T
1
)(
2
1
)
Therefore,
1
h
(T
2
T
1
)(
2
1
) = 0
or
1
h
(T
2
T
1
)
1
1
h
(T
2
T
1
)
2
= 0
But since
1
and
2
are arbitrary constants, the above equation
will only be satised if
1
h
(T
2
T
1
) = 0
and
1
h
(T
2
T
1
) = 0
The above can be written in matrix form as
_
_
1
h
1
h
1
h
1
h
_
_
_
_
T
1
T
2
_
_
=
_
_
0
0
_
_
and represent the element equations for the above problem.
The next step is the assembly of the global system. Before the
element equations are assembled, a global numbering scheme
must be established to specify the systems topology. As shown
in the table below, this denes the connectivity of the element
mesh. Because the present case is one-dimensional, the number-
ing scheme is trivial. However, for two- and three-dimensional
problems, it oers the only means to specify which nodes belong
to which elements.
Nodal Numbers
Element Local Global
1 1 1
2 2
2 1 2
2 3
3 1 3
2 4
Once the topology is specied, the element equations can be
written for each element and added one at a time to assemble
the total system matrix. This process is depicted below.
_
1
h
1
h
0 0
1
h
1
h
0 0
0 0 0 0
0 0 0 0
_
_
_
_
T
1
T
2
0
0
_
_
=
_
_
0
0
0
0
_
_
_
1
h
1
h
0 0
1
h
2
h
1
h
0
0
1
h
1
h
0
0 0 0 0
_
_
_
_
T
1
T
2
T
3
0
_
_
=
_
_
0
0
0
0
_
_
_
1
h
1
h
0 0
1
h
2
h
1
h
0
0
1
h
2
h
1
h
0 0
1
h
1
h
_
_
_
_
T
1
T
2
T
3
T
4
_
_
=
_
_
0
0
0
0
_
_
Introducing the boundary conditions, the system can be rewrit-
ten in the form
_
_
2
h
1
h
1
h
2
h
_
_
_
_
T
2
T
3
_
_
=
_
_
0
T
4
h
_
_
or, substituting h = 10, T
4
= 60:
_
_
0.2 0.1
0.1 0.2
_
_
_
_
T
2
T
3
_
_
=
_
_
0
6
_
_
The solution of the above system gives
T
2
= 20
C T
3
= 40
C
which are the exact values at these points, as expected.
Example 5
Apply the nite element method to solve the boundary-value
ODE
d
2
T
dx
2
+ T = 0
given that T = 100
C at x = 0, T = 0
C at x = 1 m. Divide
the region into 3 nite elements.
The exact solution of this problem is T = 100 cos x64.21 sin x.
The nite element solution with 3 linear elements will only pro-
vide an approximation in this case.
Element Equations
Weighted residual statement for a generic element with end points
x
1
, x
2
:
Z
x
2
x
1
_
_
_
d
2
T
dx
2
+ T
_
_
_ dx = 0
Integrating by parts gives
Z
x
2
x
1
_
_
dT
dx
d
dx
+ T
_
_
dx = 0
Linear approximation for T and :
T = N
1
T
1
+ N
2
T
2
dT
dx
=
1
h
(T
2
T
1
)
= N
1
1
+ N
2
2
d
dx
=
1
h
(
2
1
)
Substituting the above expressions and integrating:
Z
x
2
x
1
dT
dx
d
dx
dx =
Z
x
2
x
1
1
h
2
(T
2
T
1
)(
2
1
)dx =
=
1
h
(T
2
T
1
)(
2
1
)
Z
x
2
x
1
Tdx =
Z
x
2
x
1
(N
1
T
1
+ N
2
T
2
)(N
1
1
+ N
2
2
)dx =
= T
1
1
Z
x
2
x
1
N
2
1
dx + T
1
2
Z
x
2
x
1
N
1
N
2
dx+
T
2
1
Z
x
2
x
1
N
2
N
1
dx + T
2
2
Z
x
2
x
1
N
2
2
dx
The above integrals are more easily evaluated using the natural
coordinate , given by
=
2x x
2
x
1
x
2
x
1
with a dimensionless coordinate such that = 1 at x =
x
1
, = +1 at x = x
2
. The inverse relationship is of the form
x =
1
2
[(x
2
x
1
) + x
2
+ x
1
]
which can also be written in the form
x =
1
2
(1 ) x
1
+
1
2
(1 + ) x
2
= N
1
x
1
+ N
2
x
2
The above expression implies that the element geometry is also
approximated using linear functions. In this context, the func-
tions N
1
and N
2
are usually called shape functions. Elements
for which shape and interpolation functions are the same are
called isoparametric elements.
From the above denition, it can be seen that
dx
d
=
1
2
(x
2
x
1
)
dx =
1
2
(x
2
x
1
) d =
h
2
d
The integrals can now be evaluated as follows:
Z
x
2
x
1
N
2
1
dx =
h
8
Z
1
1
(1 )
2
d =
=
h
8
"
Z
1
1
d 2
Z
1
1
d +
Z
1
1
2
d
#
=
=
h
8
_
_
2
+
3
3
_
_
1
1
=
h
3
Performing similar calculations:
Z
x
2
x
1
N
1
N
2
dx =
h
6
Z
x
2
x
1
N
2
2
dx =
h
3
Therefore, the element equations in this case are given by
1
h
(T
2
T
1
)(
2
1
) +
h
3
(T
1
1
+T
2
2
) +
h
6
(T
1
2
+T
2
1
) = 0
or, collecting terms,
_
_
1
h
(T
2
T
1
) +
h
3
T
1
+
h
6
T
2
_
_
1
+
+
_
_
1
h
(T
2
T
1
) +
h
3
T
2
+
h
6
T
1
_
_
2
= 0
But since
1
and
2
are arbitrary constants, the above equations
will only be satised if
1
h
(T
2
T
1
) +
h
3
T
1
+
h
6
T
2
= 0
and
1
h
(T
2
T
1
) +
h
3
T
2
+
h
6
T
1
= 0
The above can be written in matrix form as
_
_
h
3
1
h
h
6
+
1
h
h
6
+
1
h
h
3
1
h
_
_
_
_
T
1
T
2
_
_
=
_
_
0
0
_
_
and represent the element equations for the above problem.
Substituting the following values for h = 1/3:
h
3
1
h
=
1
9
3 =
26
9
h
6
+
1
h
=
1
18
+ 3 =
55
18
and assembling, the global system of equations takes the form
_
26
9
55
18
0 0
55
18
52
9
55
18
0
0
55
18
52
9
55
18
0 0
55
18
26
9
_
_
_
_
T
1
T
2
T
3
T
4
_
_
=
_
_
0
0
0
0
_
_
Introducing the boundary conditions T
1
= 100
C, T
4
= 0
C, the
system can be rewritten in the form
_
_
52
9
55
18
55
18
52
9
_
_
_
_
T
2
T
3
_
_
=
_
5500
18
0
_
_
The solution of the above system gives
T
2
= 73.4
C T
3
= 38.8
C
which can be compared to the exact values at these points
T
2
= 73.5
C T
3
= 38.9
C
One advantage of the nite element method is that the element
equations are general, for any discretization. If the region is now
divided into 5 elements rather than 3, the equations
_
_
h
3
1
h
h
6
+
1
h
h
6
+
1
h
h
3
1
h
_
_
_
_
T
1
T
2
_
_
=
_
_
0
0
_
_
are still valid with h = 1/5 in this case. Using this value now
gives
h
3
1
h
=
1
15
5 =
74
15
h
6
+
1
h
=
1
30
+ 5 =
151
30
After assembling, the global system of equations takes the form
_
74
15
151
30
0 0 0 0
151
30
148
15
151
30
0 0 0
0
151
30
148
15
151
30
0 0
0 0
151
30
148
15
151
30
0
0 0 0
151
30
148
15
151
30
0 0 0 0
151
30
74
15
_
_
_
_
T
1
T
2
T
3
T
4
T
5
T
6
_
_
=
_
_
0
0
0
0
0
0
_
_
Introducing the boundary conditions T
1
= 100
C, T
6
= 0
C, the
system becomes
_
148
15
151
30
0 0
151
30
148
15
151
30
0
0
151
30
148
15
151
30
0 0
151
30
148
15
_
_
_
_
T
2
T
3
T
4
T
5
_
_
=
_
15100
30
0
0
0
_
_
The solution of the above system gives
T
2
= 85.2
C T
3
= 67.1
C T
4
= 46.3
C T
5
= 23.6
C
which coincide with the exact values at these points.