MHB Wave equation soln check and plot question

Click For Summary
The discussion revolves around solving the wave equation with specific boundary and initial conditions, leading to the Fourier series solution for displacement over time. The solution is expressed as a series involving sine and cosine functions, particularly for a bar with length L and wave speed c. Participants discuss how to plot the displacement distribution at ten equally spaced time intervals during one oscillation period, clarifying the need to compute the displacement at these intervals. There is also a focus on using Mathematica for plotting, with considerations on the convergence of the series and the behavior of the wave at different time steps. The conversation emphasizes the mathematical intricacies of the wave equation and its graphical representation.
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: 84
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 8 ·
Replies
8
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
821
  • · Replies 11 ·
Replies
11
Views
4K
  • · Replies 36 ·
2
Replies
36
Views
5K