Finite differences and Neumann/Periodic BC of a fourth order PDE Before I start, I have already read this similar thread and didn't get anywhere unfortunately.
I have a PDE of the form
$$
\frac{\partial u}{\partial t} = \nabla^2[2u(u-1)(2u-1) - \gamma \nabla^2 u]
$$
where $u = u(x,y,t)$.
The fourth derivative in a central difference scheme is written as:
$$
\left(\frac{\partial^4 u}{\partial x^4}\right)_{ij} \approx \frac{1}{\Delta x^4} (u_{i+2, j} - 4 u_{i+1,j} + 6u_{i,j} -4u_{i-j,j} + u_{i-2, j})
$$
and similarly for the $y$ derivative. Thus, at the boundary point $i=N$, I will need ghost points $i=N+1$ and $i=N+2$. I know how to deal with $N+1$ via the Neumann boundary condition I am interested in
$$
\frac{\partial u}{\partial x} = 0 \implies u(x_i = u_{N-1}
$$
in the central difference scheme. But I don't know how to deal with the second ghost point.
For periodic BC, I assume for i = N, i+1 wraps around to 1 and i+2 wraps around to 2, and similarly for the other boundaries. But do the coefficients change or do they stay the same? How do I write this in matrix form?
 A: So the problem stems not from the discretization but begins at the orignial problem. For a forth order equation (in space) you need four distinct boundary conditions to expect a unique solution. Usually this would mean two on each side ("one" periodic boundary conditions counts as two!) and this transfers also to the discretization.
For the case of periodic boundary conditions this is a little bit hidden but what you are actually doing when using $u_{N+1}=u_1$ and $u_{N+1}=u_2$ you are discretizing the following boundary conditions $$\begin{cases}u(x_0)=u(x_N)\\u_x(x_0)=u_x(x_N)\end{cases}$$
So the questions regarding Neumann boundary conditions is: what is your second set of boundary conditions you want to discretize?
Coming back to the periodic case the discretization matrix (for one space dimenstion) usually looks like this
$$
\begin{array}{cccccccc}
 6 & -4 &  1 &  0  &  0 & 0 & \ldots&0&1&-4 \\
-4 &  6 & -4 &  1  &  0 & 0 & \ldots&0&0&1\\
 1 & -4 &  6 & -4  &  1 & 0 & \ldots&0&0&0\\
 0 &  1 & -4 &  6 & -4  & 1 & \ldots&0&0&0\\
 0 &  0 &  1 & -4 &  6 & -4 & \ldots&0&0&0\\
\vdots  &  \vdots   &    & \ddots  &  \ddots  &  \ddots  &\ddots&\\
 \vdots &  \vdots   &    &   &  \ddots  &  \ddots  &\ddots&\ddots\\
 0 & 0 &  0 &\ldots &0& 1 & -4 &  6 & -4  &  1 \\
1&0&0&\ldots&0&0&1&-4 &  6 & -4 \\
-4&1&0&\ldots&0&0&0& 1 & -4 &  6
\end{array}
$$
The two dimensional case is abit more tedious since the neighbouring points in $y$ direction are usually "further away" in your discretization. Let me know if you neeed help with that as well.
