Date: 10.2.1999
Janne Viljas, 44468K
Session 2, small projects:
The method of characteristics
This page is still a bit unfinished. Unfortunately the subject is
quite analytical and very little numerics was considered in the
litterature that was available to me. Hence, very litlle numerical things
will be presented here also. In fact, I think I just about covered everything
essential in my presentation.
Analytic examples
1. A simple example
Let's use the ideas of the method of characteristics to solve the equation
exp(t) f_x(x,t) + f_t(x,t) = 0 for t > 0
I think I will use Maple to make it look cool.
2. Other simple examples
I'll show more examples on the blackboard or as viewgraphs.
At least one containing a nonhomogeneous equation (nonzero c in
the equation (2)), or one with a term linear in the solution function f
itself (nonzero d). In such cases f is no longer constant along the
characteristics, but still solves an ODE other than df/dp = 0. If I failed
to stress it before, I'll do it now: the whole point of the method of
characteristics is to reduce a PDE to an ODE along some curves, which are
then called the characteristics of the PDE. An important example would
also be one which shows that a point in the xt-plane cannot always be traced
back to the initial value curve, like some point on the x-axis. In
other words the relation x_0=p(x,y) does not exist for all (x,t). Hence,
the given initial data only defines the solution in part of the xt-plane!
Matlab stuff
Here I will try to present some solutions of problems in Chapter 2 of
Cooper's book, which require the use of Matlab.
Snapshots
These have to do with exercises 5, 6 and 7.
Exercise 5 a This
image
shows solution curves for u_t + x u_x = 0
at selected timesteps when the inital curve on the x-axis is gaussian.
The spreading of the characteristics is seen as a spreading of the solution!
Exercise 5 b This
image
was plotted to examine the speed of propagation of the top of the wave.
Plots were made at times t=0.5,0.5+dt and t=1.5,1.5+dt with dt=0.1.
Using the zoom feature of Matlab one can approximate the speeds directly from
the image.
Exercise 7 c This
image
shows solutions at some equally spaced timesteps for the equation
u_t + (1/x) u_x = 0 on x > 0 u(x,0) = f(x)
The characteristics are now parabolas and the solutions do not spread. (At least they shouldn't...)
But this is a case where the solution is only defined for (x,t) which are
to the right of the parabola going through the origin, x^2 > 2t. For points
that do not satisfy this, the corresponding parabola is completely above the
x-axis and consequently never gets a chance to pick up an initial value
from it.
Shocks in solutions
- Here are the mfiles for Chapter 2 of Cooper's book.
This image was plotted with the
mtc.m script, which
solves nonlinear equations of the form u_t + u u_x = 0, u(x,0) = f(x) using
the method of charcteristics. Profile 1 was chosen, with time steps
0,1,2,3 and 4. A shock (discontinuity) should
develop between t=2 and t=3 in order for the solution to define a function.
Here is another image, created with the shock.m script.
It does the same thing as mtc.m, but it develops the shock as it should.
Time steps 0,2,3,4 and 5 for profile 1 are shown. The shock is due to a
crossover of characteristics.
Maple PDEtools: PDEplot
Here's a link
to the HTML code exported from Maple. It's a simple example of the use of
PDEplot in the (P)DEtools package.
This is the same thing
as a Maple worksheet. This illustrates a similar situation as in the Matlab's
mtc.m-case, where a shock should develop when characteristics cross.
(By the way, I hate it when xmaple starts to give
segmentation faults! Another reason for xmaple to crash has been an
illegal instruction. This is NOT a very stable program, is it?)