University of Florida/Egm4313/s12.team11.R7

From testwiki
Jump to navigation Jump to search

Template:Big3


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

R7.1

Solved by Andrea Vargas

Problem Statement

Verify (4)-(5) pg 19-9:
(4) ϕi,ϕj=0 for ij
(5) ϕj,ϕj=L2 for i=j

Solution

From the lecture notes on p.19-9 we know that:
(2) ϕi=sin(ωix)
(3) ϕi,ϕj=0Lϕi(x)ϕj(x)dx

Then, we have
ϕi,ϕj=0Lϕi(x)ϕj(x)dx=0Lsin(ωix)sin(ωjx)dx

Since the period of sin(x) is 2π and we know that p=2L, we can assume that L=π for simplicity.

We can compute the result of the previous integral using Wolfram ALpha (Mathematica software). The following is the input given to the software:
int from 0 to pi sin(ax)sin(bx)

where a is ωi and b is ωj. The software generates the following answer:

0Lsin(ax)sin(bx)=bsin(πa)cos(πb)acos(πa)sin(πb)a2b2

Substituting for ωi and ωj:
0Lsin(ax)sin(bx)=ωjsin(πωi)cos(πωj)ωicos(πωi)sin(πωj)ωi2ωj2
We also know that sin(cπ)=0 where c is any integer. We can cancel any terms with sin(πωi) or sin(πωj) as they are equal to zero.
Then, we can verify:

                         (4)  ϕi,ϕj=0 for ij

Similarly we can verify (5).
We have
ϕj,ϕj=0Lϕj(x)ϕj(x)dx=0Lsin(ωjx)sin(ωjx)dx

Here, we will keep the integration boundaries as 0L to be consistent with the problem statement.

We can compute the result of the previous integral using Wolfram ALpha (Mathematica software). The following is the input given to the software:
int 0 to L (sin(ax))^2

where a is ωj. The software generates the following answer:

0Lsin(ax)2=L2sin(2aL)4a

Substituting for ωj:
0Lsin(ax)2=L2sin(2Lωj)4ωj

We know from the previous explanation that L=π.So,we can apply the same assumption as before that sin(cπ)=0 where c is any integer. This allows us to cancel any terms with sin(2Lωj) as they are equal to zero.
Then, we can verify:

                         (5)  ϕj,ϕj=L2 for i=j

R7.2

Solved by Francisco Arrieta

Problem Statement

Plot the truncated series u(x,t)=j=1najcosCωjtsinωjx with n=5 and for:

t=αP1=α2πCω1=α2LC

α=0.5,1,1.5,2

Solution

Using:

{f(x)=x(x2)g(x)=0C=3L=4


Then:

aj=2L0Lf(x)sinωjxdx

=2[(1)j1π3j3]

aj=0 for all even values of j


Plugging back to the truncated series:

u(x,t)=j=1n2[(1)j1π3j3]cos[CjπLα2LC]sin[jπLx]

=j=1n2[(1)j1π3j3]cos(αj2π)sin(jπ2x)


For n=5 :

u(x,t)=[4π3cos(2πα)sin(πx2)]+[427π3cos(6πα)sin(3πx2)]+[4125π3cos(10πα)sin(5πx2)]

When α=0.5 :

File:Ahalf.jpg

When α=1 :

File:Aone.jpg

When α=1.5 :

File:Aonehalf.jpg

When α=2 :

File:Atwo.jpg

--Egm4313.s12.team11.arrieta (talk) 06:20, 22 April 2012 (UTC)

R7.3

Problem Statement

Find (a) the scalar product, (b) the magnitude of f and g ,(c) the angle between f and g for:

1) f(x)=cos(x), g(x)=x for2x10

2) f(x)=12(3x21), g(x)=12(5x33x) for1x1

Part 1

solved by Kyle Gooding

Scalar Product

<f,g>=abf(x)g(x) dx

<f,g>=210xcos(x) dx

Using integration by parts;

<f,g>=[xsin(x)+cos(x)]210

                      <f,g>=7.68
Magnitude

f=<f,f>1/2=abf2(x) dx

=210[cos(x)]2 dx

