University of Florida/Egm4313/s12.team5.R7

Question
Verify (4)-(5) p.19-9. (4): $$ <\Phi _i,\Phi _j> = 0, i\neq j $$ (5): $$ <\Phi _i,\Phi _j> = \frac{L}{2}, i=j $$

Solution
We know that: $$ \Phi _j(x) := sin\omega _jx, j=1,2, ... $$ We also know by definition that: $$ \langle \bar f, \bar g \rangle := \int_0^L \bar f(x) \, \bar g(x) \, dx $$ Therefore, we start with Eq. (4) and use the above definitions to obtain the following results: $$ <\Phi _i,\Phi _j> = \int_{0}^{L} sin(\omega _ix)sin(\omega _jx)dx $$ For simplicity's sake, we set L equal to $$ \pi $$. This yields the following result: $$ \int_{0}^{ \pi} sin(\omega _ix)sin(\omega _jx)dx = \frac{(\omega_i-\omega_j)sin((\omega_i+\omega_j)x)+(-\omega_i-\omega_j)sin((\omega_i-\omega_j)x)}{2\omega_i^2-2\omega_j^2} $$ This last expression is evaluated from $$ \pi $$ to zero. We know as a geometric property that the following two things are true: $$ sin(C\pi) = 0 $$ $$ sin(0) = 0 $$ Where "C" is any positive integer. We also know that since L = $$ \pi $$, p = 2L = $$ 2 \pi $$, and $$ \omega = \frac{2 \pi}{p} = \frac{2 \pi}{2 \pi} = 1 $$, so therefore every sine term in the definite integral is 0 when both $$ \pi $$ and 0 are evaluated. Therefore, we know that: $$ <\Phi _i,\Phi _j> = 0, i\neq j $$ Now, for Eq. (5), we evaluate is as follows: $$ <\Phi _j,\Phi _j> = \int_{0}^{L} sin(\omega _jx)^2 dx $$ Again, we set L equal to $$ \pi $$ to make the expression easier to evaluate. This yields: $$ \int_{0}^{ \pi} sin(\omega _jx)^2 dx = -(\frac{sin(2\omega_jx)-2\omega_jx}{4\omega_j}) $$ This integral is evaluated from $$ \pi $$ to 0. Again, we know that the sine terms will be zero no matter which boundary we plug again, since $$ \omega = 1 $$. Therefore, the evaluation simplifies to: $$ -(-\frac{2\omega_j\pi}{4\omega_j}-0) = \frac{\pi}{2} $$ Since we set L equal to $$ \pi $$, we have thus proven Eq. (5).

Author
This problem was solved and uploaded by: William Knapper

Question

 * Plot the truncated series $$\displaystyle u(x,t)=\sum_{j=1}^{n}a_{j}cos(cw_{j}t)sin(\omega _{j}x)$$
 * with n=5 and for $$\displaystyle t=\alpha \frac{2L}{c} $$
 * where $$\displaystyle \alpha = 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

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

$$ \displaystyle 1. f(x) = \cos(x), g(x) = x\ $$ for $$ \displaystyle -2\leq x\leq 10\ $$

and

$$ \displaystyle 2. f(x) = \frac{1}{2} (3x^2-1), g(x) = \frac{1}{2} (5x^3-3x)\ $$ for $$ \displaystyle -1\leq x\leq 1\ $$

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

$$ \displaystyle < f,g> = \int_{a}^{b} f(x) g(x)dx\ $$

The magnitude of a function is defined by:

$$ \displaystyle \left \| f \right \| = < f,f> ^\frac{1}{2} = \left [ \int_{a}^{b} f^2(x)dx\right ]^\frac{1}{2}\ $$

The angle between 2 functions is defined by:

$$ \displaystyle \cos(\theta ) = \frac{< f,g> }{\left \| f \right \|\left \| g \right \|}\ $$

Problem 1:

$$ \displaystyle  = \int_{-2}^{10} x \cos(x) dx\ $$

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

The integral becomes: $$ \displaystyle x\sin(x) - \int \sin(x) dx = x\sin(x) + \cos(x)\mid_{-2}^{10} = -7.68\ $$

