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
where r(t) is a
periodic triangle wave
Section 1: Forced Oscillations
We solve the equation
where r(t) is a
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)):
>
plot( g,t=-3*Pi..3*Pi,title="The triangle wave");
The coefficients
are all zero
The coefficients
>
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));
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)");
The particular solution
We assume the particular solution is of the form
and we look for the coefficients
>
SY:=y(t)=A[k]*cos(k*t);
To compute
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)));
>
A[k]:=solve(simplify(subs(t=0,S)),A[k]);
>
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)");
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);
For instance, we can choose the intial condition so that
.
>
Y1:=subs(C2=0,C1=1,m=11,Y);
>
plot([Y1,S2(11,t)],t=0..15*Pi,title="The general solution (red) and The particular solution (green)",color=[red,green],numpoints=200);
>
The general solution (with
or
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.