University of Florida/Egm4313/s12.team11.R6: Difference between revisions

From testwiki
Jump to navigation Jump to search
imported>MaintenanceBot
 
(No difference)

Latest revision as of 02:11, 17 October 2020

Template:Big3

Intermediate Engineering Analysis
Section 7566
Team 11
Due date: April 11, 2012.

R6.1

Solved by Daniel Suh

Problem Statement

  • Find the fundamental period of cos(nωx) and sin(nωx)
  • Show that these functions also have period p.
  • Show that the constants a0 is also a periodic function with period p.

Solution

  • Find the fundamental period, and show that these functions have a period of p.

p=2L=2πω

L=πω

f(x+np)=f(x)

f(x)=cos(nωx)

f(x+n2πnω)=cos(nω(x+2πnω))

f(x+2πω)=cos(nωx+2π)

f(x+2L)=cos(nωx+2π)

              p=2L is the fundamental period for cos(nωx).

f(x+np)=f(x)

f(x)=sin(nωx)

f(x+n2πnω)=sin(nω(x+2πnω))

f(x+2πω)=sin(nωx+2π)

f(x+2L)=sin(nωx+2π)

              p=2L is the fundamental period for sin(nωx).
  • Show that the constants a0 is also a periodic function with period p.

From Fourier Series,
a0=12LLLf(x)dx

f(x)=cos(nωx)

a0=ω2ππωπωcos(nωx)dx

a0=ω2π[sin(nωx)nω|πωπω]

a0=ω2π[2sin(nπ)nω]

          a0=0

f(x)=sin(nωx)

a0=ω2ππωπωsin(nωx)dx

a0=ω2π[cos(nωx)nω|πωπω]

a0=ω2π[cosnπ+cosnπnω]

          a0=0

R6.2

Part A

Problem Statement

Solve the problems 11 and 12 from Kreyszig p.491

Solution

First, for problem 11:
f(x)=x2 from <1<x<1> where p=2 We know that p=2=2L so that L=1

We check is the function is even, odd or neither.
Since f(x) satisfies the condition f(x)=f(x) we know that the function is even.
Given that the function is even and that bn=0 for even functions, we exclude the bn term from the Fourier Series.

We find a0:
a0=12LLLf(x)dx
Plugging in,
a0=1211x2dx=12[13x3]11=12[13+13]=13

We find an
an=1LLLf(x)cos(nπxL)dx
an=111x2cos(nπx)dx
We can use the equivalent expression:
an=201x2cos(nπx)dx

Now we evaluate the integral by using integration by parts. Below are the steps:
Integration by parts uses fdg=fggdf
f=x2dg=cos(πnx)dxdf=2xdxg=sin(πnx)πn
Then, we have:
[x2sin(πnx)πn]012πn01xsin(πnx)dx
Repeating for the second term:
f=xdg=sin(πnx)df=dxg=cos(πnx)πn
Then, we have:
[xcos(πnx)πn]011πn01cos(πnx)dx
Bringing all the terms together:
2[[x2sin(πnx)πn]012πn[xcos(πnx)πn]011πn01cos(πnx)dx]
Then,
2[[x2sin(πnx)πn]012πn[xcos(πnx)πn]011πn[sin(πnx)πn]01]
Evaluating at the boundaries and simplifying:
2[[00]+2π2n2[cos(πn)]1πn[00]]
Further,
4π2n2cos(πn)
We can simplify one step further by acknowledging that cos(πn)=(1)n.
an=4π2n2(1)n

Finally,
f(x)=a0+n=1ancos(πnL)x

The Fourier series is:

                                   f(x)=13+n=14π2n2(1)ncos(πn)x


Now problem 12:
f(x)=1x24 from <2<x<2> where p=2 We know that p=4=2L so that L=2

We check is the function is even, odd or neither.
Since f(x) satisfies the condition f(x)=f(x) we know that the function is even.
Given that the function is even and that bn=0 for even functions, we exclude the bn term from the Fourier Series.

