: User manual for Iode
: Second order linear ODEs
: Partial differential equations
Fourier series
The Fourier series module can compute and graph the Fourier
coefficients of a periodic function
, and can plot partial sums of
the
Fourier series and the error (difference) between these partial sums
and the
function
.
For concreteness, we will write
for the function being
considered, even though you can change the name of the independent
variable from
to something else like
, if you want.
After selecting Fourier series from the Iode main menu,
the Fourier series window will open up, showing two graphs. The top
graph plots a function
in dark blue and a partial sum of its
Fourier series in red. These are plotted over two period
lengths. Recall that a partial sum of the Fourier series is an
expression of
the form
 |
(4.1) |
where

and
are the
Fourier coefficients and
is the half-period,
.
The top harmonic number
tells you the highest frequency that
is included in the partial sum. Try increasing or decreasing the
value of the top harmonic used in your plot, by clicking on the
``arrow''
buttons in the middle of the window. Alternatively, you can type a
number directly into the Current top harmonic box between the
arrows.
The bottom graph in the window plots the error between the function
and
the partial sum of its Fourier series:
error
Notice that the vertical scale on this error plot is generally different from the scale on the top plot, in which the function is plotted. In fact, the vertical scale on the error plot will change as
you step through the partial sums (increasing or decreasing the top
harmonic).
Across the top of both graphs you will find the function written out,
along with the basic period interval
. The function is extended periodically by Iode, and is shown over two periods.
- Plot partial sums and errors: plots
and its partial sum
in the
top graph, and the error (difference) in the bottom plot.
- Plot coefficients A_n and B_n: plots the
-coefficients in the top plot, and the
-coefficients in the bottom one, for
top harmonic. Notice
is never plotted (because it is the least interesting Fourier coefficient, affecting only how much the graphs are translated up or down in the
-direction).
- Plot coefficients C_n=(A_n^2+B_n^2)^(1/2):
plots the Fourier magnitudes
in the top graph. The
bottom graph can be used to investigate the rate of decay of the
, using an arbitrary comparison function (see Options below).
- Current top harmonic: increase or decrease this value
by clicking on the ``arrow'' buttons in the middle of the window.
(Alternatively, you can type a number directly into the
box between the arrows.) You can change the top harmonic while
in any one of the three plotting modes above.
- Enter function: You will be asked first for the left and
right endpoints of the basic period interval
for your
function, and then you enter the function using Matlab syntax as usual
(e.g., exp(x) for
). Very often the interval of interest is
just
, in which case you enter -pi and pi for
the left and right endpoints.
Remark 4.1
The interval

is part of the definition of the function! For example,
it tells us that the period of the function is

.
- Comparison functions... This item is only accessible
when you are in the Plot coefficients C_n mode. Its purpose is
to compare the rate of decay of the Fourier coefficients with a
function like
. It has two subitems.
- Enter comparison function: prompts you to enter a function of
. The idea is to enter a function that might be decaying at the same rate as the Fourier coefficients, which in most cases means you should enter
something like
or
or
.
- Show comparison function: plots the ratio of
over your
comparison function, in the bottom graph. You will typically need top
harmonic to be 25 or so, to see a convincing pattern in this ratio
graph.
To get rid of the ratio graph, just choose Show comparison function again.
If the ratio graph is decaying steeply overall, then the coefficients
are decaying faster than your comparison function, so
you should enter a faster-decaying comparison function (such as a larger
power of
).
If the ratio graph is growing steeply overall, then the coefficients
are decaying slower than your comparison function, so
you should enter a slower-decaying comparison function (such as a smaller
power of
).
If the ratio graph remains bounded but does not approach zero, as
gets bigger, then congratulations! You have probably hit upon the correct rate of decay of the Fourier coefficients.
Remark 4.2
It is interesting to plot the values of

and determine
their rate of decay because

equals the amplitude of the
combined oscillations at the

th frequency level, in the Fourier
series of

. To see this, observe that
 |
(4.2) |
where the angle

is defined by requiring

and

. (Formula (
4.2) is
proved just by substituting the identity

on the right hand side.)
- Change plot resolution: this item is only accessible when you are
in the Plot partial sums and errors mode. You should probably increase
the plot resolution if you are studying rapidly oscillating functions, or
if you choose top harmonic bigger than, say, 100. The prompt, ``Number of
points to be plotted'', refers to the number of plot points in the interval
.
: User manual for Iode
: Second order linear ODEs
: Partial differential equations
平成16年11月7日