Tom Blaylock CPS615
Assignments 4 & 5
Solving the Wave Function in MPI
Solving the wave equation as described in Chapter 5 of Fox et al., 1988, Solving Problems on Concurrent Processors was conducted using C(Assignment4) and Java(Assignment5) and MPI.
The problem of a vibrating string which has fixed end points was considered. The time dependent motion of the string is represented by the partial differential equation:
1/c^2*(partial^2*psi)/(partial^2*t^2)-(partial^2*psi)/(partial*x^2)=0
We assumed that the string stretches over the interval from 0 to 1 in the x direction, and that the ends are anchored at amplitude 0. To solve this problem numerically, we choose uniform intervals delta x and delta t, of space and time. Then for each point i along the x direction, we can derive a scheme for computing the value of the amplitude at each time step. This assumes that we are computing the value at a new time step(t+delta t)(called t+1) where we already know the values at the current time step t and the previous time step(t-delta t)(called t-1):
psi(i)(t+1)=(2*psi(i)(t))-psi(i)(t-1)+tau^2[psi(i-1)(t)-(2*psi(i)(t))+psi(i+1)(t)]
where tau=c*(delta t/delta x)
The number of points N in the discretization of the x direction is chosen. Time units were chosen so that delta t =1. The constant c was also set to 1. Global left and right endpoints were fixed at psi=0.
Test programs are located in my subdirectory Projects_Assnmts on the VPL system along with test output(Assignment4.txt, Assignment5.txt).