User:Egm4313.s12.team8.tclamb/R7-2

=R7.2 - Animate a standing wave=

Problem Statement
Plot the truncated-series:
 * $$u(x,t)\,=\,\sum\limits_{j=1}^n a_j \cos(c \omega_j t) \sin(\omega_j x)$$

with $$n$$ sufficiently high to have an accurate approximation of the original function, and for:
 * $$t\,=\,\alpha p_1\,=\,\alpha \frac{2\pi}{c \omega_1}\,=\,\alpha\frac{2L}{c}$$
 * $$\alpha\,=\,0.5,\,1,\,1.5,\,2$$

and:
 * $$\omega_j\,=\,j\frac{\pi}{L}$$
 * $$a_j\,=\,\begin{cases} 0 \text{ for } j=2m \text{ (even)} \\ -4 / (\pi^3 j^3) \text{ for } j = 2 m + 1 \text{ (odd)} \end{cases}$$

Create an animation of the wave motion in gif format.

Level 2 Solution
We generated an animation of the solution for varying n and holding x and t steady with the following Mathematica code:
 * [[Image:test - Mathematica Code.png]]

As apparent from the following animation of the wave, for $$n > 4$$, there is negligible change in the form of the approximate solution.
 * [[Image:test.gif]]

Nevertheless, we used $$n=200$$ because we could. It doesn't hurt to use a higher accuracy, but increasing n any further would result in extremely slow evaluation. The following Mathematica code generated the following graphs for $$\alpha\,=\,0.5,\,1,\,1.5,\,2$$:
 * [[Image:alpha Mathematica Code.png]]
 * [[Image:alpha = 0.5.png]]
 * [[Image:alpha = 1.0.png]]
 * [[Image:alpha = 1.5.png]]
 * [[Image:alpha = 2.0.png]]

We generated the animation of the wave motion for $$n = 200$$ over three periods in x, and one period in t with the following Mathematica code:
 * [[Image:wave - Mathematica Code.png]]

As apparent from the following animation of the wave, this is a standing wave.
 * [[Image:wave2.gif]]

=R6 Level 2 Report Additions=

R6.4
We used the following Mathematica commands to solve for the analytical solution in the case n=8, the output is also shown:



We used the following Mathematica commands to generate plots for the homogeneous, particular, and complete solutions:



Plot of homogeneous solution $$ y_{h,n}(x) $$



Note the scale on the vertical axis as the homogeneous solution behaves exponentially and reaches a large magnitude of $$10^8$$ over the interval.

Plot of particular solution $$ y_{p,n}(x) $$



Note the significantly smaller scale on the vertical axis as the particular solution oscillates to a magnitude of less than 1 over the interval.

Plot of complete solution $$ y_{n}(x) = y_{h,n}(x) + y_{p,n}(x)$$



Here the complete solution is shown to be completely dominated by the homogeneous solution. This is expected due to the exponential behavior of the homogeneous solution.

R4.4
The following code generates the plot for $$y_{11}(x)$$:





Here $$y_{11}(x)$$ is the Taylor series expansion about 0 and $$y_{11,ext}(x)$$ is the Taylor series expansion extended about 0.9. The plot shows that extending the expansion has no significant effect on the accuracy of the solution.

As for the discrepancy between our plot and the TA's, we are unable to identify the cause, as his solution does not show the input used for n=11. However, our version of the plot clearly shows convergence up through x=2 before diverging, as expected from graphs of n<11:
 * [[Image:Egm4313.s12.team8.tclamb.r4.4.4.png]]

=Division of Labor=

To finish the Level 2 R7 and R6 Additions, we met in Marston regularly over the past week. For R6.4's Additions, Kyle rendered Thomas's Mathematica code from R6 Level 2 and uploaded it to Wikiversity. Thomas made minor modifications to the code to generate separate plots of both the homogeneous and particular solutions, and Kyle uploaded and commented on these alongside the prior plots of the complete solution. For R6.5's Additions, we discussed what to add and also spent a while experimenting, trying to determine how exactly the TA went wrong in his solutions. However, this proved fruitless without the TA's input. As before, Thomas rendered the graph, and Kyle organized the information. Finally, for R7.2 Thomas had previously written code for the Level 1 solution of the problem. With a few minor modifications, we arrived at the Level 2 solution and animation.