MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Help with plotting Fourier representations

  • To: mathgroup at
  • Subject: [mg54225] Help with plotting Fourier representations
  • From: "Diana" <diana53xiii at>
  • Date: Sun, 13 Feb 2005 22:17:13 -0500 (EST)
  • Reply-to: "Diana" <diana53xiii at>
  • Sender: owner-wri-mathgroup at


I would like help with plotting the following problem with Mathematica. You
will see my basic attempts as follows:

First, find the Fourier series of the periodic function:

f(x+4) = f(x) for all x, defined by:

f(x) = -1 if -2<x<0

f(x) = 1 if 0<x<2

Since this is an odd function, we can just calculate the b_n's.

So, I calculated the following:

b[n_]:= (1/L) Integral (from 0 to L) of Sin[(n Pi t)/L]dt + (1/L) Integral
(from L to 2L) of -Sin[(n Pi t)/L]dt

g[x_]:= Summation as goes from 1 to 5 of b[n] Sin[n x]/:0 <= x <=2 L

g[x_]:= g[Mod[x,2 L]]

gtable=Table[g[n], {n, -8, 8, .1}];


There must be a better way to do this, where the coordinates of the x and y
axes show up, at the least.

Thanks in advance for your help,

"God made the integers, all else is the work of man."
L. Kronecker, Jahresber. DMV 2, S. 19.

  • Prev by Date: Using Select with arrays? (Relative newbie)
  • Next by Date: Re: Re: Problem using Evaluate[] inside a Plot command. 5.1
  • Previous by thread: Re: Using Select with arrays? (Relative newbie)
  • Next by thread: Perplexed by the behavior of NonlinearFit in Mathematica ver 4.2 vs 5.1