1.6. Evolution in Time 13 of two variables at each fixed time t is still a function of x. Its “initial profile” f(x, 0) = x2 is the function as it appears at time t = 0, and since we know the graph of this function well we know that it begins by looking like a nice parabola opening upwards from the vertex (0, 0). However, one unit of time later f(x, 1) = 1 2 (x 1)2 is a parabola which is shifted a bit to the right and wider. In fact, as time passes, the vertex continues moving to the right at a constant speed and the parabola widens even more. If you have trouble imagining this or “seeing” the movie in your mind as described above, perhaps you will find it helpful to use Math- ematica5 to make some movies which you can watch on your computer screen. 1.6.1 Animating Solutions with Mathematica A function of two variables can be thought of as a function of one variable that changes over time. (That is, at time t = 0 it is the function u[x,0] and then one unit of time later it has changed to u[x,1] and so on.) Thus, we may want to watch a movie showing how that function evolves in time by plotting it for several different values of the time parameter. It will be convenient for us to define a Mathematica command which takes a function and produces a movie with a specified number frames on a particular viewing window and a particular time range. The definition of the function MyAnimate below can either be copied directly out of the book or (at least at the time of publication) can be downloaded from the publisher’s website in a file containing many other definitions and examples from the text. You should feel free to modify it or replace it with an alternative definition to suit your own needs, but it will be convenient for you to call it MyAnimate as the book will refer to the command by that name. MyAnimate[f_,{x,x0_,x1_},{y,y0_,y1_},{t,t0_,t1_},n_]:= ListAnimate[Table[Plot[f, {x, x0, x1}, PlotStyle - AbsoluteThickness[2], PlotRange - {y0, y1}], {t, t0, t1, (t1 - t0)/n}]] 5 This textbook will be using Mathematica for generating graphs and anima- tions and to do tedious computations. Other mathematical computer packages are likely to be able to perform the same functions. For an introduction to using Mathematica, see Appendix A.
Previous Page Next Page