With the methods that we have used so far, we have been interested
mainly in calculating the new value of the function in the same
space as the solution exists in. For example, the diffusion equation
has been solved in each example above in position space.
However, there are times when it can be useful to perform the
evolution of a function in some other space. Spectral methods use
these ideas by Fourier transforming the problem and performing the
calculation in Fourier space, it being easier in some cases for
the solution to be calculated there than in position space. The
discussion here follows that in A First Course in Computational
Physics by P. DeVries.
The process that spectral methods use is to take an evolving function
in some space, transform it into Fourier space, calculate the
evolution of the function in Fourier space, and then transform back to
the original space by taking the inverse Fourier transform. This
process is then iterated for each time step of the algorithm.
Let's describe this process in more detail by considering the
diffusion equation3.10:
 |
(3.42) |
The Fourier transform of
is
 |
(3.43) |
This has transformed the function
from
-space to
-space.
Note that I will use the terms
-space, position space and inverse
space interchangeably, as well as the terms
-space, momentum space
and Fourier space. We can now rewrite
as
 |
(3.44) |
These transformations between
and
are occurring for the
same instance in time. Equation (3.44) allows us to
rewrite Equation (3.42) as
 |
(3.45) |
On the left-hand side of this equation, the partial derivative
operates only on
since it is the only thing dependent
upon
. On the right-hand side, the partial derivative acts only
on the exponential, since this is the only thing dependent upon
.
We take the derivatives through the integral signs and act them on the
things affected.
We now multiply both sides of this equation by
. This is is
just a mathematical trick, since we can ``see'' a possibility of
constructing a Dirac delta function out of an integral of
exponentials. Anyway, to carry on with the explanation, we then
integrate both sides over
, giving
We now exchange the order of integration to give
We note that
 |
(3.53) |
and performing the integral over
, this function will pick out all
values of
that are equal to
and we get the differential
equation
 |
(3.54) |
where we have done the trivial relabeling of
to
. Note that
we now only have one first order partial derivative, instead of a
first order and a second order partial derivative--this has
simplified the calculation rather a lot.
Equation (3.54) has the exact analytical
solution
 |
(3.55) |
where
is calculated from the initial distribution of
via the Fourier transform
 |
(3.56) |
This has completely solved the problem, and we don't really need to
use a computer to do the time evolution for us. however, it gives us
a technique useful in more general and more difficult problems. Once
we have
we just take the inverse Fourier transform to
obtain the desired solution:
Overall, we have three steps:
- Transform the original differential equation and initial
conditions into Fourier space.
- Solve the (hopefully simpler) equation in transform space.
- Perform the inverse Fourier transform to get the solution in the
original variables.
The only problem now is to know what
values to use once the
solution is in Fourier space. This is quite a problem with this
method as such a choice depends upon the implementation of the Fast
Fourier Transform (FFT) in the language or with the system you are
using. In the rest of this discussion I shall assume that the
implementation is Matlab's fft. Imagine that we have
grid points in space, and we assume that they are spaced equally at
intervals of
. The range of
points is therefore
. Since we only have a finite number of
points3.11 each
one must map to a point in
-space, and so the number of
points
is equal to
. In Matlab's implementation of the FFT, the
points in
are separated by an amount
which is related
to the parameters in
by
 |
(3.59) |
In the problems solved in this course, the
values lie roughly
equally about
. We therefore set up our
values in a similar
manner, where we have a set
(zero momentum) position and
successively larger values of
on either side, each separated by
until a sufficient number of points is obtained. More
explicitly this is
 |
(3.60) |
where the number of points in
is equal to the number of points in
. So, if
were equal to 5, with
, then we would
have the
points:
 |
(3.61) |
the range of
points is
, so
and hence we have the
points:
 |
(3.62) |
This technique seems pretty tricky, but it seems to be fairly specific
to certain problems. What if we want to solve a differential equation
that is more complicated than the diffusion equation, as is often the
case in real life? Well, a possible answer to this is to use what is
known as the pseudo-spectral method (also known as the
split-step FFT scheme), which we discuss in the next section.
Footnotes
- ... equation3.10
- I told you you'd see a lot of the
diffusion equation!
- ...
points3.11
- Note that we are using a Fast Fourier Transform (FFT)
here, which is derived from the Discrete Fourier Transform (DFT).
These transforms are, however, not Fourier transforms in the
strict sense since they are discretised finite data-set approximations
of a continuous set of data with infinite extent. Although they are
related remember that they aren't the same thing. I will throw
the terms around here a bit, but just keep this point in mind.
Paul Cochrane
2002-04-18