University of Florida/Egm4313/s12.team5.R7

From testwiki
Revision as of 02:21, 17 October 2020 by imported>MaintenanceBot (Category:Pages with broken file links)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:Big3

R 7.1

Question

Verify (4)-(5) p.19-9.
(4):

<Φi,Φj>=0,ij

(5):

<Φi,Φj>=L2,i=j

Solution

We know that:

Φj(x):=sinωjx,j=1,2,...

We also know by definition that:

f¯,g¯:=0Lf¯(x)g¯(x)dx

Therefore, we start with Eq. (4) and use the above definitions to obtain the following results:

<Φi,Φj>=0Lsin(ωix)sin(ωjx)dx

For simplicity's sake, we set L equal to π. This yields the following result:

0πsin(ωix)sin(ωjx)dx=(ωiωj)sin((ωi+ωj)x)+(ωiωj)sin((ωiωj)x)2ωi22ωj2

This last expression is evaluated from π to zero. We know as a geometric property that the following two things are true:

sin(Cπ)=0
sin(0)=0

Where "C" is any positive integer. We also know that since L = π, p = 2L = 2π, and ω=2πp=2π2π=1, so therefore every sine term in the definite integral is 0 when both π and 0 are evaluated. Therefore, we know that:

<Φi,Φj>=0,ij

Now, for Eq. (5), we evaluate is as follows:

<Φj,Φj>=0Lsin(ωjx)2dx

Again, we set L equal to π to make the expression easier to evaluate. This yields:

0πsin(ωjx)2dx=(sin(2ωjx)2ωjx4ωj)

This integral is evaluated from π to 0. Again, we know that the sine terms will be zero no matter which boundary we plug again, since ω=1. Therefore, the evaluation simplifies to:

(2ωjπ4ωj0)=π2

Since we set L equal to π, we have thus proven Eq. (5).

Author

This problem was solved and uploaded by: William Knapper

R 7.2

Question

Plot the truncated series u(x,t)=j=1najcos(cwjt)sin(ωjx)
with n=5 and for t=α2Lc
where α=0.5,1,1.5,2

Solution

Matlab Code:

% Report 7 Problem 2
% Plot truncated series for n=5
% Given values
L = 2;
c = 3;
% Calculate alphas for use in t
alpha = (0.5:.5:2); % four alpha terms
t = ((alpha.*2*L)/c); % four "t" terms corresponding to the four alpha terms
% Calculate omegas (w)
j = (1:1:5); % series terms 1-5
w = ((j*pi)/L); % omega correspoding to series terms 1-5
% Calculate "a" coefficients
% Check if "a" is odd or even, then assign value
a = j;
for k=1:5;
if mod(k,2) == 0 % even term
   a(k) = 0;
else % odd term
   a(k) = -4/(pi^3*k^3);
end
end
% Calculate truncated series (note that a2=a4=0, so those terms in the
% series have no contribution
x=(0:0.01:2);
% For t=0.5
y1=zeros(size(x));
for k=1:5
   y1 = y1 + a(k)*cos(c*w(k)*t(1))*sin(w(k)*x);
end
% For t=1.0
y2=zeros(size(x));
for k=1:5
   y2 = y2 + a(k)*cos(c*w(k)*t(2))*sin(w(k)*x);
end
% For t=1.5
y3=zeros(size(x));
for k=1:5
  y3 = y3 + a(k)*cos(c*w(k)*t(3))*sin(w(k)*x);
end
% For t=2.0
y4=zeros(size(x));
for k=1:5
   y4 = y4 + a(k)*cos(c*w(k)*t(4))*sin(w(k)*x);
end
% Compare to original function
yorg = x.*(x-2);
plot(x,y1,x,y2,x,y3,x,y4,x,yorg)
legend('t=0.5','t=1.0','t=1.5','t=2.0','org function')

Plot of 4 different t's and original function:

Author

This problem was solved and uploaded by: Josh House

R 7.3

Question

Find the a) scalar product, b) the magnitude, and c) the angle between:

1.f(x)=cos(x),g(x)=x  for 2x10 

and

2.f(x)=12(3x21),g(x)=12(5x33x)  for 1x1 

Solution

The scalar product between 2 functions on the interval [a,b] is defined by:

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

The magnitude of a function is defined by:

f=<f,f>12=[abf2(x)dx]12 

The angle between 2 functions is defined by:

cos(θ)=<f,g>fg 

Problem 1:

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

Using integration by parts: u=x,du=dx,dV=cos(x)dx,V=sin(x) 

The integral becomes:  xsin(x)sin(x)dx=xsin(x)+cos(x)210=7.68 
f=[210cos2(x)dx]12=[2101+cos(2x)2dx]12=[x2+sin(2x)4210]12=2.46 
g=[210x2dx]12=[x33210]12=18.33 
cos(θ)=7.6818.33*2.46θ=1.742  rads

Problem 2:

