Skip to main content

more options


Problem

This problem was developed from a description found in Fox et al. (1988) Solving Problems on Concurrent Processors, vol. 1. Prentice Hall.

BasicPlot

Calculate the amplitude along a uniform, vibrating string after a specified amount of time has elapsed.

Numerical Solution

First, impose a framework on the problem.

BasicPlot2

The framework consists of amplitude A on the y axis and index i on the x axis, where i represents the position in the regular grid of points imposed along the length of the string. The amplitude is to be updated at discrete time steps.

The equation to be solved is the finite-difference approximation to the one-dimensional wave equation:

  A(i,t+1) = 2.0*A(i,t) - A(i,t-1)
     + c * (A(i-1,t) - 2.0*A(i,t) + A(i+1,t))

where c is a constant.

Note that the amplitude at (i, t+1) depends on two previous timesteps (t and t-1) as well as two neighboring points (i-1 and i+1). Thus, both initial and boundary data are required in order to loop to the new timestep (t+1).

This problem was developed from a description found in Fox et al. (1988) Solving Problems on Concurrent Processors, vol. 1. Prentice Hall.

BasicPlot

Calculate the amplitude along a uniform, vibrating string after a specified amount of time has elapsed.

Numerical Solution

First, impose a framework on the problem.

BasicPlot2

The framework consists of amplitude A on the y axis and index i on the x axis, where i represents the position in the regular grid of points imposed along the length of the string. The amplitude is to be updated at discrete time steps.

The equation to be solved is the finite-difference approximation to the one-dimensional wave equation:

  A(i,t+1) = 2.0*A(i,t) - A(i,t-1)
     + c * (A(i-1,t) - 2.0*A(i,t) + A(i+1,t))

where c is a constant.

Note that the amplitude at (i, t+1) depends on two previous timesteps (t and t-1) as well as two neighboring points (i-1 and i+1). Thus, both initial and boundary data are required in order to loop to the new timestep (t+1).