Application Center - Maplesoft

App Preview:

Fourier Series and Forced ODEs

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application


 

K10.6-FourierODEs.mws

Section 10.6-Fourier Series & Forced ODEs

by Alain Goriely, goriely@math.arizona.edu,
( http://www.math.arizona.edu/~goriely)

Abstract: This section illustrates Section 10.6 in Kreyszig 's book (8th ed.)

Application Areas/Subjects: Engineering, Applied Mathematics

Keywords: Fourier series, Oscillations, ODEs
See Also: Other Worksheets in the same package.

Prerequisites: plots

Note: Send me an e-mail (comments-criticisms) if you use this worksheet.

> restart;assume(n,integer):with(plots):
setoptions(thickness=2): #set the tickness of the lines in the plots

Warning, the name changecoords has been redefined

Introduction

In this worksheet, I use Maple to illustrate Section 10.6 of Kreyszig 's book: Advanced Engineering Mathematics.
I show how to compute the solution of second order ODEs periodically forced by computing the Fourier series of the particular solution

We solve the equation

diff(y(t),`$`(t,2))+2*y(t) = r(t)


where r(t) is a
2*Pi periodic triangle wave

Section 1: Forced Oscillations

We solve the equation diff(y(t),`$`(t,2))+2*y(t) = r(t)

where r(t) is a 2*Pi periodic triangle wave

The Fourier series of the Triangle wave

> f:=abs(t);g:=abs(t+2*Pi)*(Heaviside(t+3*Pi)-Heaviside(t+Pi))+abs(t)*(Heaviside(t+Pi)-Heaviside(t-Pi))+abs(t-2*Pi)*(Heaviside(t-Pi)-Heaviside(t-3*Pi)):

f := abs(t)

> plot( g,t=-3*Pi..3*Pi,title="The triangle wave");

[Maple Plot]

The coefficients b[n] are all zero

The coefficients a[n]

> a[0]:=1/2/Pi*int(f,t=-Pi..Pi);
a[k]:=subs(n=k,2/Pi*int(f*cos(n*t),t=0..Pi));

a[0] := 1/2*Pi

a[k] := 2/Pi*((-1)^k-1)/k^2

Let call S(n,t), the Fourier series approximations with n coefficients:

> S:=(m,t)->a[0]+sum(a[k]*cos(k*t),k=1..m):

> plot({g,S(11,t)},t=-3*Pi..3*Pi,title="Approximation (n=11)");

[Maple Plot]

The particular solution

We assume the particular solution is of the form y(t) = sum(A[k]*cos(k*t),k = 1 .. infinity)

and we look for the coefficients A[k]

> SY:=y(t)=A[k]*cos(k*t);

SY := y(t) = A[k]*cos(k*t)

To compute A[k] we substitute y(t) in the differential equation (where r(t) is expressed as a Fourier series)

> S:=simplify(subs(SY,r(t)=a[k]*cos(k*t),diff(y(t),`$`(t,2))+2*y(t) = r(t)));

S := diff(A[k]*cos(k*t),`$`(t,2))+2*A[k]*cos(k*t) =...

> A[k]:=solve(simplify(subs(t=0,S)),A[k]);

A[k] := -2*((-1)^k-1)/Pi/k^2/(k^2-2)

> S2:=(m,t)->a[0]/2+sum(A[k]*cos(k*t),k=1..m):

> plot({g,S2(21,t)},t=-3*Pi..3*Pi,title="The forcing(green) and The particular solution (red)");

[Maple Plot]

The general solution

The general solution is the sum of the general solution of the homogeneous system and the particular solution

> Y:=C1*cos(sqrt(2)*t)+C2*sin(sqrt(2)*t)+S2(m,t);

Y := C1*cos(sqrt(2)*t)+C2*sin(sqrt(2)*t)+1/4*Pi+sum...

For instance, we can choose the intial condition so that C[1] = 1, C[2] = 0 .

> Y1:=subs(C2=0,C1=1,m=11,Y);

Y1 := cos(sqrt(2)*t)+1/4*Pi+sum(-2*((-1)^k-1)/Pi/k^...

> plot([Y1,S2(11,t)],t=0..15*Pi,title="The general solution (red) and The particular solution (green)",color=[red,green],numpoints=200);

[Maple Plot]

>

The general solution (with C[1] or C[2] different from zero) is not periodic. Can you prove it?

References

E. Kreyszig : Advanced Engineering Mathematics (8th Edition) John Wiley New York (1999)

Disclaimer: While every effort has been made to validate the solutions in this worksheet, Waterloo Maple Inc. and the contributors are not responsible for any errors contained and are not liable for any damages resulting from the use of this material.