<f,g>=1112(3x21)*12(5x33x)dx=11(154x572x3+34x)dx 

The integral becomes: 58x678x4+38x211=0 
f=[11[12(3x21)]2dx]12=[11(94x432x2+14)dx]12=[920x512x3+14x11]12=0.632 
g=[11[12(5x33x)]2dx]12=[11(254x6152x4+94x2)dx]12=[2528x732x5+34x311]12=0.535 
cos(θ)=0θ=π/2  rads.

Author

This problem was solved and uploaded by: David Herrick

R 7.4

Question

K. 2011 p482 pb. 6,9,12,13:

problems 6,9: Sketch or graph f(x) for π<x<π.

problems 12,13: Find the fourier series for the f(x) in problems 6 and 9 respectively up to n = 5.

Problem 6: f(x) = |x| for π<x<π

Problem 9: f(x) = x for π<x<0

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

Solution

Problem 6: f(x) = |x|


MATLAB code used:



Problem 9:
f(x)=x if π<x<0
f(x)=πx if 0<x<π


MATLAB code used:



Problem 12:
f(x) = |x| breaks down into:
f(x)=x if π<x<0 and
f(x)=x if 0<x<π
The formula for the fourier series is:
f(x)=a0+n=1[ancos(nx)+bnsin(nx)]
The euler formulas are also:
a0=12πππf(x)dx
an=1πππf(x)cos(nx)dx
bn=1πππf(x)sin(nx)dx
Therefore:
a0=12π[π0xdx+0πxdx]
an=1π[π0xcos(nx)dx+0πxcos(nx)dx]
bn=1π[π0xsin(nx)dx+0πxsin(nx)dx]
After integration for a0 and integration by parts for an and bn:
a0=π2
an=2πn2(cos(nπ)1)
bn=0
Similarly, for n = even, an=0 and for n = odd, an=4n2π
Therefore, the fourier series out to n = 5 is:

f5(x)=π24πcos(x)49πcos(3x)425πcos(5x)



Problem 13:
f(x)=x if π<x<0
f(x)=πx if 0<x<π
The euler formulas are the same as in problem 12. Plugging in problem 13's f(x):
a0=12π[π0xdx+0π(πx)dx]
an=1π[π0xcos(nx)dx+0π(πx)cos(nx)dx]
bn=1π[π0xsin(nx)dx+0π(πx)sin(nx)dx]
Therefore, after using integration for a0 and integration by parts for an and bn:
a0=0
an=2n2π(1cos(nπ))
bn=1n(1cos(nπ))
Therefore, when n is odd, an=4n2π and bn=2n.
Similarly, when n is even, an=0=bn.
Therefore, the fourier series out to n = 5 is:

f5(x)=4π[cos(x)+19cos(3x)+125cos(5x)]+2[sin(x)+13sin(3x)+15sin(5x)]

Author

The problem was solved and uploaded by John North.

R 7.5

Question

Consider (1)p.12-4:
<Φ2j1Φ2k1>=0psinjωxsinkωxdx
where p=2π,j=2,k=3.

1. Find the exact integration of (1)p.12-4 with the given data.
2. Confirm the result with matlab's trapz command for the trapezoidal rule as explained in (4)p.11-2.

Solution

Part 1

Using (3)p19-10 we get:
02πsinjωxsinkωxdx=02π12[cos(jωkω)xcos(jω+kω)x]dx

Integrating we get:
sin((jωkω)x)2(jωkω)sin((jω+kω)x)2(jω+kω)

Plugging in the known values we have:
sin((2ω3ω)x)2(2ω3ω)sin((2ω+3ω)x)2(2ω+3ω)=sin(1ωx)2ωsin(5ωx)10ω

Solving from 0 to 2π:
[sin(2ωπ)2ωsin(10ωπ)10ω][sin(0)2ωsin(0)10ω]

We know that:
sin(Cπ)=0 if C is any integer
sin(0)=0

Thus, if ω is an an integer, the solution to the equation becomes:
00=0

Therefore:

<Φ3,Φ5>=02πsin2ωxsin3ωxdx=0


Part 2

Using MATLAB's TRAPZ method, a variable X was created from 0 to 2π and the integral of

sinjωxsinkωxdx

was found from 0 to 2π. The assumption of ω being an integer and in this case = 1 was made.

The following was the outcome in MATLAB:

-3.8317e-007 is used as an equivalent to 0.

Therefore through MATLAB's TRAPZ method,

02πsin2ωxsin3ωxdx=0

Author

Part 1 of this problem was solved and uploaded by Radina Dikova.

Part 2 of this problem was solved and uploaded by Derik Bell.

Contribution Summary

Problem 1 was solved by: William Knapper

Problem 2 was solved by: Joshua House

Problem 3 was solved by: David Herrick

Problem 4 was solved by: John North

Problem 5 part 1 was solved by: Radina Dikova

Problem 5 part 2 was solved by: Derik Bell