Wave equation soln check and plot question

Click For Summary

Discussion Overview

The discussion revolves around solving the wave equation with specific boundary and initial conditions, focusing on the formulation of the solution and the subsequent plotting of the bar displacement distribution over time. Participants explore the mathematical derivation of the solution and seek clarification on the plotting process in Mathematica.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested
  • Homework-related

Main Points Raised

  • Participants derive the wave equation solution using Fourier series, noting the initial conditions and boundary conditions.
  • There is a question about the meaning of "the bar" in the context of the wave equation, with confirmation that it refers to a physical bar.
  • One participant suggests finding the period of motion and plotting the displacement at intervals of T/10.
  • Another participant expresses uncertainty about combining sine and cosine functions in the context of the wave equation solution.
  • There is a discussion about the convergence of the series and the potential for approximating the shape of the wave using a finite number of terms.
  • Concerns are raised about the determination of the period and its potential variability at different time steps.
  • Participants share Mathematica code snippets for plotting the function, but there is uncertainty about the correctness of the approach.
  • One participant acknowledges the complexity of the wave packet as n approaches infinity, indicating a potential challenge in the analysis.

Areas of Agreement / Disagreement

Participants express various viewpoints on the mathematical aspects of the wave equation and its solution, with no clear consensus on the plotting methodology or the implications of the wave packet behavior.

Contextual Notes

There are unresolved questions regarding the assumptions made in the mathematical derivation, the specifics of the plotting process in Mathematica, and the implications of the wave packet as n increases.

Who May Find This Useful

Readers interested in wave equations, Fourier series, mathematical modeling, and computational plotting in software like Mathematica may find this discussion relevant.

Dustinsfl
Messages
2,217
Reaction score
5
\begin{alignat*}{3}
u_{tt} & = & c^2u_{xx}\\
u(0,t) & = & 0\\
u_x(L,t) & = & 0\\
u(x,0) & = & \frac{x}{L}\\
u_t(x,0) & = & 0

\end{alignat*}

Let's start with $u_t(x,0) = 0$. Then
$$
u_t(x,0) = \sum_{n = 1}^{\infty}B_n\frac{\pi c}{L}\left(n + \frac{1}{2}\right)\sin\left[\frac{\pi x}{L}\left(n + \frac{1}{2}\right)\right] = 0.
$$
That is, $B_n = 0$. Using the first initial condition, we have
$$
u(x,0) = \sum_{n = 1}^{\infty}A_n\sin\left[\frac{\pi x}{L}\left(n + \frac{1}{2}\right)\right] = \frac{x}{L}.
$$
Now we can solve for the Fourier coefficient $A_n$.
\begin{alignat*}{3}
A_n & = & \frac{2}{L^2}\int_0^{\pi}x\sin\left[\frac{\pi x}{L}\left(n + \frac{1}{2}\right)\right]dx\\
& = & \left.\frac{-4(2n + 1)x\pi\cos\left[\left(n + \frac{1}{2}\right)\frac{\pi x}{L}\right] + 8L\sin\left[\left(n + \frac{1}{2}\right)\frac{\pi x}{L}\right]}{L\pi^2(2n + 1)^2}\right|_0^{\pi}\\
& = & \frac{8\cos n\pi + 4(2n + 1)\pi\sin n\pi}{\pi^2(2n + 1)^2}\\
& = & \frac{8(-1)^n}{\pi^2(2n + 1)^2}
\end{alignat*}
So the solution is
$$
u(x,t) = \frac{8}{\pi^2}\sum_{n = 1}^{\infty}\frac{(-1)^n}{(2n + 1)^2}\sin\left[\frac{\pi x}{L}\left(n + \frac{1}{2}\right)\right]\cos\left[\frac{\pi ct}{L}\left(n + \frac{1}{2}\right)\right].
$$
When $L = \pi$ and $c = 1$, we have $u(x,t) = \frac{8}{\pi^2}\sum\limits_{n = 1}^{\infty}\frac{(-1)^n}{(2n + 1)^2}\sin\left[x\left(n + \frac{1}{2}\right)\right]\cos\left[t\left(n + \frac{1}{2}\right)\right]$.

Plot the bar displacement distribution at 10 equally-spaced times during one period of oscillation. What is this asking me to do?
 
Physics news on Phys.org
dwsmith said:
\begin{alignat*}{3}
u_{tt} & = & c^2u_{xx}\\
u(0,t) & = & 0\\
u_x(L,t) & = & 0\\
u(x,0) & = & \frac{x}{L}\\
u_t(x,0) & = & 0

\end{alignat*}

