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:4+4 =



Original Message (ID '123119') By Peter Pein:
Hi, the infix operator for the logical and is "&&" [1]: 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} (*, * default value is 0 * {0, x + t < -1}, * {0, x - t > 1} *) }]; Manipulate[ Plot[u[x, t], {x, -10, 10}, PlotRange -> {0, 1.05 t}(*looks better IMHO*)], {t, 0, 1, .01} ] Peter [1]: http://reference.wolfram.com/mathematica/ref/And.html