Wave equation soln check and plot question

In summary, the conversation discusses the solution to the wave equation $u_{tt}=c^2u_{xx}$ with given initial conditions. Using Fourier series, the solution is found to be $u(x,t)=\frac{8}{\pi^2}\sum\limits_{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]$. To plot the bar displacement distribution at 10 equally-spaced times during one period of
  • #1
Dustinsfl
2,281
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
  • #2
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?
 
  • #3
Ackbach said:
What is "the bar"? Are you solving the wave equation on a bar of some sort?

Yes
 
  • #4
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 [tex]sin(2X) = 2~sin(X)~cos(X)[/tex]
 
  • #5
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 [tex]sin(2X) = 2~sin(X)~cos(X)[/tex]

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?
 
  • #6
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.
[tex]sin(A)~cos(B) = \frac{1}{2} \cdot ( sin(A + B) + sin(A - B) )[/tex]

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

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
 
  • #7
topsquark said:
Ummm...Well...Okay, I goofed. (Doh)

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

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

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.
 
  • #8
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: 53
Last edited:
  • #9
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.
 

FAQ: Wave equation soln check and plot question

What is a wave equation solution?

A wave equation solution is a mathematical representation of a wave, which describes how a disturbance or oscillation propagates through a medium. It is commonly used in physics and engineering to analyze various types of waves, such as sound waves, light waves, and water waves.

How do you check if a wave equation solution is correct?

To check if a wave equation solution is correct, you can use various methods such as comparing it to known solutions, checking for consistency with the governing equations, and performing numerical simulations. Additionally, you can also use physical intuition and common sense to assess the reasonableness of the solution.

What is the process for plotting a wave equation solution?

The process for plotting a wave equation solution involves first obtaining the equation for the wave and its corresponding boundary and initial conditions. Then, the equation can be solved using analytical or numerical techniques, and the resulting solution can be plotted using a graphing tool or software. It is important to choose appropriate scales and labels for the axes and to verify the accuracy of the plotted solution.

What are the key parameters in a wave equation solution plot?

The key parameters in a wave equation solution plot are typically time and amplitude. Time represents the independent variable, while the amplitude represents the magnitude of the wave at a given point in space. Other parameters that may be included in the plot depend on the specific wave equation and its governing parameters, such as wavelength, frequency, and phase.

Can a wave equation solution plot be used to predict future behavior?

Yes, a wave equation solution plot can be used to predict future behavior. By analyzing the trend of the solution over time, we can make predictions about how the wave will behave in the future. However, the accuracy of these predictions depends on the accuracy of the initial conditions and the assumptions made in the wave equation.

Similar threads

Back
Top