$$ \displaystyle \left \| f \right \| = [\int_{-2}^{10}\cos^2(x) dx] ^ \frac{1}{2} = [\int_{-2}^{10} \frac{1+\cos(2x)}{2} dx] ^\frac{1}{2} = [\frac{x}{2} + \frac{\sin(2x)}{4}\mid _{-2}^{10} ] ^ \frac{1}{2} = 2.46\ $$

$$ \displaystyle \left \| g \right \| = [\int_{-2}^{10}x^2 dx]^\frac{1}{2} = [\frac{x^3}{3}\mid _{-2}^{10}] ^\frac{1}{2} = 18.33\ $$

$$ \displaystyle \cos(\theta ) = \frac{-7.68}{18.33*2.46} \Rightarrow \theta = 1.742\ $$ rads

Problem 2:

$$ \displaystyle  = \int_{-1}^{1} \frac{1}{2} (3x^2-1) * \frac{1}{2} (5x^3 - 3x) dx = \int_{-1}^{1} (\frac{15}{4} x^5 - \frac{7}{2} x^3 + \frac{3}{4}x) dx\ $$

The integral becomes: $$ \displaystyle \frac{5}{8} x^6 - \frac{7}{8} x^4 + \frac{3}{8} x^2 \mid_{-1}^{1} = 0\ $$

$$ \displaystyle \left \| f \right \| = [\int_{-1}^{1} [\frac{1}{2}(3x^2-1)]^2 dx] ^\frac{1}{2} = [\int_{-1}^{1} (\frac {9}{4}x^4 - \frac{3}{2}x^2 + \frac{1}{4}) dx ] ^\frac{1}{2} = [\frac{9}{20}x^5-\frac{1}{2}x^3 + \frac{1}{4}x \mid_{-1}^{1} ] ^\frac{1}{2} = 0.632\ $$

$$ \displaystyle \left \| g \right \| = [\int_{-1}^{1} [\frac{1}{2} (5x^3-3x)]^2 dx]^\frac{1}{2} = [\int_{-1}^{1} (\frac{25}{4}x^6 - \frac{15}{2}x^4 + \frac{9}{4} x^2) dx] ^\frac{1}{2} = [\frac{25}{28}x^7 - \frac{3}{2}x^5 +\frac{3}{4}x^3 \mid _{-1}^{1} ] ^\frac{1}{2} = 0.535\ $$

$$ \displaystyle \cos(\theta) = 0 \Rightarrow \theta = \pi / 2\ $$ rads.

Author
This problem was solved and uploaded by: David Herrick

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

problems 6,9: Sketch or graph f(x) for $$-\pi < x < \pi $$.

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 $$ -\pi < x < \pi $$

Problem 9: f(x) = x for $$ -\pi < x < 0 $$

and f(x) = $$ \pi - x $$ if $$ 0 < x < \pi $$

Solution
Problem 6: f(x) = |x|

MATLAB code used:

Problem 9: $$ f(x) = x $$ if $$ -\pi < x < 0 $$ $$ f(x) = \pi - x $$ if $$ 0 < x < \pi $$

MATLAB code used:

