Class myphysicslab.sims.pde.StringSim

Provided By
All Implemented Interfaces

Simulation of a string under tension which can have waves in 2D. This is an unusual simulation from others in myPhysicsLab in that it uses a partial differential equation (PDE) model.


Based on Algorithm 12.4, 'Wave Equation Finite-Difference' from Numerical Analysis, 6th Ed. by Burden & Faires.

Three Data Arrays

The three data arrays, w1, w2, w3 represent the current, past, and next string state. Each entry in an array is the displacement of the string at that point.

The role of representing the current, past, or next state rotates among the three arrays, changing with step forward in time.

Suppose that w1 = past, w2 = current, and w3 = next. We can get space derivatives by looking at neighboring points within w2. We can get time derivatives by looking at the difference between a point in w1 and w2. The PDE for the string then gives us the change based on those derivatives, and we can figure out w3.

Stability Condition

The stability condition is:

sqrt(tension / density) delta_t / delta_x < 1

new StringSim( shape, opt_simList )


starting wave shape


SimList to use (optional)

Instance Methods

Static Properties

Type Definitions