assume n O 0, n, integer ; getassumtions n ; n~:: AndPro integer, RealRange, N sawtooth d /iecewise!k, 0,!K 3! 3, K,!, K ;, C,!K, C,!,, /iecewise! K, 0,! K 3, C,! K, C,!,,! 3, () () K,!, K lot sawtooth, =K.., tickmarks = sacing ########### We comuted the Fourier coefficients for this function in class..5 0.5 K K 3 K K K0.5 0 3 K K.5 lot sawtooth, sum = sacing K C m sin m$, m =..5 m, =K.., tickmarks
########### change the m to see different Fourier sums, try m=..0 triangle d /iecewise!k,k C,! 0, C,!,K K,!, K ; /iecewise! K, K K,! 0, C,!, K C,!, K lot triangle, =K.., tickmarks = 6 sacing (3) 5 4 3 K K 3 K K 0 a 0 = int triangle, =K.. ; a n = simlify int triangle $cos n$, =K.. ; = simlify int triangle $sin n$, =K.. ; a 0 = a n~ = 4 K C n~ C n~ b n~ #### We';ll let Male comute the Fourier coefficients this time 3 b n (4)
lot triangle, int triangle, =K.. C sum int triangle $cos m$, =K.. $cos m$ C int triangle $sin m$, =K.. $sin m$, m =..5, =K.., tickmarks = sacing ######## Note that the aroimations become good quicly, due the the quadratic decay of the coefficients. 6 5 4 3 K K 3 K K square d /iecewise!k, 0,!K 3!, 0,! 3,,!, 0, ; 0,,!K, 0,!K ################################################## 3,,! 0, 0,!,, /iecewise! K, 0,! K 3,,! K, 0,! K,,! 0, 0,!,, (5)!, 0,! 3,,!, 0,
lot square, =K.., tickmarks = sacing 0.8 0.6 0.4 0. K K 3 K K a 0 = int square, =K.. ; a 0 = a n = simlify b n = simlify lot square, 0 int square $cos n$, =K.. ; a n~ int square $sin n$, =K.. ; K n~ K cos n~ C b n~ = n~ int square, =K.. C sum int square $cos m$, =K 3 (6) (7) (8)
.. $cos m$ C int square $sin m$, =K.. $sin m$, m =..5, =K.., tickmarks = sacing 0.8 0.6 0.4 0. K K 3 K K 0 3 # Gibbs henomemon # sawtooth wave from the book booksawtooth d /iecewise!k, 0,! 0, $ KK,!, $ K ; /iecewise! K, 0,! 0, K K,!, K lot booksawtooth, =K.., tickmarks = sacing (9)
.5 0.5 K K 3 K K K0.5 0 3 K K.5 lot $ K K.8, $ K C.8, booksawtooth, int booksawtooth, =K.. C sum int booksawtooth $cos m$, =K.. $cos m$ C int booksawtooth $sin m$, =K.. $sin m$, m =.., =K.., tickmarks = sacing
4 3 K K 3 K K K 0 3 ### As the Fourier sums aroach a discontinuity they tend to overshoot the function first and then dive down. Furthermore, the amount by which they overshoot limits to a constant, and the location of the overshoot tends towards the discontinuity. This is called the Gibbs henomenon. The book calculates the amount of overshoot in this eamle to be.8. The two arallel lines are.8 above and below the sawtooth wave. Try some different Fourier sums and notice that there seems to be a bum that travels along one of the arallel lines towards the discontinuity at the y-ais (or at ).
####### Here's the homework roblem that caused Male some trouble halfs d /ma sin $, 0 ; lot halfs, sin, =K.., tickmarks = sacing, default, discont = true, color = black, red, thickness = 3, ; /ma sin, 0 0.5 K K 0 K0.5 K # a 0 a 0 = int halfs, =K..
a 0 = K ma 0, sin d (0) a 0 = evalf int halfs, =K.. ; a 0.38309886 () # a n a n = simlify int halfs $cos n$, =K.. ; a n~ = K ma 0, sin cos n~ d # Male can't do the symbolic integration, try to hel it a n = simlify $ int sin $ $cos n$, =K..K C int sin $ $cos n$,.. a n~ = K C n~ K cos #### This eression is not valid for n=! C int 0$cos n$, =K..0 C int 0$cos n$, =.. ; n~ K K4 C n~ () (3) for i from to 0 do a i = simlify $ int sin $ $cos i$, =K..K C int 0$cos i$, =K..0 C int sin $ $cos i$,.. C int 0$cos i$, =.. end do a a a 3 a 4 = K 3 a 5 a 6
a 7 a 8 = K 5 a 9 a 0 a a = K 35 a 3 a 4 a 5 a 6 = K 63 a 7 a 8 a 9 a 0 = K 99 (4) # b n b n = simlify int halfs $sin n$, =K.. ; b n~ = K ma 0, sin sin n~ d (5) b n = simlify int sin $sin n$, =K..K b n~ ## That's fishy, there ought to be a non-zero sin() term. C int sin $sin n$,.. ; (6)
b = simlify int sin $sin $, =K..K C int sin $sin $,.. for i from to 0 do a i = simlify K b = $ int sin $ $sin i$, =K..K..0 C int sin $ $sin i$,.. C int 0$sin i$, = a (7) C int 0$sin i$, =.. end do a = a 3 a 4 a 5 a 6 a 7 a 8 a 9 a 0 a a a 3 a 4 a 5 a 6 a 7 a 8 a 9 a 0 (8)
#lot halfs, int halfs, =K.. C sum int halfs $cos m$, =K.. $cos m$ C int halfs $sin m$, =K.. $sin m$, m =..00, =K.., tickmarks = sacing # Male won't be able to comute this lot halfs, int halfs, =K.. C sum int sin $cos m$, =K..K C int sin $cos m$,.. $cos m, m =..00, =K.., tickmarks = sacing Error, (in SumTools:-DefiniteSum:-ClosedForm) summand is singular in the interval of summation ### The revious eresson gives me an error about summand being singular, but that's because the eression for a n is not valid for a lot halfs, int halfs, =K.. C $ sin $ C sum int sin $cos m $, =K..K C int sin $cos m$,.. $cos m$, m = 3..3, =K.., tickmarks = sacing
0.8 0.6 0.4 0. K K 3 K K 0 3 lot halfs, int halfs, =K.. C $ sin $ C sum int sin $cos m $, =K..K C int sin $cos m$,.. $cos m$, m = 4..4, =K.., tickmarks = sacing
0.8 0.6 0.4 0. K K 3 K K 0 3 lot halfs, int halfs, =K.. C $ sin $ C sum int sin $cos m $, =K..K C int sin $cos m$,.. $cos m$, m = 4..0, = K.., tickmarks = sacing
0.8 0.6 0.4 0. K K 3 K K 0 3 lot halfs,.... $,.. int sin $cos 4$, =K..K C $cos 4$, int sin $cos 8$, =K..K int sin $cos 4$, =K..K C $cos 4$ C int sin $cos 8$, =K..K $cos 8$, $cos 8$,.. $cos 8$, =K.., tickmarks = sacing int sin $cos 4$, C int sin $cos 8$, int sin $cos 4 C int sin
.0 0.8 0.6 0.4 0. K K 3 K K K0. 0 3 lot halfs,.... int sin $cos 4$, =K..K C int sin $cos 4$, $cos 4$ C int sin $cos 8$, =K..K C int sin $cos 8$, $cos 8$, =K.., tickmarks = sacing
.0 0.8 0.6 0.4 0. K K 3 K K K0. 0 3