Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
I will compute the Fourier series of F(x)=x over the Interval [ -pi, pi]. I will first do the calculations then
show that these sums in fact give us the line y=x over the interval [-pi, pi]
1 π
Ao = π ∫-π
F(x) dx
1 π
An = π ∫-π F(x) cos(nx) dx
1 π
Bn = π ∫-π F(x) sin(nx) dx
In[19]:= Integrate[x Sin[n x], {x, - π, π}, Assumptions → Element [n, Integers]]
Sin2x Sin3x
=2[Sinx - 2
+ 3
+..................]
I will plot these first 3 terms to see if l can recognize the straight line...
Out[21]=
-3 -2 -1 1 2 3
-1
-2
-3
From the diagram above the straight line is not very clear so l will add a few more terms to see if l can
get a better output..
3
In[24]:= Plot
2 Sin[x] - Sin[2 x] 2 + Sin[3 x] 3 - Sin[4 x] 4 + Sin[5 x] 5 - Sin[6 x] 6 - Sin[7 x] 7,
{x, - π, π}
Out[24]=
-3 -2 -1 1 2 3
-1
-2
-3
This is a better representation of the line. But l will add more terms in my final representation of the line
In[25]:= PlotSum- 2 - 1 ^ n Sin[n x] n, {n, 1, 80}, {x, - π, π}, Epilog → Point[{2, 2}]
4
Out[25]=
-3 -2 -1 1 2 3
-2
-4
This is a better representation of the Straight line by adding more terms in my Sequence.This type of
analysis is widely used in Systems Engineering when we do analysis of signals which can be triangular,
square form or even a straight line as shown from my example.The various waveforms can then be
converted into a series of sines and cosines which are better for analysis
4
Integrate: Invalid integration variable or limit(s) in {Assumptions x, -Assumptions pi, Assumptions pi} → n ∈ Integers.