Notice! This document is currently in Archived status.
The content of this document may be incorrect or outdated.

Print this article Edit this article

Fourier series on Maple

Purdue Engineering Computer Network

What is a Fourier Series?

"... the manner in which the author arrives at these equations is not exempt of difficulties and that his analysis to integrate them still leaves something to be desired on the score of generality and even rigour."

-The Paris Institutes' response to Fourier on his equations.

Jean Baptiste Joseph Fourier (1769-1830) is the mathematician who discovered Fourier series. Fourier started his work on Fourier series around 1804 and by 1807 Fourier world complete his memoir On the Propagation of Heat in Solid Bodies. Fourier's memoir would be read to the Paris Institute. The committee that would review Fourier's memoir consisted of other famous scientists and mathematicians. Such names included Joseph-Louis Lagrange,Pierre-Simon Laplace,Gaspard Monge,Sylvestre Francois Lacroix. The Institute would award Fourier a prize for his memoir despite that the committee had mixed reviews on his work.

What is a Fourier Series? Fourier Series is a way to analyze periodic properties. The general formula for a Fourier Series is as follows:

where ak and bk are coefficents which can be expressed as follows:

and


Calculating and Plotting the Coefficients on Maple

Fourier Series is an advance topic of mathematics. Before a student starts to use Maple for Fourier Series, the student should have a solid background on Fourier Series Basics. Below, is sample code for calculating the coefficients.
    > fe := proc(f) fnormal(evalf(f)); end:
    > a := proc(f, n)
    if n=0 then fe((1/(2*Pi))*Int(f, x=-Pi..Pi));
    else fe((1/Pi)*Int( f*cos(n*x), x=-Pi..Pi));
    fi;
    end:
    > b := proc(f, n)
    if n=0 then 0;
    else fe((1/Pi)*Int( f*sin(n*x), x=-Pi..Pi));
    fi;
    end:
    > fs := (f, n) -> sum('a(f, k)*cos(k*x) + b(f, k)*sin(k*x)', k=0..n);
    Now that we have entered the above code to calculate the Fourier Coefficents, lets plot the Fourier Series. Below shows how to plot and then shows the output.
      > fs1 := fs(x, 10); 

      fs1 := 1.999999999 sin(x) - .9999999999 sin(2 x)

      + .6666666664 sin(3 x) - .4999999999 sin(4 x)

      + .3999999998 sin(5 x) - .3333333332 sin(6 x)

      + .2857142856 sin(7 x) - .2499999999 sin(8 x)

      + .2222222222 sin(9 x) - .1999999999 sin(10 x)

      > plot({ x, fs1 }, x=-Pi .. Pi, scaling=constrained);




      (Note: The above examples were done by Indiana Univesity's Stat/Math Center)

      Last Modified: Dec 19, 2016 11:12 am US/Eastern
      Created: Mar 5, 2007 1:41 pm US/Eastern by admin
      JumpURL: https://eng.purdue.edu/jump/9b519