Download and install IODE (https://conf.math.illinois.edu/iode/download.html). Once downloaded and
installed, launch IODE.
- When you start the module, it plots two graphs. The upper one shows an odd 2π-periodic
square wave π(π‘). Two periods of this function are shown over a length 4π. It also shows, in red,
a partial sum
π0
2
- β(ππ cos ππ‘ + ππ sin ππ‘)
π
π=1
of the Fourier series. The final terms in this partial sum are cos(ππ‘) and sin(ππ‘), and so IODE
calls π the βtop harmonicβ. The current value of the top harmonic is displayed in the middle of
the plotting window, and you can increase or decrease it by clicking on the arrow buttons; doing
so repeatedly creates an βanimationβ effect. Or, you can just enter a new top harmonic number
directly into the box. When you increase the value of the top harmonic, the partial sum should
better approximate the function.
- Now use the Function menu to enter a new function, perhaps π(π‘) = |π‘| (the Matlab code for
this absolute value function is abs(x)). Try increasing and decreasing top harmonic, to see the
effect on the partial sums. - The lower graph in the window shows the βerrorβ between π and the partial sum of its Fourier
series, defined just to be the difference
πππππ(π‘) = π(π‘) β [
π0
2
- β(ππ cos ππ‘ + ππ sin ππ‘)
π
π=1
]
When we make the top harmonic π bigger, we expect the error to get smaller. Try it and see.
(Note: The vertical scale on the error plot changes, when the error gets smaller, in order to keep
the error visible.)
Sample Solution