D2L | Wiley Plus Student Resources | UA Math

MATLAB GUI: Vibrating String




Description

This MATLAB GUI illustrates the use of Fourier series to simulate the dynamics of a vibrating string. The string is clamped at its end points and its deflection from the horizontal, u, evolves according to the wave equation, utt - uxx = 0.

  • The initial condition is decomposed into a Fourier series by finding its half-range sine expansion;
  • The corresponding coefficients are evolved in time. Fifty Fourier modes are included in the simulation. The evolution of the amplitudes of modes zero through ten is shown in a bar graph.
  • The resulting Fourier series, giving the shape of the string, is calculated and plotted at each time step.

The GUI also illustrates the fact that the simulated solution may be written as the sum of two traveling waves, one propagating to the left, and the other propagating to the right.


How to use the GUI

  • To start, place the cursor on the string, left-click and drag to define an initial deflection, then release the left mouse button. The initial velocity is automatically set to zero and the string starts vibrating.
  • Select the Left TW and/or Right TW check boxes to see the corresponding left- and/or right-going waves.
  • Select the Superposition check box to see the sum of the left- and right- traveling waves that describe the deflection of the string.
  • The Reset button reinitializes the GUI.


Download

Download (right click on each link below) the following files into a directory. Set the MATLAB path to that directory and type Vibrating_String at the MATLAB prompt. Type help Vibrating_String at the MATLAB prompt if you need to be reminded of how to use the GUI.


© GUI developed by Joceline Lega, Spring 2007.
© Joceline Lega, 2007