| Author |
Comment/Response |
yehuda
|
11/11/12 02:31am
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"}]
URL: benshimo@bgu.ac.il, |
|