−1.5 −1 −0.5 0 0.5 1 1.5
−1.5
−1
−0.5 0 0.5 1 1.5
−3
−2
−1 0 1 2 3
−1.5 −1 −0.5 0 0.5 1 1.5
−3
−2
−1 0 1 2 3
Figure 4.1: The Chebyshev polynomial viewed as a function Cm(θ) on the unit disk eiθ and when projected on thexaxis,i.e., as a function of x= cos(θ). Shown form= 15.
In general there is no way to use the FFT to solve polynomial interpolation problems, since the Fourier transform is based on “trigonometric polynomials” rather than algebraic polynomials. However, the Chebyshev polynomials are very special and have the property that forxin the range−1≤x≤1,
Tm(x) = cos(marccosx). (4.17)
This does not look much like a polynomial, but it is because cos(mθ) can be written as a polynomial in cos(θ) using trig identities, and then setx= cos(θ). Now consider the function
Cm(θ) = cos(mθ) = Re(eimθ) (4.18)
for 0≤θ≤π. We can view this as a function defined on the upper half of the unit circle in the complex plane. It is a function that passes through zero at the points
θ˜j =(j−1/2)π
m . (4.19)
Note that the roots (4.12) of the Chebyshev polynomial Tm are just ξj = cos(˜θj) and in fact the Chebyshev polynomial is just the projection onto the x-axis of the function Cm(θ); see Figure 4.1.
Sincex= cos(θ), this correspondence givesθ= arccos(x), resulting in (4.17).
The function Cm(θ) equioscillates between the values ±1 at the points θj =jπ/(m+ 1) and the projection of these points onto thex-axis gives the interpolation points (4.16). In order to use the FFT, we interpret the data values Uj = u(xj) as being function values at the points θj on the unit circle.
Our polynomial approximation on the real line can be reinterpreted as a trigonometric polynomial on the unit circle, and so we want to compute a Fourier transform of this data on the unit circle. Since the points θj are equally spaced on the unit circle, the FFT can be applied to accomplish this. More details may be found in [Tre00], for example.
It is quite remarkable that interpolating at the Chebyshev points, which is optimal from the ap-proximation standpoint, also allows the use of Fourier transform techniques to solve this polynomial problem. Of course this is not just coincidence, but a full understanding of the underlying mathematics goes beyond the scope of these notes.
method is typically based on some “weak form” of the differential equation, which roughly speaking means that we have integrated the equation. Here we give only a very superficial introduction to the finite element method.
Consider, for example, the heat conduction problem in one dimension with a variable conductivity κ(x) so the steady-state equation is
(κu0)0 =f. (4.20)
Again for simplicity assume that the boundary conditions are u(0) = u(1) = 0. If we multiply both sides of the equation (4.20) by an arbitrary smooth function v(x) and integrate the resulting product over the domain [0,1], we obtain
Z 1 0
(κ(x)u0(x))0v(x)dx= Z 1
0
f(x)v(x)dx. (4.21)
On the left-hand side we can integrate by parts. Since v is arbitrary, let’s restrict our attention to v that satisfyv(0) =v(1) = 0 so that the boundary terms drop out, yielding
− Z 1
0
κ(x)u0(x)v0(x)dx= Z 1
0
f(x)v(x)dx. (4.22)
It can be shown that if u(x) satisfies this equation for all v in some suitable class of functions, then u(x) is in fact the solution to the original differential equation.
Now suppose we replaceu(x) by an approximationU(x) in this expression, whereU(x) is a linear combination of specified basis functions,
U(x) =
m
X
j=1
cjφj(x). (4.23)
Let’s suppose that our basis functions are chosen to satisfy φj(0) =φj(1) = 0, so thatU(x) automati-cally satisfies the boundary conditions regardless of how we choose thecj. Then we could try to choose the coefficientscjinU(x) so that the equality (4.22) is satisfied for a large class of functionsv(x). Since we only havemfree parameters, we can’t require that (4.22) be satisfied for all smooth functionsv(x), but we can require that it be satisfied for all functions in somem-dimensional function space. Such a space is determined by a set of mbasis functionsψi(x) (which might or might not be the same as the functions φj(x)). If we require that (4.22) be satisfied for the special case wherev is chosen to be any one of these functions, then by linearity (4.22) will also be satisfied for anyv that is an arbitrary linear combination of these functions, and hence for allv in thism-dimensional linear space.
Hence we are going to require that
− Z 1
0
κ(x)
m
X
j=1
cjφ0j(x)
ψ0i(x)dx= Z 1
0
f(x)ψi(x)dx (4.24)
fori= 1, 2, . . . , m. We can rearrange this to give
m
X
j=1
Kijcj= Z 1
0
f(x)ψi(x)dx (4.25)
where
Kij =− Z 1
0
κ(x)φ0j(x)ψ0i(x)dx. (4.26) The equations (4.25) fori= 1, 2, . . . , mgive anm×mlinear system of equations to solve for the cj, which we could write as
Kc=F
58 Function Space Methods
(a) PSfrag replacements
xj
xj−1 xj+1
φj(x) φj−1(x)
(b) xj−1
xj+1
φj(x) φj−1(x)
x0 x1 x2
c1 c2
c3
c4
c5
c6
Figure 4.2: (a) Two typical basis functionsφj−1(x) andφj(x) with continuous piecewise linear elements.
(b)U(x), a typical linear combination such basis functions.
with
Fi= Z 1
0
f(x)ψi(x)dx. (4.27)
The functionsψi are generally called “test functions” while the basis functionsφi for our approximate solution are called “trial functions”. Frequently the same basis functions are used for both spaces. The resulting method is known as theGalerkin method. If the trial space is different from the test space we have aPetrov-Galerkin method.
Example 4.2. As a specific example, consider the Galerkin method for the above problem with basis functions defined as follows on a uniform grid with xi =ih, andh= 1/(m+ 1). Thej’th basis functionφj(x) is
φj(x) =
(x−xj−1)/h if xj−1≤x≤xj
(xj+1−x)/h if xj ≤x≤xj+1
0 otherwise
(4.28) Each of these functions is continuous and piecewise linear, and φj(x) takes the value 1 at xj and the value 0 at all other nodesxi fori6=j. (See Figure 4.2(a).) Note that any linear combination (4.23) of these functions will still be continuous and piecewise linear, and will take the value xi at the pointxi
sinceU(xi) =P
jcjφj(xi) =cisince all other terms in the sum are zero. Hence the function U(x) has the form shown in Figure 4.2(b).
The set of functions {φj(x)} form a basis for the space of all continuous piecewise linear functions defined on [0,1] withu(0) =u(1) = 0 and with kinks at the pointsx1, x2, . . . , xm, which are called thenodes. Note that the coefficientcj can be interpreted as the value of the approximate solution at the pointxj.
To use these basis functions in the Galerkin equations (4.24) (with ψj =φj), we need to compute the derivatives of these basis functions and then the elements of the matrixK and right-hand sideF. We have
φ0j(x) =
1/h if xj−1< x < xj
−1/h if xj< x < xj+1
0 otherwise.
For general functionsκ(x) we might have to compute an approximation to the integral in (4.26), but as a simple example consider the case κ(x)≡1 (so the equation is justu00(x) =f(x)). Then we can compute that
Kij=− Z 1
0
φ0j(x)φ0i(x)dx=
1/h if j =i−1 orj =i+ 1,
−2/h if j=i, 0 otherwise.
The matrixK is quite familiar (except for the different power ofh):
K= 1 h
−2 1
1 −2 1
1 −2 1
. .. ... ...
1 −2 1
1 −2
. (4.29)
In some cases we may be able to evaluate the integral in (4.27) for Fi explicitly. More generally we might use a discrete approximation. Note that sinceφi(x) is nonzero only nearxi, andR1
0 φi(x)dx=h, this is roughly
Fi≈hf(xi). (4.30)
In fact the trapezoidal method applied to this integral on the same grid would give exactly this result.
Using (4.30) in the systemKc=F, and dividing both sides byh, gives exactly the same linear system of equations that we obtained in Section 2.4 from the finite difference method (for the caseα=β = 0 we are considering here).
Some comments on this method:
• The matrix K above is tridiagonal because each φj(x) is nonzero on only two elements, for xj−1 < x < xj+1. The function φ0i(x)φ0j(x) is identically zero unless j =i−1, i ori+ 1. More generally, if we choose basis functions that are nonzero only on some regionxj−b < x < xj+a, then the resulting matrix would be banded withb diagonals of nonzeros below the diagonal and abands above. In the finite element method one almost always chooses local basis functions of this sort, that are each nonzero over only a few elements.
• Why did we integrate by parts to obtain equation (4.22), rather than working directly with (4.21)?
One could go through the same process based on (4.21), but then we would need an approximate U(x) with meaningful second derivatives. This would rule out the use of the simple piecewise linear basis functions used above. (Note that the piecewise linear functions don’t have meaningful first derivatives at the nodes, but since only integrals of these functions are used in defining the matrix this is not a problem.)
• This is one advantage of the finite element method over collocation, for example. One can often use functionsU(x) for which the original differential equation does not even make sense because U is not sufficiently smooth.
• There are other good reasons for integrating by parts. The resulting equation (4.22) can also be derived from a variational principle and has physical meaning in terms of minimizing the “energy”
in the system. (See,e.g., [SF73].)
4.3.1 Two space dimensions
In the last example we saw that the one-dimensional finite element method based on piecewise linear elements is equivalent to the finite difference method derived in Section 2.4. Since it is considerably more complicated to derive via the finite element approach, this may not seem like a useful technique.
However, in more than one dimension this method can be extended to irregular grids on complicated regions for which it would not be so easy to derive a finite difference method.
Consider, for example, the Poisson problem with homogeneous Dirichlet boundary conditions on the region shown in Figure 4.3, which also shows a fairly coarse “triangulation” of the region. The points (xk, yk) at the corners of the triangles are callednodes. The Galerkin form of the Poisson problem is
− Z Z
Ω∇u· ∇v dx dy= Z Z
Ω
f v dx dy. (4.31)
This should hold for all test functionsv(x, y) in some class. Again we can approximateu(x, y) by some linear combination of specified basis functions:
U(x, y) =
N
X
j=1
cjφj(x, y). (4.32)
Taking an approach analogous to the one-dimensional case above, we can define a basis functionφj(x, y) associated with each node (xj, yj) to be the unique function that is linear on each triangle, and which
1 9
2
3 4
5
6
7
8
10
11
Figure 4.3: Triangulation of a two-dimensional region with 11 nodes. Contourlines for the basis function φ8(x, y) are also shown as dashed lines.
takes the value 1 at the node (xj, yj) and 0 at all other nodes. This function is continuous across the boundaries between triangles and nonzero only for the triangles that have Node j as a corner. For example, Figure 4.3 indicates contour lines for the basis functionφ8(x, y) as dashed lines.
Using (4.32) in (4.31) gives anN×N linear system of the formKc=F where Kij =−
Z Z
Ω∇φj· ∇φidx dy. (4.33)
These gradients are easy to compute and in fact are constant within each triangle since the basis function is linear there. Since ∇φi is identically zero in any triangle for which Node i is not a corner, we see that Kij = 0 unless Nodes i andj are two corners of a common triangle. For example, in Figure 4.3 the eighth row of the matrixK will have have nonzeros only in columns 6, 7, 8, 10, and 11.
Note also that K will be a symmetric matrix, since the expression (4.33) is symmetric in iand j.
It can also be shown to be positive definite.
For a typical triangulation on a much finer grid, we would have a large but very sparse matrix K.
The structure of the matrix, however, will not generally be as simple as what we would obtain with a finite difference method on a rectangular grid. The pattern of nonzeros will depend greatly on how we order the unknowns and equations. Direct methods for solving such systems efficiently often rely on sophisticated graph theoretical algorithms for ordering the unknowns to minimize the bandwidth; see for example [DER86]. In practice iterative methods are often used to solve the sparse linear system.