We find a0:
a0=12LLLf(x)dx
Plugging in,
a0=14221x24dx=14[x112x3]22=14[2481224+812]=23

We find an
an=1LLLf(x)cos(nπxL)dx
an=1222(1x24cos(nπx)dx
Now we evaluate the integral by using integration by parts. This process is similar to the one shown in the solution for problem 11 above and therefore will be performed in Wolfram Alpha.
The following command was given in Wolfram Alpha: integral (1-(x^2/4))*cos(pi*x) from -2 to 2.
Wolfram Alpha yields the following
2π2n2

Finally,
f(x)=a0+n=1ancos(πnL)x

The Fourier series is:

                              f(x)=23+n=12π2n2cos(πn2)x


Part B

Solved by Francisco Arrieta

Problem Statement

Find the Fourier series expansion for f(x) on p. 9.8 as follows:

Part 1

Develop the Fourier series expansion of f(x¯)

Plot f(x¯) and the truncated Fourier series fn(x¯)

fn(x¯):=a¯0+k=1n[a¯kcoskωx¯+b¯ksinkωx¯]

for n=0,1,2,4,8. Observe the values of fn(x¯) at the points of discontinuities, and the Gibbs phenomenon. Transform the variable so to obtain the Fourier series expansion of f(x)

Solution

p=2L=4
L=2
ω=2πp

a¯0=12LLLf(x¯)dx¯

a¯0=1422f(x¯)dx¯
a¯0=A2

a¯k=1LLLf(x¯)coskωx¯dx¯

a¯k=1222f(x¯)coskπx¯2dx¯
a¯k=2Akπsinkπ2

Note:

If k is even a¯k=0

If k=1, 5, 9... a¯k=2Akπ

If k=3, 7, 11... a¯k=2Akπ

b¯k=1LLLf(x¯)sinkωx¯dx¯

Note:

b¯k=0 for n=1, 2...

Then Fourier series becomes a Fourier cosine series:

                                              fk(x¯)=A2+k=1n(2Akπcoskπ2x¯)

For n=0

                                              fk(x¯)=A2

For n=1

                                              fk(x¯)=A2+(2Aπcosπ2x¯)

File:N=1.jpg

For n=5

                                              fk(x¯)=A2+2Aπ(cosπ2x¯13cos3π2x¯+15cos5π2x¯)

File:N=5.jpg

After transforming the variable of f(x¯)

                                              fk(x)=A2+k=1n(2Akπcoskπ2(x1.25))

Part 2

Do the same as above, but using f(x~) to obtain the Fourier expansion of f(x) ; compare to the result obtained above

Solution

p=2L=4
L=2
ω=2πp

a~0=12L02Lf(x~)dx~

a~0=1404f(x~)dx~
a~0=A2

a~k=1L02Lf(x~)coskωx~dx~

a~k=1204f(x~)coskωx~dx~
a~k=Akπsinπk

Note:

b¯k=0 for n=1, 2..

b~k=1L02Lf(x~)sinkωx~dx~

b~k=1204f(x~)sinkπ2x~dx~
b~k=Aπk(cosπk1)

Note:

If k is even a¯k=0

If k=1, 3, 5... a¯k=2Akπ

Then Fourier series becomes a Fourier sine series:

                                              fk(x~)=A2+k=1n(2Akπsinkπ2x~)

For n=0:

                                              fk(x~)=A2

For n=1:

                                              fk(x~)=A2+(2Aπsinπ2x~)

For n=5:

                                              fk(x~)=A2+2Aπ(sinπ2x~+13sin3π2x~+15sin5π2x~)

After transforming the variable of f(x¯)

                                              fk(x)=A2+k=1n(2Akπsinkπ2(x.25))

R6.3

Problem Statement

Page 491, #15,17. Plot the truncated Fourier series for n=2,4,8.

Solution

15.

f(x)={xπ,π<x<π/2x,π/2<x<π/2πx,π/2<x<π

Since f(x)=f(x), the function is odd.

a0=(1/π)*[1ππ/2(x+π)dx+π/2π/2(x)dx+π/2π(πx)dx]
After simplification, a0=0
. Using Equation (5) on page 490, the exapansion becomes;
f(x)=8k/π2[sin(π*x/L)sin(3π*x/L)/9...)
With L=π,k=π/2 this becomes;
f(x)=4/π(sinxsin(3x)/9+sin(5x)/25sin(6x)/36....) for n is "odd".
This means when n is even, f(x)=0

File:R63a.jpg

17.
f(x)=1|x|,1x1

f(x)={1+xπ,1<x<01x,0<x<1

a0=1/2[10(1+x)dx+01(1x)dx]
a0=1/2[11/2+11/2]

 a0=1/2

an=1/1[10(1+x)cos(nπ*x/1)dx+01(1x)cos(nπ*x/1)dx]
Simplifying results in;
an=2[1/(n2π2)(1)n/(n2π2)]
So,

an=4/(n2π2)

when n is odd.
bn=1/1[10(1+x)sin(nπ*x/1)dx+01(1x)sin(nπ*x/1)dx]
Simplifying results in;

bn=0

f(x)=1/2+n=04/(n2π2)*cos(nπ*x)

Since an=0 for even n, f(x) becomes f(x)=1/2 for even n.

File:R63b.jpg

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

R6.5

Solved by: Gonzalo Perez

Problem Statement

Part R4.2, p.7c-26

For each value of n=3,5,9, re-display the expressions for the 3 functions yp,n(x),yh,n(x),yn(x), and plot these 3 functions separately over the interval [0,20π].

R4.2 p.7-26: Consider the L2-ODE-CC (5) p.7b-7 with sinx as excitation:

y3y+2y=r(x) (5)p.7-7

r(x)=sinx (1)p.9-15

and the initial conditions:

y(0)=1,y(0)=0. (3b)p.3-7

Exact solution: y(x)=yh(x)+yp(x) (2)p.9-15

Re-display the expressions for yp(x),yh(x),y(x).

Superpose each of the above plot with that of the exact solution.

Solution

The graphs are to be separately graphed as follows.

For n = 3, the code that will generate the graph looks like this:

For n = 6:

For n = 9:

Part R4.3, p.7c-28

Understand and run the TA's code to produce a similar plot, but over a larger interval [0,10]. Do zoom-in plots about the points x=0.5,0,+0.5 and comment on the accuracy of different approximations.

R4.3 p.7-28: Consider the L2-ODE-CC (5) p.7b-7 with log(1+x) as excitation:

y3y+2y=r(x) (5)p.7-7

r(x)=log(1+x) (1)p.7-28

and the initial conditions:

y(34)=1,y(34)=0 (2)p.7-28

Solution

For n=4 (from x = 0 to x = 10):

For n=4 (zoom-in plots around x = -0.5):

For n=4 (zoom-in plots around x = 0):

For n=4 (zoom-in plots around x = +0.5):

For n=7 (from x = 0 to x = 10):

For n=11 (from x = 0 to x = 10):

Where the black line represents n=11 and the blue line represents log(1+x).

The problem asks for n=4, 7, and 11. The TA had up to n=16, but the problem does not ask for this. Manipulating the code and graphs to only account for these n values, n=16 has been disregarded.

Combined plots for n=7 and n=11 (zoom-in plots around x = -0.5):

Combined plots for n=7 and n=11 (zoom-in plots around x = 0):

Combined plots for n=7 and n=11 (zoom-in plots around x = 0.5):

Part R4.4, p.7c-29

Understand and run the TA's code to produce a similar plot, but over a larger interval [0.9,10], and for n=4,7. Do zoom-in plots about x=1,1.5,2,2.5 and comments on the accuracy of the approximations.

R4.4 p.7-29: Extend the accuracy of the solution beyond x^=1.

Solution

The general code that can be used to graph the plots of n=4,7,11 is:

With the above code, we can add the following code to graph n=4.

For n = 4 (from x = 0.9 to x = 10):

For n = 7 (from x = 0.9 to x = 10):

For n=11 (from x = 0.9 to x = 10):

Repeating the same common part of the code, let's graph the other plots around x = 1, 1.5, 2, 2.5:

For n = 4, 7, 11 at x = 1:

For n = 4, 7, 11 at x = 1.5:

For n = 4, 7, 11 at x = 2:

For n = 4, 7, 11 at x = 2.5:

For the last part, the first (and unchanged TA's code) is the following:

The second part includes the change that had to be made in order to solve this problem:

R6.6

Problem Statement

Given: For the following differential equation: yp+4yp+3yp=2e2xcos(3x)

With a particular solution of the form: yp=xe2x(Mcos(3x)+Nsin(3x))

Verify that this solution has a final expression of yp=6e2x(Ncos(3x)Msin(3x)) as follows:

1) Simplify the term yp
2) Simplify the 2nd term 4yp and combine with the simplified first term
3) Finally add the 3rd term 13yp
4) Find the final expression for yp(x)

