Using this relationship, we can rewrite equation (81) as
b
j
= b
j+2
+ 2(j + 1)a
j+1
, 1 ≤ j ≤ N − 1, b
0
= 0.5b
2
+ a
1
, (82)
and b
N
= b
N+1
= 0. Now we can see that the calculations of all coefficients
b
k
for ∂u/∂x requires O(N
2
) steps with equation (81), and only O(N) steps
with equation (82). It is clear that similar representation can be derived for
other operators and different basis sets.
Nonlinear terms
The calculation of nonlinear terms with the spectral representation takes a
large numbe r of steps, e.g. N
3
steps for the quadratic nonlinear term. For
big values of N, this considerably slows down computations. In order to
resolve this problem, we can change the representation: we will work with
the functions represented as a set of spectral coefficient (i.e. coefficients a
k
)
wherever possible. Of course, this is possible if we know a very fast way to
transform functions from the initial representation into the spectral one and
back. It means that we should be able to calculate the sum
u(x
l
) =
N
X
j=1
a
j
ϕ
j
(x
l
), l = 1 . . . N,
and the integral
a
k
=
Z
R
u(x)ϕ
k
(x)dx, k = 1 . . . N,
more efficiently than O(N
2
) prerequested by the latter formulas. Fortunately,
such a way is known: these calculations can be efficiently done with the Fast
Fourier Transform (FFT). It only takes O(N log N) steps to calculate these
transforms. Furthermore, the fast transforms (FT) can also be derived for
other sets of functions, e.g. for the Legendre polynomials.
Example 4. Let us briefly describe here the scheme for the solution
of Burgers’ equation with use of the FTs. We analyze one time step, so
let the coefficients a
n
j
be known for step n. Then the following sequence of
operations is p erformed:
124