University of Florida/Egm4313/s12.team11.imponenti/R6.4

From testwiki
Jump to navigation Jump to search

R6.4

solved by Luca Imponenti

Problem Statement

Consider the L2-ODE-CC (5) p.7b-7 with the window function f(x) p.9-8 as excitation:

y3y+2y=f(x)

and the initial conditions

y(0)=1 , y(0)=0

1. Find yn(x) such that:

yn+ayn+byn=rn(x)

with the same initial conditions as above.

Plot yn(x) for n=2,4,8 for x in [0,10]

2. Use the matlab command ode45 to integrate the L2-ODE-CC, and plot the numerical solution to compare with the analytical solution.

Level 1: n=0,1

Fourier Series

One period of the window function p9.8 is described as follows

f(x)={0  1.75<x<l0.25A  0.25<x<2.25

From the above intervals one can see that the period, p=4 and therefore L=2 Applying the Euler formulas from 1.75 to 2.25 the Fourier coefficients are computed:

a0=12L1.752.25f(x) dx

a0=14(1.750.250 dx+0.252.25A dx)

a0=+14(0+0.252.25A dx)

a0=14(2.25A0.25A)

a0=A2

The integral from 1.75 to 0.25 can be omitted from this point on since it is always zero.

an=1L0.252.25f(x)cos(nπxL) dx

an=120.252.25Acos(nπx2) dx

an=2A2nπ(sin(2.25nπ2)sin(0.25nπ2)

an=Anπ(sin(9nπ8)sin(nπ8)

and

bn=1L0.252.25f(x)sin(nπxL) dx

bn=120.252.25Asin(nπx2) dx

bn=2A2nπ(cos(2.25nπ2)cos(0.25nπ2)

bn=Anπ(Acos(nπ8)Acos(9nπ8)

The coefficients give the Fourier series:

f(x)=a0+n=1[ancos(nπxL)+bnsin(nπxL)]

f(x)=A2+n=1[Anπ(sin(9nπ8)sin(nπ8))cos(nπx2)

+Anπ(cos(nπ8)cos(9nπ8))sin(nπx2)]

Homogeneous Solution

Considering the homogeneous case of our ODE:

y3y+2y=0

The characteristic equation is

λ23λ+2=0

(λ1)(λ2)=0

λ1=1,λ1=2

Therefore our homogeneous solution is of the form

yh=c1ex+c2e2x

Particular Solution

Considering the case with f(x) as excitation

y3y+2y=A2+k=1nAkπ[(sin(9kπ8)sin(kπ8))cos(kπx2)

+(cos(kπ8)cos(9kπ8))sin(kπx2)]

The solution will be of the form

yn=A0+k=1nAkcos(kπx2)+k=1nBksin(kπx2)

Taking the derivatives

yn=Anπ2k=2nksin(kπx2)+Bnπ2k=2nkcos(kπx2)

yn=Anπ24k=3nk2cos(kπx2)Bnπ24k=3nk2sin(kπx2)

Plugging these back into the ODE:

π24k=3nAkk2cos(kπx2)π24k=3nBkk2sin(kπx2)3[π2k=2nAkksin(kπx2)

+π2k=2nBkkcos(kπx2)]+2[A0+k=1nAkcos(kπx2)+k=1nBksin(kπx2)]

=A2+k=1nAkπ[(sin(9kπ8)sin(kπ8))cos(kπx2)+(cos(kπ8)cos(9kπ8))sin(kπx2)]

Setting the two constants equal

2A0=A2

A0=A4

This is valid for all values of n. Since the coefficients of the excitation sin(9kπ8)sin(kπ8) and cos(kπ8)cos(9kπ8) are zero for all even n, then the coefficients Ak and Bk will also be zero, so we must only find these coefficients for odd n's. Now carrying out the sum to n=1 and comparing like terms yields the following sets of equations. Written in matrix form:

[2002]*[A1B1]=[ Aπ(sin(9π8)sin(π8)) Aπ(cos(π8)cos(9π8))]

Assuming A=1 this matrix can be solved to obtain

A1=0.1218 , B1=0.2941

For the remaining coefficients to be solved all sums will be used so a more general equation may be written:

[2(πk)243πk23πk22(πk)24]*[AkBk]=[ Aπk(sin(9πk8)sin(πk8)) Aπk(cos(πk8)cos(9π8))]

Results of these calculations are shown below:

A=[A1A2..A7A8]=[0.121800.008400.001400.00010], B=[B1B2..B7B8]=[0.294100.001900.001400.00070]

The solution to the particular case can be written for all n (assuming A=1):

      yn=14+k=1nAkcos(kπx2)+k=1nBksin(kπx2)

General Solution

The general solution is

y=yh+yp

where

yh=c1ex+c2e2x

Different coefficients c1 , c2 will be calculated for each n. These coefficients are easily solved for by applying the given initial conditions. Below are the calculations for n=2.

y=c1ex+c2e2x+14+k=12Akcos(kπx2)+k=12Bksin(kπx2)

Applying the first initial condition y(0)=1

y(0)=c1+c2+A1+A2=1

Taking the derivative

y=c1ex+2c2e2xk=22kπ2Aksin(kπx2)+k=22kπ2Bkcos(kπx2)

Applying the second initial condition y(0)=0

y(0)=c1+2c2+2π2B2=0

Solving the two equations for two unknowns yields:

c1=2.2436 , c2=1.1218

So the general solution for n=2 is:

y=2.2436ex1.1218e2x+14+k=12Akcos(kπx2)+k=12Bksin(kπx2)

Below is a plot showing the general solutions for n=2,4,8:

File:Plot64.jpg

File:Plot64zoom.jpg

Matlab Plots

Using ode45 the following graph was generated for n=0:

File:Matlab0.jpg

and for n=1

File:Matlab1.jpg

Template:CourseCat