Worksheet: Gibbs.mw
Fourier Series and Gibb's Phenomena
This worksheet examines the Fourier Series of
F(x)=
Least Squares Approximation of The Initial Condition
Let's approximate the initial condition f(x) with the sum of sines that came from separation of variables.
| > |
F:=piecewise(0<x and x<Pi,1, -Pi<x and x<0, -1,0); |
| > |
plot(F, x=-Pi..Pi,thickness=2, discont=true, thickness=2); |
| > |
c:=n->(1/Pi)*int(F*f(n),x=-Pi..Pi); |
| > |
seq(c[n]=c(n),n=1..10); |
| > |
g:= M->sum(c(m)*sin(m*x),m=1..M); |
| > |
s:=seq(g(2*M),M=1..21): |
Bessel's Inequality and Parseval's Theorem
Let's compute the (norm)^2 of F(x) and the n-term approximation of F
| > |
normF:=int(F^2,x=-Pi..Pi); evalf(%); |
| > |
S:=N->(16/Pi)*sum(1/(2*j-1)^2,j=1..N); |
| > |
seq(evalf(S(n)),n=1..20); |
Gibb's Phenomena and the Sine Integral
We can now compare the partial sums to the Sine Integral
| > |
plot(h(x),x=0..3*Pi,thickness=2); |
| > |
SI:=z->int(h(x),x=0..z); |
| > |
SI(infinity);SI(Pi)/(Pi/2);evalf(%); |
| > |
G:=M->(2/Pi)*SI(x*(2*M)); |
| > |
plot({g(2*M),G(M)},x=0..Pi,thickness=2); |