Solution

1) To find the derivative and simplify yp we will use www.wolframalpha.com[1].

The "Simplify" command will be exploited as well as the notation for taking a derivative in mathematica. The following was entered into www.wolframalpha.com:

Simplify[D[D[x*exp(-2x)*(Mcos(3x) + Nsin(3x)),x],x]]

The answer that was yielded is as follows:

yp=6Me2xsin(3x)+12Me2xxsin(3x)4Me2xcos(3x)5Me2xxcos(3x)
4Ne2xsin(3x)5Ne2xxsin(3x)+6Ne2xcos(3x)12Ne2xxcos(3x)



2) In the same fashion, 4yp was evaluated and simplified using www.wolframalpha.com

The following was entered into www.wolframalpha.com:

simplify[4*[D[x*exp(-2x)*(Mcos(3x) + Nsin(3x)),x]]]

The answer that was yielded is as follows:

4yp=12Me2xxsin(3x)+4Me2xcos(3x)8Me2xxcos(3x)+4Ne2xsin(3x)8Ne2xxsin(3x)+12Ne2xxcos(3x)

This term can be added to the previous, and then simplified yet again using www.wolframalpha.com

The following was entered into www.wolframalpha.com

Simplify[D[D[x*exp(-2x)*(Mcos(3x) + Nsin(3x)),x],x]+ 4*[D[x*exp(-2x)*(Mcos(3x) + Nsin(3x)),x]]

The answer that was yielded is as follows:

yp+4yp=6Me2xsin(3x)13Me2xxcos(3x)13Ne2xxsin(3x)+6Ne2xcos(3x)


3) The final term 13yp is now added to this result, as follows:

