1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Plotting the wave equation

  1. Nov 10, 2012 #1
    $$
    u(x,t) = \frac{1}{2}\int_{x - t}^{x + t}g(s)ds = \begin{cases}
    t, & (x,t)\in R_1\\
    \frac{1}{2}(1 - x + t), & (x,t)\in R_2\\
    \frac{1}{2}(x + t + 1), & (x,t)\in R_3\\
    1, & (x,t)\in R_4\\
    0, & (x,t)\in R_5,R_6
    \end{cases}
    $$
    where
    \begin{alignat*}{3}
    R_1 & = & \{(x,t):-1 < x - t < 1\text{ and } -1 < x + t < 1\}\\
    R_2 & = & \{(x,t):-1 < x - t < 1\text{ and } x + t > 1\}\\
    R_3 & = & \{(x,t):x - t < -1\text{ and } -1 < x + t < 1\}\\
    R_4 & = & \{(x,t):x - t < -1\text{ and } x + t > 1\}\\
    R_5 & = & \{(x,t):x + t < -1\}\\
    R_5 & = & \{(x,t):x - t > 1\}
    \end{alignat*}
    How do I plot this in the Mathematica?
    I tried this but it doesn't work.
    Code (Text):

    u[x_, t_] =
      Piecewise[{{t, -1 < x - t < 1 And - 1 < x + t <
          1}, {1/2 (1 - x + t), -1 < x - t < 1 And x + t >
          1}, {1/2 (x + t + 1), x - t < -1 And - 1 < x + t < 1}, {1,
         x - t < -1 And x + t > 1}, {0, x + t < -1}, {0, x - t > 1}}];
    Manipulate[Plot[u[x, t], {x, -10, 10}], {t, 0, 1, .01}]
     
     
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted



Loading...
Similar Threads for Plotting wave equation Date
Steady State output for Wave Input Dec 11, 2017
Minimum-maximum problem with graph plotting Nov 3, 2017
Complex functions with a real variable (graphs) Feb 14, 2017
Plotting the linear system Mar 8, 2016
Plot relative intensity? Dec 14, 2015