Efficient Shallow Ritz Method: 1D Semi-Linear Diffusion-Reaction and Allen-Cahn Equations
An efficient shallow Ritz method was developed in [8, 9] for one-dimensional linear diffusion and diffusion-reaction problems. In this paper, the method is extended to a nonlinear diffusion-reaction equation with a cubic reaction term: (1) a basic error estimate of the shallow Ritz discretization is established and (2) a reduced block Newton (rBN) method for solving the resulting non-convex optimization problem is developed. Again, the computational cost of the rBN method is $\mathcal{O}(n)$ for one-dimensional problems, where $n$ is the number of neurons. Combining a convex splitting scheme for time discretization with the efficient shallow Ritz method, we develop a time-stepping neural network method for solving the Allen-Cahn equation. The unconditional energy stability of the time discretization and an error estimate in the $L^2$ norm are established. Numerical experiments demonstrate that the neural network approach yields accurate solutions for singularly perturbed nonlinear diffusion-reaction equations and the Allen-Cahn equation. The method effectively resolves interior and boundary layers without oscillations and significantly outperforms the finite element method on fixed uniform meshes.