Download ModelDownload SourceembedLaunch Website


Intro Page

The vibrating string

This model solves the one-dimensional wave equation using an explicit difference method. The wave equation is a second-order linear partial differential equation, obtained by considering the forces which apply to a small element of the string of length dx.


Simulation of a vibrating string

When the simulation is opened, a string fixed at both ends is seen. It has a symmetric initial deflection in the form of a Gaussian, whose width is such that its amplitude at the ends is near zero.

Play starts the calculation, stop freezes it, step calculates one step. The time between steps can be defined by a slider speed.

The model assumes that neigbored points at the string are connected elastically, as with tiny springs. The string length is divided into 1000 calculation points.

Contrary to naive expectation the string does not simply deflect perpendicular to its axis (as it would appear for a harmonic). Rather two identical pulses of half the initial amplitude propagate to both ends, are reflected and recombine in the middle to the initial pulse with opposite sign. After two reflections the original pulse is reconstructed.

The formula of the Gaussian contains a parameter a for the reciprocal 1/e width. When you choose a = 0.1 with the slider, you will observe two clearly separated short pulses traveling and reconstructing.

At very short pulse length ( a < 0.03 ) limited resolution will lead to calculation artifacts. Yet one can observe how distortions created in that way develops further.

In the Combobox the following functions are predefined:

  • Symmetric Gaussian of variable width
  • Non symmetric Gaussian of variable width
  • Symmetric triangle
  • Non symmetric triangle of variable width
  • Sawtooth with Gaussian decline
  • Short sawtooth with Gaussian decline
  • Sine with w half periods

You can edit the formulas or write your own ones.

For w as an integer sine waves oscillate as standing waves. They are base modes or eigenfunctions of the string. Yet this pattern is not created by simple deflection perpendicular to the string, but by interference of two traveling waves. This is not easy to perceive, so think about it in depth and compare the process to the Gaussian.

In music instruments the appeal of a specific sound is determined by its mixture of harmonics. A straight harmonic like that of the organ flute pipe sounds dull and uninteresting, less charming than the transverse pipe with higher harmonics and its additional breathing noise. In the harpsicord a crisp, chirping sound is generated by strongly localized, non symmetric picking of the string. This localized initial irritation then travels and interferes along the string.

A guitar player knows that soft plucking with the fingers near the middle of the string creates a dull tone, while localized plucking with a plectrum near the end leads to pungent, wild sounds. The different simulation examples will help you understand these effects and reveal how complex their explanation can be.


E1: Run the default Gaussian and understand the observation as the solution of the wave equation with two oppositely running waves. Consider that the string is reflecting at its ends.

E2: Choose a = 0.3; now pulses are clearly separated.

E3:  Choose the sine function and the base mode with w = 1.

Increase w in integers. The harmonics will appear as standing waves, deflecting perpendicular to the string axis.

E4:  Choose a non integer w. Now you will recognize the oppositely running waves. (The axis of the string may be askew). Approach an integer in small steps.

E5:  Try the other functions and consider what will be decisive for an interesting tone quality, with overtones and traveling excitation.

E6:  In reality a string will be damped by acoustic radiation and by friction. For the long term impression of tone quality it is important how different harmonics will be damped. Normally high harmonics will be damped much stronger than low ones. Thus a single tone may start with a brilliant, overtone rich spectrum and fade to a soft base harmonic.

E7: In the piano for each tone (in the middle and higher range) three strings are hit simultaneously, which are nearly but not exacly tuned to the same frequency. Each one oscillates in two transverse directions; all three are strongly coupled by the air and by the frame. At the same time all other strings will become softly excited at their suiting harmonics, depending on the degree of damping. Consider how complicated the real behavior wil become in time and space. For this reason it is practically impossible to simulate a grand piano by electronic synthesis (an interesting trial is the V-Piano). The common way to simulate it is to copy the sound of a real grand piano by sampling.



Code Language Translator Run

Software Requirements


Android iOS Windows MacOS
with best with Chrome Chrome Chrome Chrome
support full-screen? Yes. Chrome/Opera No. Firefox/ Samsung Internet Not yet Yes Yes
cannot work on some mobile browser that don't understand JavaScript such as.....
cannot work on Internet Explorer 9 and below



Francisco Esquembre - Universidad de Murcia, Spain; Fremont Teng; Loo Kang Wee

end faq

{accordionfaq faqid=accordion3 faqclass="lightnessfaq defaulticon headerbackground headerborder contentbackground contentborder round5"}

Sample Learning Goals


For Teachers



Initial Function of the String

Selecting Initial Function in the combo box allows you to
toggle the initial functions selected 
(Symmetric Gaussian)

(Non-symmetric Gaussian)

(Symmetric Triangle)

(Non-symmetric Triangle)

(Sawtooth with Gaussian Decline)

(Short Sawtooth)

(Sine with w half periods)
Do note that we can edit the function field box directly to customize
our own initial function as well!
(Custom: sin(w*pi/1*x) )

(Custom: sin(2*w*pi/1*x) )
(Custom: tan(w*pi/1*x) )

Others: Variable Sliders and Field Box

Adjusting these controls affect their respective functions.
The Speed Slider will manipulative how fast the simulation will move.
While the Parameter slider and Sine Param Field Box will affect the individual functions.

Toggling Full Screen

Double clicking anywhere on the panel will toggle full screen.
(Note that this won't work if the simulation is running.)

 Play/Pause, Step and Reset Buttons

Plays/Pauses, steps and resets the simulation respectively.






Other Resources


end faq

{accordionfaq faqid=accordion4 faqclass="lightnessfaq defaulticon headerbackground headerborder contentbackground contentborder round5"}

1 1 1 1 1 1 1 1 1 1 Rating 0.00 (0 Votes)