PREVIOUS: Solving the Diffusion Equation | UP: Course Outline | NEXT: xxx |
When we do this we find that the speed falls a little short of the expected value, and the deficit increases as the grid spacing DX and/or the time step DT increase. We can interpret this in terms of the spatial and temporal resolution needed to resolve the oscillatory parts of the solution, but here we take an empirical approach and search for parameter choices that preserve this aspect of the solution "well enough."
Starting from the single-wavepacket code provided, do the following experiment. Start at X0 = -30 and take PBAR = 5 and TMAX = 10, so we expect the packet to move at speed 10 and reach x = 20 by the end of the simulation. You should find that it falls short by a significant margin. Experiment with changing DX (by adjusting the number of zones, J) and DT until peak probability in the end state is within 1 unit of the target, i.e. the location of the peak is at x > 19. Note that increasing J) and decreasing DT will slow the script signiifcantly, so try to find a compromise that achieves the goal with the least impact on performance.
Repeat the experiment for PBAR = 10, TMAX = 5, and PBAR = 20, TMAX = 2.5
We will use these parameter choices throughout the remaining experiments.