betaFeedback

WorksMathematics

Efficient Shallow Ritz Method: 1D Semi-Linear Diffusion-Reaction and Allen-Cahn Equations

Abstract

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 O(n)\mathcal{O}(n) for one-dimensional problems, where nn 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 L2L^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.

Introduction

Neural networks (NNs) have achieved remarkable success in artificial intelligence, natural language processing, and image recognition, and their applications have increasingly extended to scientific computing. In particular, NN-based methods have emerged as promising alternatives for the numerical solution of partial differential equations (PDEs) [4, 6, 15, 16, 31, 35], with early developments dating back to the 1990s [14, 23, 24]. One of the main advantages of NN approximations is their ability to adapt to the underlying solution structure through the optimization of network parameters. This feature is particularly attractive for problems exhibiting sharp transitions, boundary layers, or interior layers, where conventional numerical methods on uniform meshes may require a large number of degrees of freedom to achieve satisfactory accuracy.

In one dimension, shallow neural networks with rectified linear unit (ReLU) activation functions admit representations equivalent to free-knot splines (FKS). Unlike conventional splines with prescribed knots, FKS allow the knot locations to be optimized along with the coefficients, potentially achieving substantially improved approximation accuracy with relatively few degrees of freedom (see [5] and the discussion in [8]). From this perspective, the optimization of the hidden-layer parameters of a shallow ReLU network corresponds to the adaptive placement of spline knots, while the output-layer parameters determine the coefficients of the spline representation. However, this flexibility comes at the cost of a challenging non-convex optimization problem. Furthermore, the global support of ReLU basis functions generally leads to dense and ill-conditioned algebraic systems [7]. Consequently, the development of efficient and robust optimization algorithms is essential for realizing the full potential of shallow NN approximations in the numerical solution of PDEs.

Recently, an efficient shallow Ritz method was developed in [8, 9] for one-dimensional linear diffusion and diffusion-reaction problems. A key ingredient of this approach is a block Newton (BN) method that exploits the distinct roles of the linear and nonlinear network parameters. Following a classical outer-inner iterative strategy, the method alternates between optimizing the output-layer coefficients and updating the hidden-layer parameters, or equivalently, the free-knot locations. Such a separation of linear and nonlinear parameters is natural and has been explored in various contexts [1, 2, 11, 20, 29, 30, 32]. Nevertheless, two major computational difficulties remain: the optimization of the linear parameters involves dense, ill-conditioned algebraic systems, while the optimization of the nonlinear parameters requires solving nonlinear equations whose Hessian matrices may be singular. By exploiting the special structure of the shallow ReLU representation, the methods developed in [8, 9] effectively address these difficulties and reduce the computational cost to O(n)O(n) in one dimension, where nn denotes the number of neurons. In addition, a local convergence analysis of the BN method was recently established in [10], providing convergence conditions that can be incorporated into practical implementations.

The objective of this paper is to extend the efficient shallow Ritz method from linear elliptic problems to semi-linear diffusion-reaction equations with cubic nonlinearities and, subsequently, to develop an efficient NN-based time-stepping method for the Allen–Cahn equation. The extension to semi-linear problems introduces several new analytical and computational challenges. First, although the Ritz functional remains convex with respect to the output-layer coefficients for fixed hidden-layer parameters, the corresponding first-order optimality conditions now form a system of nonlinear equations rather than a linear system. Second, the Hessian matrices associated with the optimization of both the linear and nonlinear parameters depend on both sets of parameters, making their efficient evaluation and inversion more involved. Nevertheless, by extending the structural identities and fast inversion techniques developed in [8, 9], we construct a reduced block Newton (rBN) method that retains the O(n)O(n) computational complexity for one-dimensional problems. We also establish a basic error estimate for the shallow Ritz discretization of the semi-linear diffusion-reaction equation.