=[.5(x+sin(x)cos(x)|210]1/2

                       f=2.457

g=abg2(x) dx

=210x2 dx
=[x3/3]210

                       g=10083
Angle Between Functions

cos(θ)=<f,g>fg

cos(θ)=7.6810083(2.457)

                      θ=89.47
The two functions are nearly orthogonal.

Part 2

solved by Luca Imponenti

Scalar Product

<f,g>=abf(x)g(x) dx

<f,g>=11[12(3x21)][12(5x33x)] dx

=1114(15x54x3+3x) dx
=14(156x6x4+32x2)|11
=14[(1561614+3212)(156(1)6(1)4+32(1)2)]

Since all exponents are even, everything in brackets cancels out

                      <f,g>=0
Magnitude

f=<f,f>1/2=abf2(x) dx

=11[12(3x21)]2 dx
=1114(9x46x2+1) dx
=14(95x52x3+x)|11
=14[(95152(1)3+1)(95(1)52(1)3+(1))]
=14[45(45)]
                       f=25

g=abg2(x) dx

=11[12(5x33x)]2 dx
=1114(25x630x4+9x2) dx
=14(257x76x5+3x3)|11
=14[(257176(1)5+3(1)3)(257(1)76(1)5+3(1)3)]
=14[47(47)]
                       g=27
Angle Between Functions

cos(θ)=<f,g>fg

Since <f,g>=0 the two functions are orthogonal

                         θ=90

R7.4

Solved by Gonzalo Perez

K 2011 pg.482 pb. 6

Problem Statement

Sketch or graph f(x) which for π<x<π is given as follows:

f(x)=|x|

Solution

The MATLAB code shown below was used to developed the graph of f(x)=|x|:

File:Problem6.jpg

File:Problem6graph.jpg

K 2011 pg.482 pb. 9

Problem Statement

Sketch or graph f(x) which for π<x<π is given as follows:

f(x)={x,if:π<x<0πx,if:0<x<π

Solution

The MATLAB code shown below was used to developed the graph of the piecewise function f(x)={x,if:π<x<0πx,if:0<x<π:

File:Problem9.jpg

File:Problem9graph.jpg



Solved by Jonathan Sheider

K 2011 p.482 pb. 12

Problem Statement

Find the Fourier series of the given function which is assumed to have a period of 2π. Show the details of your work.
Sketch or graph the partial sums up to that including cos(5x) and sin(5x)

Given:

f(x)=|x|

Solution

The Fourier series of a function with a period of p=2π is defined:

f(x)=a0+n=1(ancos(nx)+bnsin(nx))

Where:

a0=12πππf(x)dx
an=1πππf(x)cos(nx)dx
bn=1πππf(x)sin(nx)dx

This particular function given in the problem can be also defined in a piecewise manner over this interval, namely:

f(x)={x if πx0x if 0xπ

Calculating the first term a0:

a0=12π(π0xdx+0πxdx)
a0=12π([x22]π0+[x22]0π)
a0=12π((π22)+(π22))
a0=12π(π2)

                                                         a0=π2


Calculating the coefficient an:

an=1π(π0xcos(nx)dx+0πxcos(nx)dx)
an=1π(π0xcos(nx)dx+0πxcos(nx)dx)

Using integration by parts with the following substitutions:

u=x and therefore du=dx
dv=cos(nx)dx and therefore v=1nsin(nx)

This yields for the integral:

an=1π([1nxsin(nx)1nsin(nx)dx]π0+[1nxsin(nx)1nsin(nx)dx]0π)
an=1π([1nxsin(nx)+1n2cos(nx)]π0+[1nxsin(nx)+1n2cos(nx)]0π)
an=1π([1n2(1n(π)sin(nπ)+1n2cos(nπ))]+[1nπsin(nπ)+1n2cos(nπ)1n2])

Note that for all n = 1,2,3... : sin(nπ)=0 as sin(π)=sin(2π)=sin(3π)...=0 therefore these terms are evaluated as zero, which yields:

an=1π([1n2(0+1n2cos(nπ))]+[0+1n2cos(nπ)1n2])
an=1π(1n2+1n2cos(nπ)+1n2cos(nπ)1n2)

Note that cos(x)=cos(x) therefore:

an=1π(1n2+1n2cos(nπ)+1n2cos(nπ)1n2)
an=1π(2n2+2n2cos(nπ))
an=1π((2n2)(1cos(nπ))
an=2n2π(1cos(nπ))

To evaluate the term (1cos(nπ)):

Note that cos(nπ)=1 for odd n values as cos(π)=cos(3π)=cos(5π)...=1

And that cos(nπ)=1 for even n values as cos(2π)=cos(4π)=cos(6π)...=1.

Therefore, it can be concluded that for odd n values:

(1cos(nπ))=1(1)=2

And for even n values:

(1cos(nπ)=1(1)=0

Therefore, for the coefficient an, all even terms will equal zero while all odd terms will have a multiplier of 2, this yields (for all odd n values):

                                            an=4n2π for n=1,3,5...


Calculating the coefficient bn:

bn=1π(π0xsin(nx)dx+0πxsin(nx)dx)
bn=1π(π0xsin(nx)dx+0πxsin(nx)dx)

Using integration by parts with the following substitutions:

u=x and therefore du=dx
dv=sin(nx)dx and therefore v=1ncos(nx)

This yields for the integral:

bn=1π([1nxcos(nx)1ncos(nx)dx]π0+[1nxcos(nx)1ncos(nx)dx]0π)
bn=1π([1nxcos(nx)+1n2sin(nx)]π0+[1nxcos(nx)+1n2sin(nx)]0π)
bn=1π([0(1n(π)cos(nπ)+1n2sin(nπ))]+[1nπcos(nπ)+1n2sin(nπ)0])

Note that for all n = 1,2,3... : sin(nπ)=0 as sin(π)=sin(2π)=sin(3π)...=0 therefore these terms are evaluated as zero, which yields:

bn=1π([0(1n(π)cos(nπ)+0)]+[1nπcos(nπ)+0])
bn=1π([1n(π)cos(nπ)]+[1nπcos(nπ)])

Note that cos(x)=cos(x) therefore:

bn=1π(1nπcos(nπ)+1nπcos(nπ))
bn=1π(0)

                                                       bn=0

Therefore there will be no sin(nx) terms in the Fourier representation. In conclusion, the Fourier series representation for the given function is as follows:

f(x)=π24πcos(x)432πcos(3x)452πcos(5x)+...

                                    f(x)=π24π(cos(x)+19cos(3x)+125cos(5x)+...)



A graph of the function, and the Fourier series for n=1,3,5 is shown below:

File:R7.4.12.jpg
--Egm4313.s12.team11.sheider (talk) 06:00, 22 April 2012 (UTC)

K 2011 p.482 pb. 13

Problem Statement

Find the Fourier series of the given function which is assumed to have a period of 2π. Show the details of your work.
Sketch or graph the partial sums up to that including cos(5x) and sin(5x)

Given:

f(x)={x if π<x<0πx if 0<x<π

Solution

The Fourier series of a function with a period of p=2π is defined:

f(x)=a0+n=1(ancos(nx)+bnsin(nx))

Where:

a0=12πππf(x)dx
an=1πππf(x)cos(nx)dx
bn=1πππf(x)sin(nx)dx

Calculating the first term a0:

a0=12π(π0xdx+0π(πx)dx)
a0=12π([x22]π0+[πxx22]0π)
a0=12π((π22)+(π2π22))
a0=12π(π22+π2π22)
a0=12π(π2π2)

                                                         a0=0


Calculating the coefficient an:

an=1π(π0xcos(nx)dx+0π(πx)cos(nx)dx)

Using integration by parts with the following substitutions for the integral π0xcos(nx)dx:

u=x and therefore du=dx
dv=cos(nx)dx and therefore v=1nsin(nx)

Using integration by parts with the following substitutions for the integral 0π(πx)cos(nx)dx:

u=πx and therefore du=dx
dv=cos(nx)dx and therefore v=1nsin(nx)

This yields for the overall expression:

an=1π([1nxsin(nx)1nsin(nx)dx]π0+[1n(πx)sin(nx)1nsin(nx)dx]0π)
an=1π([1nxsin(nx)+1n2cos(nx)]π0+[1n(πx)sin(nx)1n2cos(nx)]0π)
an=1π([1n2(1n(π)sin(nπ)+1n2cos(nπ))]+[1n2cos(nπ)+1n2])

Note that for all n = 1,2,3... : sin(nπ)=0 as sin(π)=sin(2π)=sin(3π)...=0 therefore these terms are evaluated as zero, which yields:

an=1π([1n201n2cos(nπ)]+[1n2cos(nπ)+1n2])

an=1π(1n21n2cos(nπ)1n2cos(nπ)+1n2)

Note that cos(x)=cos(x) therefore:

an=1π(1n21n2cos(nπ)1n2cos(nπ)+1n2)

an=1π(2n22n2cos(nπ))
an=1π((2n2)(1cos(nπ)))
an=2n2π(1cos(nπ))

To evaluate the term (1cos(nπ)):

Note that cos(nπ)=1 for odd n values as cos(π)=cos(3π)=cos(5π)...=1

And that cos(nπ)=1 for even n values as cos(2π)=cos(4π)=cos(6π)...=1.

Therefore, it can be concluded that for odd n values:

(1cos(nπ))=1(1)=2

And for even n values:

(1cos(nπ))=1(1)=0

Therefore, for the coefficient an, all even terms will equal zero while all odd terms will have a multiplier of 2, this yields (for all odd n values):

                                            an=4n2π for n=1,3,5...


Calculating the coefficient bn:

bn=1π(π0xsin(nx)dx+0π(πx)sin(nx)dx)

Using integration by parts with the following substitutions for the integral π0xsin(nx)dx:

u=x and therefore du=dx
dv=sin(nx)dx and therefore v=1ncos(nx)

Using integration by parts with the following substitutions for the integral 0π(πx)sin(nx)dx:

u=πx and therefore du=dx
dv=sin(nx)dx and therefore v=1ncos(nx)

This yields for the overall expression:

bn=1π([1nxcos(nx)1ncos(nx)dx]π0+[1n(πx)cos(nx)1ncos(nx)dx]0π)
bn=1π([1nxcos(nx)+1n2sin(nx)]π0+[1n(πx)cos(nx)1n2sin(nx)]0π)
bn=1π([0(1n(π)cos(nπ)+1n2sin(nπ))]+[1n2sin(nπ)(1nπ)])
bn=1π(1nπcos(nπ)1n2sin(nπ)1n2sin(nπ)+1nπ)

Note that for all n = 1,2,3... : sin(nπ)=0 as sin(π)=sin(2π)=sin(3π)...=0 therefore these terms are evaluated as zero, which yields:

bn=1π(1nπcos(nπ)00+1nπ)
bn=1π(1nπ1nπcos(nπ))

Note that cos(x)=cos(x) therefore:

bn=1π(1nπ1nπcos(nπ))
bn=1π((πn)(1cos(nπ)))
bn=1n(1cos(nπ))

To evaluate the term (1cos(nπ)):

Note that cos(nπ)=1 for odd n values as cos(π)=cos(3π)=cos(5π)...=1

And that cos(nπ)=1 for even n values as cos(2π)=cos(4π)=cos(6π)...=1.

Therefore, it can be concluded that for odd n values:

(1cos(nπ))=1(1)=2

And for even n values:

(1cos(nπ))=1(1)=0

Therefore, for the coefficient bn, all even terms will equal zero while all odd terms will have a multiplier of 2, this yields (for all odd n values):

                                            bn=2n for n=1,3,5...


In conclusion, the Fourier series representation for the given function is as follows:

f(x)=0+(4πcos(x)+432πcos(3x)+452πcos(5x)+...)+(2sin(x)+23sin(3x)+25sin(5x)+...)


                   f(x)=4π(cos(x)+19cos(3x)+125cos(5x)+...)+2(sin(x)+13sin(3x)+15sin(5x)+...)



A graph of the function, and the Fourier series for n=1,3,5 is shown below:

File:R7.4.13.jpg
--Egm4313.s12.team11.sheider (talk) 06:00, 22 April 2012 (UTC)

R7.5

Solved by Daniel Suh

Problem Statement

Consider the following,
ϕ2j1,ϕ2k1=0pϕ2j1(x)ϕ2k1(x)dx

ϕ2j1,ϕ2k1=0psinjωxsinkωxdx

with jkandj,k=1,2,..., and p=2π,j=2,k=3

1. Find the integration with the given data.

2. Confirm the results with Matlab's trapz command for the trapezoidal rule.

Solution

Part 1

Trigonometric Identities

Angle Sum and Difference Identities

(1)cos(a+b)=cosacosbsinasinb
(2)cos(ab)=cosacosb+sinasinb


Rearrange

(1)sinasinb=cosacosbcos(a+b)
(2)cosacosb=cos(ab)sinasinb


Substitute and Combine

sinasinb=cos(ab)sinasinbcos(a+b)
2sinasinb=cos(ab)cos(a+b)
sinasinb=12cos(ab)12cos(a+b)

Utilize Trig Identities

ϕ2j1,ϕ2k1=0psinjwxsinkwxdx

ϕ2j1,ϕ2k1=02πsin2ωxsin3ωxdx

ϕ2j1,ϕ2k1=02π12cos(2ωx3ωx)12cos(2ωx+3ωx)dx

ϕ2j1,ϕ2k1=1202πcos(ωx)dx1202πcos(5ωx)dx

ϕ2j1,ϕ2k1=12sin(ωx)|02π12sin(5ωx)|02π

ϕ2j1,ϕ2k1=(00)(00)

                      ϕ2j1,ϕ2k1=0

Part 2

>> X = 0:2*pi/100:2*pi;

>> Y = sin(2*X).*sin(3*X);

>> Z = trapz(X,Y)

Z =

 2.9490e-017

Template:CourseCat