Let's start with $u_t(x,0) = 0$. Then
$$
u_t(x,0) = \sum_{n = 1}^{\infty}B_n\frac{\pi c}{L}\left(n + \frac{1}{2}\right)\sin\left[\frac{\pi x}{L}\left(n + \frac{1}{2}\right)\right] = 0.
$$
That is, $B_n = 0$. Using the first initial condition, we have
$$
u(x,0) = \sum_{n = 1}^{\infty}A_n\sin\left[\frac{\pi x}{L}\left(n + \frac{1}{2}\right)\right] = \frac{x}{L}.
$$
Now we can solve for the Fourier coefficient $A_n$.
\begin{alignat*}{3}
A_n & = & \frac{2}{L^2}\int_0^{\pi}x\sin\left[\frac{\pi x}{L}\left(n + \frac{1}{2}\right)\right]dx\\
& = & \left.\frac{-4(2n + 1)x\pi\cos\left[\left(n + \frac{1}{2}\right)\frac{\pi x}{L}\right] + 8L\sin\left[\left(n + \frac{1}{2}\right)\frac{\pi x}{L}\right]}{L\pi^2(2n + 1)^2}\right|_0^{\pi}\\
& = & \frac{8\cos n\pi + 4(2n + 1)\pi\sin n\pi}{\pi^2(2n + 1)^2}\\
& = & \frac{8(-1)^n}{\pi^2(2n + 1)^2}
\end{alignat*}
So the solution is
$$
u(x,t) = \frac{8}{\pi^2}\sum_{n = 1}^{\infty}\frac{(-1)^n}{(2n + 1)^2}\sin\left[\frac{\pi x}{L}\left(n + \frac{1}{2}\right)\right]\cos\left[\frac{\pi ct}{L}\left(n + \frac{1}{2}\right)\right].
$$
When $L = \pi$ and $c = 1$, we have $u(x,t) = \frac{8}{\pi^2}\sum\limits_{n = 1}^{\infty}\frac{(-1)^n}{(2n + 1)^2}\sin\left[x\left(n + \frac{1}{2}\right)\right]\cos\left[t\left(n + \frac{1}{2}\right)\right]$.

Plot the bar displacement distribution at 10 equally-spaced times during one period of oscillation. What is this asking me to do?

What is "the bar"? Are you solving the wave equation on a bar of some sort?
 
Ackbach said:
What is "the bar"? Are you solving the wave equation on a bar of some sort?

Yes
 
Find how long one period of the motion is (call it T) then at each T/10 find out what u(x, t) is. ie. You'll have a plot of x vs u(x, NT/10) (where N is a number between 1 and 10) for each N.

That's my 2 cents.

-Dan

PS The summation looks a lot nicer if you use sin(2X) = 2~sin(X)~cos(X)
 
topsquark said:
Find how long one period of the motion is (call it T) then at each T/10 find out what u(x, t) is. ie. You'll have a plot of x vs u(x, NT/10) (where N is a number between 1 and 10) for each N.

That's my 2 cents.

-Dan

PS The summation looks a lot nicer if you use sin(2X) = 2~sin(X)~cos(X)

Do you know how I could construct that with Mathematica? Sine and cosine are different though. Sine has a x and cosine a t, so how can they be combined?
 
dwsmith said:
Sine and cosine are different though. Sine has a x and cosine a t, so how can they be combined?
Ummm...Well...Okay, I goofed. (Doh)

Let's try this though.
sin(A)~cos(B) = \frac{1}{2} \cdot ( sin(A + B) + sin(A - B) )

So the trig function part of the summation gives
\sin \left [ (x + t) \left ( n + \frac{1}{2} \right ) \right ] + \sin \left [ (x - t) \left ( n + \frac{1}{2} \right ) \right ]

I like this form better because it reminds me of the good old-fashioned wave packet stuff they made me learn in Quantum.

Mathematica says the series converges. I haven't tried to plot anything, but the series looks like it ought to behave well. Maybe you can just use the first few n's to approximate the shape?

-Dan
 
topsquark said:
Ummm...Well...Okay, I goofed. (Doh)

Let's try this though.
sin(A)~cos(B) = \frac{1}{2} \cdot ( sin(A + B) + sin(A - B) )

So the trig function part of the summation gives
\sin \left [ (x + t) \left ( n + \frac{1}{2} \right ) \right ] + \sin \left [ (x - t) \left ( n + \frac{1}{2} \right ) \right ]

Mathematica says the series converges. I haven't tried to plot anything, but the series looks like it ought to behave well. Maybe you can just use the first few n's to approximate the shape?

-Dan

That is d'Almbert's solution. I am aware of it. My true problem is the plotting in Mathematica software.
 
How will the period be determined? Wont it be different at each time step?

Code:
Nmax = 50;
L = Pi;
c = 1;
\[Lambda] = Table[Pi/L*(n + 1/2), {n, 1, Nmax}];
MyTime = Table[t, {t, 1, 10, 1}];
f[x_] = x;

A = Table[
   2/L*Integrate[f[x]*Sin[\[Lambda][[n]]*x], {x, 0, L}], {n, 1, Nmax}];
u[x_, t_] = 
  Sum[Sin[x*\[Lambda][[n]]]*Cos[t*\[Lambda][[n]]], {n, 1, Nmax}];
Plot[u[x, MyTime], {x, 0, .135}, PlotStyle -> {Red}, PlotRange -> All,
  AspectRatio -> 3/4]

View attachment 441
 

Attachments

  • hw7problem2.jpg
    hw7problem2.jpg
    10.2 KB · Views: 88
Last edited:
dwsmith said:
That is d'Almbert's solution. I am aware of it. My true problem is the plotting in Mathematica software.
That is a problem. As I'm sure you've realized there is no wavelength for the wave packet as n goes to infinity.

Perplexing.

-Dan
 
  • #10
topsquark said:
That is a problem. As I'm sure you've realized there is no wavelength for the wave packet as n goes to infinity.

Perplexing.

-Dan

I have something but I am not sure if it is right. See my first previous post.
 
  • #11
dwsmith said:
I have something but I am not sure if it is right. See my first previous post.
Sorry. I'm not sure what you are working on.

-Dan
 
  • #12
topsquark said:
Sorry. I'm not sure what you are working on.

-Dan

Plotting the function at 10 equal time steps in one period.
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 11 ·
Replies
11
Views
4K