yp+4yp+13yp=6Me2xsin(3x)13Me2xxcos(3x)13Ne2xxsin(3x)+6Ne2xcos(3x)+13Me2xxcos(3x)+13Ne2xxsin(3x)

yp+4yp+13yp=6Me2xsin(3x)+(1313)Me2xxcos(3x)+(1313)Ne2xxsin(3x)+6Ne2xcos(3x)

yp+4yp+13yp=6Me2xsin(3x)+6Ne2xcos(3x)

yp+4yp+13yp=6e2x(Ncos(3x)Msin(3x))


4) As verified above, the final term is as follows:

yp(x)=6e2x(Ncos(3x)Msin(3x))

  1. www.wolframalpha.com

--Egm4313.s12.team11.sheider (talk) 22:30, 10 April 2012 (UTC)

R6.7

Solved by Solved by Daniel Suh

Problem Statement

Find the separated Ordinary Differential Equations for the heat equation.

ut=κ2ux2(1)

u(x,t)=F(x)G(t)

Solution

ut=F(x)G˙(t)(2)

2ux2=F(x)G(t)(3)

Combine (2) and (3) into (1)

F(x)G˙(t)=κF(x)G(t)

G˙(t)κG(t)=F(x)F(x)=c (constant)

Separate

          F(x)cF(x)=0
G(t)κcG(t)=0