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

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
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,

Subject (listing for 'plotting a wave equation')
Author Date Posted
plotting a wave equation dustin 11/10/12 12:27pm
Re: plotting a wave equation yehuda 11/11/12 02:31am
Re: plotting a wave equation Peter Pein 11/11/12 10:10am
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic