<< Chapter < Page Chapter >> Page >

In an effort to improve accuracy, Heun's method was implemented instead of forward Euler. In Heun's method, the formula for the numerical approximation to the solution of [link] is

a n + 1 = a n + h 2 f ( a n , b n ) + f a n + h f ( a n , b n ) , b n + 1 .

where h = b n + 1 - b n [link] . Additionally, RK4, the fourth order Runge-Kutta method, was implemented through "ode45" in MATLAB.However, these methods did not produce results that were much better than the simpler method of forward Euler (and in some cases, took much more time), so we left forward Euler in our code and reported those results in this paper.

Spectral discretization

To numerically compute the eigenvalues for the various operators resulting from the various q and ρ functions discussed in this paper, there are several techniques. One technique to approximate a second derivative is to use a uniform grid, 0 = x 0 < x 1 < . . . < x n = 1 with x j + 1 - x j = h for j = 0 , 1 , . . . , n - 1 , and a finite difference which leads to

u ' ' ( x j ) u ( x j + 1 ) - 2 u ( x j ) + u ( x j - 1 ) h 2

for j = 1 , . . . , n - 1 which is O ( h 2 ) accurate. Another technique is spectral discretization. In this technique, instead of a uniform grid, Chebyshev points are used, which are given by

x j = 1 2 1 - cos j π n

for j = 0 , 1 , . . . , n . These points are clustered near the endpoints of the interval. These Chebyshev points are used to form a polynomial, p n ( x ) , which is an interpolant of u ( x ) so that u ( x j ) p n ' ' ( x j ) . The MATLAB program we used to create the matrix that approximates the differential operator and the Chebyshev grid for x is based on "cheb.m" in [link] .

The advantage of spectral discretization over the finite difference technique is that with the same number of points in the grid, spectral discretization produces results that are much more accurate. Or, it is possible to achieve the same accuracy as finite difference with fewer points using spectral discretization. In [link] , spectral discretization was used with N = 256 . Even though there are infinitely many eigenvalues, this technique's results only approximate the first N eigenvalues. Since for this problem, it is known exactly what the eigenvalues should be, the error was plotted in [link] , and about the first 100 eigenvalues are accurate to 10 - 7 or better. To compare, using finite difference with N = 256 and a uniform grid, h = 1 / 256 and O ( h 2 ) accuracy means h 2 1 . 5 × 10 - 5 . Spectral discretization produces more digits of accuracy than finite difference with the same number of grid points.

Summary

In this paper, we started by describing Liouville's transformation to change the mass density of the wave equation to the potential of the Sturm-Liouville equation [link] . However, our intention was to study a specific q from [link] , so it was necessary to reverse that transformation in order to arrive at the corresponding mass density, ρ . In this paper we described our numerical methods to perform this reverse transform, and results are described for the specific q from [link] including the computed ρ , eigenvalues, and eigenfunctions for certain values of μ 1 and chosen initial conditions. Since we know what the eigenvalues are supposed to be for this q , an analysis of the error in computing the eigenvalues is included. For comparison, similar calculations were done for other q or ρ in closed form.

Acknowledgments

We would like to acknowledge the patience and guidance of Dr. Mark Embree and Dr. Steven Cox of Rice University. Many thanks are owed to Jeffrey Hokanson and our predecessors in the Physics of Strings PFUG, whose work made ours possible. This paper and the research herein conducted were made possible by grant funding from the National Science Foundation through Rice University's VIGRE program.

Appendix

The codes used in this project are accessible through the featured link.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, The art of the pfug. OpenStax CNX. Jun 05, 2013 Download for free at http://cnx.org/content/col10523/1.34
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'The art of the pfug' conversation and receive update notifications?

Ask