 Application Center - Maplesoft

# The Fourier Series package for Maple

You can switch back to the summary page by clicking here. The FourierSeries Package : Examples of Usage

Amir H. Khanshan

E-mail: khanshan@yahoo.com

Example 1

Find the fourier series coefficient of the following function(Fig.1).

 > restart; libname:=libname, currentdir():

 > with(FourierSeries); (1.1)

 >

 > f:=piecewise(t<1,t/2+1/2,t>=1,-t+2); (1.2)

 > plot(f,t=-5..5); > plot(rept(f,t=-1..2),t=-4..5,thickness=2,tickmarks=[10,2]); Fig.1

 > fs(f,t=-1..2,trig); (1.3)  (1.3)

 > decompose(a,3); (1.4)

 > decompose(b,3); (1.5)

 > b(5); (1.6)

 >

 exponential form:

 > f:=piecewise(t<1,t/2+1/2,t>=1,-t+2):

 > plot(rept(f,t=-1..2),t=-4..5,thickness=2,tickmarks=[10,2]); > fs(f,t=-1..2,exp); (1.7) (1.7)

 > decompose(c,3); (1.8)

 > evalc(%); (1.9)

Example2: Demostration of Gibb's Phenomenon

 > u:=Heaviside:

 > rect:=t->u(t+1/2)-u(t-1/2):

 > plot(rect(t),t=-3..3,thickness=2); > plot(rept(rect(t),t=-1..1),t=-3..3,thickness=2); > fs(rect(t),t=-1..1,trig,'g'): (2.1) (2.1)

 > GP:=N->plot([g(N),rept(rect(t),t=-1..1)],t=-3..3,color=[blue,green],numpoints=10*N):

 > GP(3); > GP(5); > GP(10); >

 > GP(70); Example3

 > plot(rept(exp(t),t=-1..1),t=-5..5,0..3,color=blue,discont=true); > fs(exp(t),t=-1..1,exp); (3.1) (3.1)

 > convert(c(n),trig):

 > combine(%); (3.2)

 > c(0); (3.3)

Example4

 > fs(cos(t)^4,t=0..Pi,trig); (4.1) (4.1)

 > cos(t)^4=combine(cos(t)^4); (4.2)

Legal Notice: The copyright for this application is owned by the author(s). Neither Maplesoft nor the author are responsible for any errors contained within and are not liable for any damages resulting from the use of this material. This application is intended for non-commercial, non-profit use only. Contact the author for permission if you wish to use this application in for-profit activities. 