Partial Differential Equations
The vibrating string: d'Alembert's formula.
Anton Dzhamay
Department of Mathematics
The University of Michigan
Ann Arbor, MI 48109
wPage: http://www.math.lsa.umich.edu/~adzham
email: adzham@umich.edu
Copyright 2004 by Anton Dzhamay
All rights reserved
Packages
Some packages that we use in this worksheet:
Warning, the names arrow and changecoords have been redefined
Introduction
The goal of this worksheet is to illustrate the use of the method of characteristics and d'Alembert's formula for the one-dimentional wave equation (i.e., the vibrating string). The equation is . Since the equation is second order in , we need to specify the initial position and the initial velocity . If we consider this equation on the whole real line, then we do not need to worry about boundary conditions and the solution is given by the d'Alembert's formula:
For semi-infinite and finite intervals with homogeneous Dirichlet or Neumann boundary conditions the strategy is to extend the initial data to the whole real line in such a way that the boundary conditions are satisfied. It turns out that one has to take the odd extension about the boundary point for the Dirichlet boundary condition and the even extension for the Neumann boundary condition. In the examples below we illustrate this technique.
Initialization
First we initialize some of the variables. Below is the time interval we are interested in, is the number of characteristic curves that we want to plot per unit interval, and is the number of steps in the variable.
The shift command below allows us to combine the graph of the characteristics (which is two-dimensional) with the graph of the solution (three-dimensional).
In order to satisfy different boundary conditions we need to take even and odd extensions of functions about for half-line or about and for a finite interval.
We define the oddext0 ( evenext0 ) procedures that takes a function or an expression expr in a variable var and returns a functional operator in var that is the odd (even) extension of expr about the origin.
The procedures for even, odd, and periodc extensions of fucntions over the finite interval are defined similarly.
Example 1: "Pick"
In this example we take and take to look like a "guitar pick" (note that this function has discontinuous derivatives, and so the corresponding solution is the weak solution):
Now we can see how the initial profile changes in time:
The plot below helps to see how the initial profile splits into the left and right moving waves.
And this is how the graph of the solution looks like (from the top). We color it according to the height of the solution, and this makes it easy to see the left and right waves. The characteristics are plotted below, rotate the graph to see them.
Example 2: "Hammer Blow"
In this example we take and take to represent kicking the string by a hammer:
Now we can see how the initial profile changes in time (this calculation may take a while):
View from the top and the characteristics:
Note that there are different (color) zones, in each of these zones the solution is given by a different analytic formula.The following "close-up" picture helps to see the zones more clearly
Example 3: Left Wall (Dirichlet BC)
In order to satisfy the Dirichlet BC at we need to extend our functions from the right half-line to the whole line by taking the odd extension about 0.
It looks like the left-moving wave hits the wall and gets flipped and reflected. Note that for all . Peeking "behind" the wall we see the "image" right-moving wave emerging from the wall simultaneously with the left-moving wave disappearing into the wall:
And this is how the graph of the solution looks like (from the top).
Example 4: Left Wall (Neumann BC)
In order to satisfy the Neumann BC at we need to extend our functions from the right half-line to the whole line by taking the even extension about .
Again, let's "peek" behind the wall:
Example 5: Two Walls (Mixed)
In order to satisfy the Neumann BC at we take an even extension about and then to satisfy the Dirichlet BC at we take an odd extension about the origin. This gives us the correct extension on the interval , and then we extend it periodically to the whole real line. (In the example below .) This is a very non-optimal way to define such an extension, but it is enough for our purposes.
"Peeking behind the walls" shows us the left and right moving waves:
Looking at the graph of the solution (from the top) we can see the characteristics "bounching off the walls":
Example 6: Two Walls (Dirichlet)
This time we need to take the odd extension of about both and .
And here are the left and right-waves (set animation to cycle for a better movie):
References
Disclaimer
"While every effort has been made to validate the solutions in this worksheet, Waterloo Maple Inc. and the contributors are not responsible for any errors contained and are not liable for any damages resulting from the use of this material."