An important application of the proposed method is the Allen–Cahn equation, originally introduced in [3] to describe the motion of antiphase boundaries in crystalline solids. The Allen–Cahn equation has since become a fundamental phase-field model with applications in materials science, interface dynamics, and fluid mechanics (see, e.g., [12, 19, 25, 26, 36]). In the singularly perturbed regime, its solutions typically exhibit narrow transition layers separating regions corresponding to different stable phases. Accurately resolving these layers is challenging for conventional numerical methods, particularly on fixed uniform meshes, where insufficient spatial resolution may lead to significant errors and spurious oscillations. The adaptive nature of shallow ReLU networks makes them especially suitable for such problems, since the free-knot locations can be concentrated near sharp transitions without requiring a large number of neurons. Indeed, the numerical results in [9] have already demonstrated the effectiveness of the shallow Ritz method for singularly perturbed linear elliptic problems. These observations provide a strong motivation for extending the method to the time-dependent, nonlinear Allen–Cahn equation.

For the temporal discretization of the Allen–Cahn equation, convex splitting schemes have been widely studied because of their favorable stability properties [17, 21, 18, 34]. In particular, the first-order convex splitting scheme introduced in [17] is unconditionally energy stable, preserving a discrete analogue of the energy dissipation property of the continuous problem without imposing a restriction on the time-step size. At each time step, the scheme requires the solution of a semi-linear elliptic problem with a cubic reaction term. This structure provides a natural connection between the convex splitting time discretization and the proposed shallow Ritz method. By combining the two approaches, we develop an efficient time-stepping NN method for the Allen–Cahn equation, in which the semi-linear elliptic problem at each time level is solved using the rBN algorithm. We establish the unconditional energy stability of the convex splitting time discretization and derive an error estimate in the L2L^2 norm.

The main contributions of this paper are summarized as follows:

  1. Shallow Ritz discretization and error analysis for semi-linear problems. We extend the shallow Ritz formulation to one-dimensional semi-linear diffusion-reaction equations with cubic reaction terms and establish a basic error estimate for the resulting NN approximation.

  1. Efficient reduced block Newton method. We develop an rBN algorithm for solving the non-convex optimization problem arising from the shallow Ritz discretization. By exploiting the special algebraic structure of shallow ReLU networks, the method achieves O(n)O(n) compu-

tational complexity in one dimension, despite the additional nonlinearities in the first-order optimality conditions and Hessian matrices.

  1. Energy-stable NN time-stepping method for the Allen–Cahn equation. We combine the efficient shallow Ritz method with a first-order convex splitting scheme to obtain a time-stepping NN method for the Allen–Cahn equation. Unconditional energy stability of the time discretization and an L2L^2-norm error estimate are established.

  1. Accurate resolution of sharp transition layers. Numerical experiments demonstrate that the proposed method accurately resolves interior and boundary layers in singularly perturbed semi-linear diffusion-reaction problems and the Allen–Cahn equation. Compared with the finite element method on fixed uniform meshes, the shallow Ritz method achieves substantially higher accuracy with relatively few degrees of freedom and avoids spurious oscillations near sharp transitions.

The remainder of this paper is organized as follows. In § 2, we introduce the shallow Ritz discretization for semi-linear diffusion-reaction problems and establish its basic error estimate. In § 3, we derive the algebraic systems associated with the first-order optimality conditions. In § 4, we develop the reduced block Newton method and discuss its implementation and local convergence conditions. In § 5, we present the convex splitting time discretization for the Allen–Cahn equation, establish its energy stability and error estimate, and describe the resulting NN time-stepping method. Numerical experiments illustrating the accuracy, efficiency, and robustness of the proposed approach are reported in § 6.

Shallow Ritz Method for Semi-Linear Diffusion-Reaction Problems

Consider the following semi-linear diffusion-reaction equation in one dimension:

{−(a(x)u′(x))′+r1(x)u(x)3+r2(x)u(x)=f(x),x∈I,u(0)=α,(au′)(1)=β,(1)\begin{cases} -(a(x)u'(x))' + r_1(x)u(x)^3 + r_2(x)u(x) = f(x), & x \in I,\\ u(0) = \alpha, \qquad(au')(1) = \beta, \tag*{(1)} \end{cases}

where the diffusion coefficient a(x)a(x), the reaction coefficients r1(x)r_1(x), r2(x)r_2(x), and the right-hand side function f(x)f(x) are given real-valued functions defined on II. Assume that a(x)a(x), r1(x)r_1(x), r2(x)r_2(x) are in L∞(I)L^\infty(I) and bounded below by constants μ0>0\mu_0 > 0, μ1≥0\mu_1 \ge0, and μ2≥0\mu_2 \ge0, respectively, almost everywhere on II. Unless otherwise stated, for simplicity of notation we take I=(0,1)I = (0,1); the method and analysis extend directly to any open bounded interval. Here, we consider an inhomogeneous Neumann boundary condition at x=1x = 1; for the Dirichlet case, we refer the reader to [8, 9].

The Ritz formulation of problem (1) is to find u∈H1(I)∩{u(0)=α}u \in H^1(I) \cap\{u(0) = \alpha\} such that

J(u)=min⁡v∈H1(I)∩{v(0)=α}J(v),(2)J(u) = \min_{v \in H^1(I)\cap\{v(0)=\alpha\}} J(v), \tag*{(2)}

with the energy functional

J(v)=12∫01(a(x)v′(x)2+12r1(x)v(x)4+r2(x)v(x)2) dx−f(v),J(v) = \frac{1}{2}\int_0^1\left(a(x)v'(x)^2+\frac{1}{2}r_1(x)v(x)^4+r_2(x)v(x)^2\right)\,\mathrm{d}x-f(v),

where v′(x)2=(v′(x))2v'(x)^2=(v'(x))^2 and the linear functional is given by

f(v)=∫01f(x) v(x) dx+β v(1).f(v)=\int_0^1 f(x)\,v(x)\,\mathrm{d}x+\beta\,v(1).

The set of approximating functions generated by the shallow ReLU neural network with nn interior breakpoints over the domain II is denoted by

Mn(I)={c−1+c0x+∑i=1nciσ(x−bi):ci∈R, 0=b0<b1<⋯<bn<bn+1=1},\mathcal{M}_n(I)=\left\{c_{-1}+c_0x+\sum_{i=1}^{n}c_i\sigma(x-b_i):c_i\in\mathbb{R},\ 0=b_0<b_1<\cdots<b_n<b_{n+1}=1\right\},

where σ(t)=max⁡{0,t}\sigma(t) = \max\{0,t\} is the ReLU activation function. Let

Mnα(I)=Mn(I)∩{un(0)=α}.\mathcal{M}_{n}^{\alpha}(I)=\mathcal{M}_{n}(I)\cap\{u_{n}(0)=\alpha\}.

Then, the Ritz neural network approximation is to find un∈Mnα(I)u_n\in\mathcal{M}_{n}^{\alpha}(I) such that

J(un)=min⁡v∈Mnα(I)J(v).(3)J(u_n)=\min_{v\in\mathcal{M}_{n}^{\alpha}(I)}J(v). \tag*{(3)}

Next, we establish an error bound similar to Céa’s lemma for the solution unu_n of (3) in the weighted H1(I)H^1(I) norm defined by

∥v∥a,r22=∫01(a(x)v′(x)2+r2(x)v(x)2) dx.\lVert v\rVert_{a,r_2}^{2}=\int_{0}^{1}\left(a(x)v'(x)^2+r_2(x)v(x)^2\right)\,dx.

This bound is for a nonlinear approximation defined over a subset but not a subspace of H1(I)H^1(I).

Lemma 2.1. Let uu and unu_n be the solutions of problems (2) and (3), respectively. Then

∥u−un∥a,r2≤inf⁡v∈Mnα(I)E(u−v;a,r1,r2),(4)\lVert u-u_n\rVert_{a,r_2}\leq\inf_{v\in\mathcal{M}_{n}^{\alpha}(I)}E(u-v;a,r_1,r_2), \tag*{(4)}

where the square of E(u−v;a,r1,r2)E(u-v;a,r_1,r_2) is given by

E2(u−v;a,r1,r2)=∥u−v∥a,r22+∥r11/4(u−v)∥L4(I)4+5∥r11/4u∥L4(I)2∥r11/4(u−v)∥L4(I)2.E^2(u-v;a,r_1,r_2)=\lVert u-v\rVert_{a,r_2}^{2}+\lVert r_1^{1/4}(u-v)\rVert_{L^4(I)}^{4}+5\lVert r_1^{1/4}u\rVert_{L^4(I)}^{2}\lVert r_1^{1/4}(u-v)\rVert_{L^4(I)}^{2}.

Proof. First, we show that for any v∈Mnα(I)v\in\mathcal{M}_{n}^{\alpha}(I), we have

∥u−v∥a,r22≤2(J(v)−J(u)),(5)\lVert u-v\rVert_{a,r_2}^{2}\leq2(J(v)-J(u)), \tag*{(5)}

as in the linear case (see the proof of Theorem 3.2 in [27]). To this end, multiplying (1) by w∈{u,v}w\in\{u,v\} and using integration by parts, we have

f(w)=∫01(au′w′+r1u3w+r2uw) dx+αa(0)u′(0),f(w)=\int_{0}^{1}\left(au'w'+r_1u^3w+r_2uw\right)\,dx+\alpha a(0)u'(0),

which implies

f(v)−f(u)=∫01(au′(v′−u′)+r1u3(v−u)+r2u(v−u)) dx.f(v)-f(u)=\int_{0}^{1}\left(a u'(v'-u')+r_1u^3(v-u)+r_2u(v-u)\right)\,dx.

A straightforward calculation gives

2(J(v)−J(u))=∥u−v∥a,r22+12∫01r1(v4+4u3(u−v)−u4) dx,(6)2(J(v)-J(u))=\lVert u-v\rVert_{a,r_2}^{2}+\frac{1}{2}\int_{0}^{1}r_1\left(v^4+4u^3(u-v)-u^4\right)\,dx, \tag*{(6)}

which, together with the identity

v4+4u3(u−v)−u4=(u−v)2[(u+v)2+2u2]≥0,(7)v^4+4u^3(u-v)-u^4=(u-v)^2\left[(u+v)^2+2u^2\right]\geq0, \tag*{(7)}

implies the validity of (5). To bound J(v)−J(u)J(v)-J(u), first we have

(u+v)2+2u2≤2(u−v)2+10u2,(u+v)^2+2u^2\leq2(u-v)^2+10u^2,

which, together with (7) and the Cauchy–Schwarz inequality, implies

∫01r1(v4+4u3(u−v)−u4) dx≤2∥r11/4(u−v)∥L4(I)4+10∥r11/4u∥L4(I)2∥r11/4(u−v)∥L4(I)2.\int_{0}^{1}r_1\left(v^4+4u^3(u-v)-u^4\right)\,dx\leq2\lVert r_1^{1/4}(u-v)\rVert_{L^4(I)}^{4}+10\lVert r_1^{1/4}u\rVert_{L^4(I)}^{2}\lVert r_1^{1/4}(u-v)\rVert_{L^4(I)}^{2}.

Now, (4) follows from (5) with v=unv=u_n, the fact that J(un)≤J(v)J(u_n)\leq J(v) for all v∈Mnα(I)v\in\mathcal{M}_{n}^{\alpha}(I), (6), and the above inequality. This completes the proof of the lemma.

References

  1. [1]M. Ainsworth and Y. Shin. Plateau phenomenon in gradient descent training of ReLU networks: Explanation, quantification and avoidance. SIAM Journal on Scientific Computing, 43:A3438–A3468, 2020.arxiv.org/abs/2007.07213
  2. [2]M. Ainsworth and Y. Shin. Active neuron least squares: A training method for multivariate rectified neural networks. SIAM Journal on Scientific Computing, 44(4):A2253–A2275, 2022.DOI
  3. [3]S. M. Allen and J. W. Cahn. A microscopic theory for antiphase boundary motion and its application to antiphase domain coarsening. Acta Metallurgica, 27(6):1085–1095, 1979.DOI
  4. [4]J. Berg and K. Nyström. A unified deep artificial neural network approach to partial differential equations in complex geometries. Neurocomputing, 317:28–41, 2018.DOI
  5. [5]H. G. Burchard. Splines (with optimal knots) are better. Applicable Analysis, 3:309–319, 1974.DOI
  6. [6]Z. Cai, J. Chen, M. Liu, and X. Liu. Deep least-squares methods: An unsupervised learning-based numerical method for solving elliptic PDEs. Journal of Computational Physics, 420:109707, 2020.DOI
  7. [7]Z. Cai, T. Ding, M. Liu, X. Liu, and J. Xia. A structure-guided gauss-newton method for shallow ReLU neural networks. arXiv:2404.05064v1 [cs.LG], 2024.arxiv.org/abs/2404.05064
  8. [8]Z. Cai, A. Doktorova, R. D. Falgout, and C. Herrera. Efficient shallow Ritz method for 1D diffusion problems. Comput. Math. Appl., 200:349–363, 2025.DOI
  9. [9]Z. Cai, A. Doktorova, R. D. Falgout, and C. Herrera. Efficient shallow Ritz method for 1D diffusion-reaction problems. SIAM J. Sci. Comput., page S414–S435, 2025.
  10. [10]Z. Cai, A. Doktorova, R. D. Falgout, and C. Herrera. Convergence analysis of block newton methods for 1D shallow neural network approximation. J. Intel. Alg. Sci. Comput., 1(1):1–23, 2026.
  11. [11]E. C. Cyr, M. A. Gulian, R. G. Patel, M. Perego, and N. A. Trask. Robust training and initialization of deep neural networks: An adaptive basis viewpoint. Proceedings of Machine Learning Research, 107:512–536, 2020.
  12. [12]J. Deteix, G. L. N. Kouamo, and D. Yakoubi. A new energy stable fractional time stepping scheme for the Navier–Stokes/Allen–Cahn diffuse interface model. Computer Methods in Applied Mechanics and Engineering, 393:114759, 2022.DOI
  13. [13]Ronald A. DeVore. Nonlinear approximation. Acta Numerica, 7:51–150, 1998.DOI
  14. [14]M. W. M. G. Dissanayake and N. Phan-Thien. Neural network based approximations for solving partial differential equations. Communications in Numerical Methods in Engineering, 10(3):195–201, 1994.DOI
  15. [15]T. Dockhorn. A discussion on solving partial differential equations using neural networks. arXiv:1904.07200 [cs.LG], 2019.arxiv.org/abs/1904.07200
  16. [16]W. E and B. Yu. The deep Ritz method: A deep learning-based numerical algorithm for solving variational problems. Communications in Mathematics and Statistics, 6(1):1–12, March 2018.arxiv.org/abs/1710.00211
  17. [17]C. M. Elliott and A. M. Stuart. The global dynamics of discrete semilinear parabolic equations. SIAM Journal on Numerical Analysis, 30(6):1622–1663, 1993.DOI
  18. [18]X. Feng, T. Tang, and J. Yang. Long time numerical simulations for phase-field problems using p-adaptive spectral deferred correction methods. SIAM Journal on Scientific Computing, 37(1):A271–A294, 2015.DOI
  19. [19]S. Geng, T. Li, Q. Ye, and X. Yang. A new conservative Allen-Cahn type Ohta-Kawasaki phase-field model for diblock copolymers and its numerical approximations. Adv. Appl. Math. Mech., 14(1):101–124, 2022.
  20. [20]G. H. Golub and V. Pereyra. The differentiation of pseudo-inverses and nonlinear least squares problems whose variables separate. SIAM Journal on Numerical Analysis, 10(2):413–432, 1973.DOI
  21. [21]Z. Guan, J. S. Lowengrub, C. Wang, and S. M. Wise. Second order convex splitting schemes for periodic nonlocal Cahn–Hilliard and Allen–Cahn equations. Journal of Computational Physics, 277:48–71, 2014.DOI
  22. [22]Zhen Guan, John Lowengrub, and Cheng Wang. Convergence analysis for second-order accurate schemes for the periodic nonlocal allen-cahn and cahn-hilliard equations. Mathematical Methods in the Applied Sciences, 40(15):5379–5403, 2017.DOI
  23. [23]I. E. Lagaris, A. C. Likas, and D. G. Papageorgiou. Neural-network methods for boundary value problems with irregular boundaries. IEEE Trans. on Neural Networks, 11(5):1041–1049, 2000.DOI
  24. [24]I.E. Lagaris, A. Likas, and D.I. Fotiadis. Artificial neural networks for solving ordinary and partial differential equations. IEEE Transactions on Neural Networks, 9(5):987–1000, 1998.DOI
  25. [25]Y. Li, K. Qin, Q. Xia, and J. Kim. A second-order unconditionally stable method for the anisotropic dendritic crystal growth model with an orientation-field. Applied Numerical Mathematics, 184:512–526, 2023.DOI
  26. [26]Y. Li, L. Zhang, Q. Xia, Q. Yu, and J. Kim. An unconditionally energy-stable second-order time-accurate numerical scheme for the coupled cahn–hilliard system in copolymer/homopolymer mixtures. Computational Materials Science, 200:110809, 2021.DOI
  27. [27]M. Liu and Z. Cai. Adaptive two-layer relu neural network: II. Ritz approximation to elliptic PDEs. Comput. Math. Appl., 113:103–116, 2022.arxiv.org/abs/2107.06459
  28. [28]M. Liu and Z. Cai. Adaptive two-layer ReLU neural network: II. Ritz approximation to elliptic pdes. Computers & Mathematics with Applications, 113:103–116, 2022.arxiv.org/abs/2107.06459
  29. [29]X. Liu and Y. Yuan. On the separable nonlinear least squares problems. Journal of Computational Mathematics, 26(3):390–403, 2008.
  30. [30]J. Park, J. Xu, and X. Xu. A neuron-wise subspace correction method for the finite neuron method. arXiv:2211.12031 [math.NA], 2022.DOI
  31. [31]M. Raissi, P. Perdikaris, and G.E. Karniadakis. Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations. Journal of Computational Physics, 378:686–707, 2019.DOI
  32. [32]A. Ruhe and P. A. Wedin. Algorithms for separable nonlinear least squares problems. SIAM Review, 22(3):318–337, 1980.DOI
  33. [33]L. Schumaker. Spline functions: Basic theory. Wiley, New York, 1981.
  34. [34]J. Shen and X. Yang. Numerical approximations of Allen-Cahn and Cahn-Hilliard equations. Discrete Contin. Dyn. Syst, 28(4):1669–1691, 2010.DOI
  35. [35]J. Sirignano and K. Spiliopoulos. DGM: A deep learning algorithm for solving partial differential equations. Journal of Computational Physics, 375:1339–1364, 2018.DOI
  36. [36]J. Yang, D. Jeong, and J. Kim. A fast and practical adaptive finite difference method for the conservative Allen–Cahn model in two-phase flow system. International Journal of Multiphase Flow, 137:103561, 2021.DOI

Paper details

vlnc:W_y9dykqy2
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 4

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Mathematics

ChatGPT

View statement
Looking for related papers…
Contents