Calculate a 5x5 Vandermonde system for a 5 point mesh

672 Views Asked by At

This is problem 1.2 in Randall J Leveque's textbook, "Finite Difference Methods for Ordinary and Partial Differential Equations".

I'm struggling with how to actually do the computation, I'm not so hot at moving from abstract to application, so any help is much appreciated.

I ran the matlab (also found at book website) code for part (b) of the problem, that gives you the coefficients themselves for a specified order, and mesh size. I chose (2, -2:2) for a second order giving me:

>> fdstencil(2, -2:2)

The derivative u^(2) of u at x0 is approximated by

      1/h^2 * [
                 -8.333333333333333e-02 * u(x0-2*h) + 
                  1.333333333333333e+00 * u(x0-1*h) + 
                 -2.500000000000000e+00 * u(x0) + 
                  1.333333333333333e+00 * u(x0+1*h) + 
                 -8.333333333333333e-02 * u(x0+2*h) ] 

Now part (a) of the problem is trying to get you to find these coefficients by hand, using a method that's not explained in the first chapter. I'm kind of lost, and am new at finite difference approximations.

Part (a) reads:

Use the method of undetermined coefficients to set up the 5 5 Vandermonde system that would determine a fourth-order accurate finite difference approximation to $u''(x)$ based on 5 equally spaced points:

$ u''(x) = c_{-2}u(x-2h)+c_{-1}u(x-h)+c_{0}u(x)+c_{1}u(x+h)+c_{2}u(x+2h)+O(h^4)$

I also found a nice writeup here at Wikibooks about finding the second derivitive but am failing to apply what I'm reading. Any help appreciated.