There are three main types of partial differential equations.
Lets look at examples of parabolic P.D. E. s.
A simple method to solve these will now be shown.
Example: diffusion with a uniform diffusion constant for 0 < x < 1, assuming Dirichelet Boundary conditions (specify phi on a large closed curve in the x,y plane) and specify the value of the field at the end-points of the interval, giving
Make two approximations:
at i=1 and N-1 the equation involves Dirichelet boundary conditions specifying the values of phi at 0 and N. This is an explicit difference scheme, given phi at one time can get at another time from
with the action of operator H defined by
In our example S=0 and phi is zero at x=0 and 1. Lets start with a gaussian centered at x=1/2.
The last two are image gaussians to ensure the boundary conditions at x=1 and x=0.
A program to do this is given is
chap7a.f which is in the week11.tar file. Run this for the following sets of values of time-steps
and total time values: (0.00075 0.015), (0.00075 0.045), (0.001 0.02),
(0.001 0.04), (0.001 0.06).
These program writes its output to a file fort.11 which can be graphed
using cplot.ex from lecture 2. (Download
here if you already lost the file or switched computers. To use PGPLOT,
The analytic solution to this is
At small timesteps the solution agrees with the analytic one. For which values is the solution stable? When does it start to become unstable? If the time step is very small the solution is complete on the scale of t near to 0.01. What happens for slightly larger timesteps? When do things start to go wrong and an unphysical stability develops. Details of the instability are given in the handout. See also the figure. The equation 7.4 of the handout is our equation 4 above, 7.5 is our equation 5.
Implicit schemes are one way around the instability. These are discussed in the handout. Results of the implicit scheme are shown in the last frame of the figure in the handout.
Another approach is the use of iterative methods, discussed in the handout.
We will finally explore the solution of the Time-Dependent Schroedinger Equation. The animated version of this routine can be downloaded as pspage.f here. this differs from the program distributed in previous years. The changes are moving the initiation of the window to a subroutine and adding the line call pgpap(6.0,1.0) before call pgenv(...).
This file also needs param.e7.
An easy way to make animated gifs in LINUX is to prepare a set of say
*0001.png files (where * is say pics) and then write
convert pics*.png pics.gif
good if the files are relatively light.