Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum > General > > "plotting a wave equation"

Post Reply:
Name:
Email Address:

Please send email when my message is replied to.

Url (optional):
Subject:
Message: view original message?
Attachment (optional):
Please answer this:1+4 =



Original Message (ID '122644') By yehuda:
Replace the AND with && you may also omit the steps of 0.1 for t u[x_, t_] = Piecewise[{{t, -1 < x - t < 1 && -1 < x + t < 1}, {1/ 2 (1 - x + t), -1 < x - t < 1 && x + t > 1}, {1/2 (x + t + 1), x - t < -1 && -1 < x + t < 1}, {1, x - t < -1 && x + t > 1}, {0, x + t < -1}, {0, x - t > 1}}]; Manipulate[Plot[u[x, t], {x, -10, 10}, PlotRange -> All], {t, 0, 10}] you might also use Plot3D Plot3D[u[x, t], {x, -10, 10}, {t, 0, 10}, PlotPoints -> 50, AxesLabel -> {"X", "t", "U"}]