# Higher-order finite difference -- Dirichlet boundary conditions

Suppose I want to use the 4-th order accurate central finite-difference scheme for a boundary value problem with the second derivative on regularly spaced nodes in $$[0, 1]$$, with (homogeneous) Dirichlet boundary conditions. Say I have 5 interior nodes, $$\mathbf{u}$$. My differential operator matrix becomes:

$$\mathbf{L} \mathbf{u} = \begin{bmatrix} c & b & a & & \\ b & c & b & a & \\ a & b & c & b & a \\ & a & b & c & b \\ & & a & b & c \\ \end{bmatrix} \mathbf{u},$$

which arises by setting
$$u(0) = u(1) = 0 \qquad (2)$$

and
$$u(0-dx) = u(1+dx) = 0. \qquad (3)$$

Note that the latter (ghost point) conditions are necessary because of the higher-order scheme. However, I'm not sure if this use of ghost points is quite appropriate because, in effect, I'm fixing $$u$$ over intervals, rather than at points. Indeed, if I compute the eigenvalue decomposition of this matrix, the eigenvectors differ slightly, but significantly, from their theoretical counterparts (which they do not if use the simpler 2nd order scheme).

Of course, I could instead reduce the accuracy of the finite-difference scheme near the boundaries, Or I could use a non-central scheme near the boundaries. However, both of those solutions would ruin the symmetry of $$\mathbf{L}$$, which I find undesirable (for example for efficient inversion).

So what is the best way to go about this? Is my use of ghost points really appropriate?

### Edit1:

I believe that instead of using (3) to specify the ghost points, I should impose the Dirichlet conditions on the average around the boundaries: \begin{align*} \frac{u(-dx) + u(+dx)}{2} = 0, \qquad (4) \\ \text{i.e.} \quad u_{-1} = - u_{1} \qquad (5) \end{align*} And in the case of even higher-order central differences, $$u_{-n} = - u_{n}$$, for $$n$$ between 1 and the number of ghost points. I've checked, and this produces an operator matrix that is symmetric, and whose eigenvectors equal the theoretical ones. So I guess my question becomes: does anybody have a name and theoretical reference for this approach?

• With pure Dirichlet, this does not seem right. One thing you might try is writing down Robin conditions with ghost points (with an equal order discretization of the derivative at the boundary to what you use in the bulk) and sending the conductivity to infinity, i.e. $u_x=Ku$ where $K \to \infty$.
– Ian
Commented Apr 8, 2021 at 12:23
• Thanks Ian. I don't quite understand, though, why should I change my boundary conditions? Commented Apr 8, 2021 at 12:40
• This is a way to get a ghost point implementation of the Dirichlet condition that is consistent with the weak formulation of the BVP.
– Ian
Commented Apr 8, 2021 at 12:41
• Let me come back later and clean up my explanation / give a demonstration of what happens.
– Ian
Commented Apr 8, 2021 at 13:03
• Thanks. I admit I'm still not seeing it, and looking around for references. Commented Apr 8, 2021 at 13:05