Problem 12: f(x) = |x| breaks down into: $$ f(x) = -x $$ if $$ -\pi < x < 0 $$ and $$ f(x) = x $$ if $$ 0 < x < \pi $$ The formula for the fourier series is: $$ f(x) = a_0 + \sum_{n=1}^\infty [a_n \cos(nx) + b_n \sin(nx)] $$ The euler formulas are also: $$ a_0 = \frac{1}{2\pi} \int_{-\pi}^\pi f(x) dx $$ $$ a_n = \frac{1}{\pi} \int_{-\pi}^\pi f(x) \cos(nx) dx $$ $$ b_n = \frac{1}{\pi} \int_{-\pi}^\pi f(x) \sin(nx) dx $$ Therefore: $$ a_0 = \frac{1}{2\pi} [\int_{-\pi}^0 -xdx + \int_0^\pi xdx] $$ $$ a_n = \frac{1}{\pi} [ \int_{-\pi}^0 -x\cos(nx)dx + \int_0^\pi x\cos(nx)dx] $$ $$ b_n = \frac{1}{\pi} [ \int_{-\pi}^0 -x\sin(nx)dx + \int_0^\pi x\sin(nx)dx] $$ After integration for $$ a_0 $$ and integration by parts for $$ a_n $$ and $$ b_n $$: $$ a_0 = \frac{\pi}{2} $$ $$ a_n = \frac{2}{\pi n^2} (\cos(-n\pi) - 1) $$ $$ b_n = 0 $$ Similarly, for n = even, $$ a_n = 0 $$ and for n = odd, $$ a_n = \frac{-4}{n^2 \pi} $$ Therefore, the fourier series out to n = 5 is: $$ f_5 (x) = \frac{\pi}{2} - \frac{4}{\pi} \cos(x) - \frac{4}{9 \pi} \cos(3x) - \frac{4}{25 \pi} \cos(5x) $$ Problem 13: $$ f(x) = x $$ if $$ -\pi < x < 0 $$ $$ f(x) = \pi - x $$ if $$ 0 < x < \pi $$ The euler formulas are the same as in problem 12. Plugging in problem 13's f(x): $$ a_0 = \frac{1}{2 \pi} [\int_{-\pi}^0 xdx + \int_0^\pi (\pi-x)dx] $$ $$ a_n = \frac{1}{\pi} [ \int_{-\pi}^0 x\cos(nx)dx + \int_0^\pi (\pi- x)\cos(nx)dx] $$ $$ b_n = \frac{1}{\pi} [ \int_{-\pi}^0 x\sin(nx)dx + \int_0^\pi (\pi - x)\sin(nx)dx] $$ Therefore, after using integration for $$ a_0 $$ and integration by parts for $$ a_n $$ and $$ b_n $$: $$ a_0 = 0 $$ $$ a_n = \frac{2}{n^2 \pi} (1-\cos(n \pi)) $$ $$ b_n = \frac{1}{n}(1-\cos(n \pi)) $$ Therefore, when n is odd, $$ a_n = \frac{4}{n^2 \pi} $$ and $$ b_n = \frac{2}{n} $$. Similarly, when n is even, $$ a_n = 0 = b_n $$. Therefore, the fourier series out to n = 5 is: $$ f_5(x) = \frac{4}{\pi} [\cos(x) + \frac{1}{9} \cos(3x) + \frac{1}{25} \cos(5x)] + 2 [\sin(x) + \frac{1}{3} \sin(3x) + \frac{1}{5} \sin(5x)] $$

Author
The problem was solved and uploaded by John North.

Question
Consider (1)p.12-4: $$ <\Phi_{2j-1} \Phi_{2k-1}> = \int_0^p \sin j \omega x \cdot \sin k \omega x dx $$ where $$ p=2 \pi, 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.

Part 1
Using (3)p19-10 we get: $$ \int_0^{2 \pi} \sin j \omega x \cdot \sin k \omega x dx = \int_0^{2 \pi} \frac12 \left [cos(j \omega - k \omega)x - cos(j \omega + k \omega)x \right] dx $$

Integrating we get: $$ \frac{sin((j\omega-k\omega)x)}{2(j\omega-k\omega)}-\frac{sin((j\omega+k\omega)x)}{2(j\omega+k\omega)} $$

Plugging in the known values we have: $$ \frac{sin((2\omega-3\omega)x)}{2(2\omega-3\omega)}-\frac{sin((2\omega+3\omega)x)}{2(2\omega+3\omega)} = \frac{sin(-1\omega x)}{-2\omega}-\frac{sin(5\omega x)}{10\omega}$$

Solving from 0 to $$ 2 \pi $$: $$ \left [ \frac{sin(-2\omega \pi)}{-2\omega}-\frac{sin(10\omega \pi)}{10\omega} \right ] - \left [\frac{sin(0)}{-2\omega}-\frac{sin(0)}{10\omega} \right ] $$

We know that: $$ sin(C\pi)=0 $$ if C is any integer $$ sin(0)=0 $$

Thus, if $$ \omega $$ is an an integer, the solution to the equation becomes: $$ 0-0=0 $$

Therefore: $$ <\Phi_{3},\Phi_{5}> = \int_0^{2 \pi} \sin 2 \omega x \cdot \sin 3 \omega x dx = 0 $$

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

$$ \sin j \omega x \cdot \sin k \omega x dx $$

was found from 0 to $$ 2 \pi $$. The assumption of $$ \omega $$ 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,

$$ \int_0^{2 \pi} \sin 2 \omega x \cdot \sin 3 \omega x dx = 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