Crank-Nicolson Finite Difference Scheme for the 3D Allen-Cahn Equation with PINN Comparison

Abstract

In this paper, we derive a second-order Crank-Nicolson finite-difference scheme for the three-dimensional Allen-Cahn equation and present an estimate of the scheme’s truncation error. We prove the existence of the numerical solution and establish stepwise uniqueness, from which the global uniqueness follows given the initial value u 0. We also establish conditional convergence in the L -norm, and demonstrate a discrete maximum principle for the scheme. Numerical Examples 1 and 2 validate the discrete maximum principle, while Numerical Example 3 employs a physics-informed neural network (PINN), using the Crank-Nicolson solution as the reference, to compute the errors between the two approaches in the L2 and L norms. Owing to the high dimensionality of the problem, visualization is performed via isosurface plots on identical time slices; these plots show strong agreement between the Crank-Nicolson and PINN solutions. The numerical results collectively confirm the accuracy and effectiveness of the proposed scheme.

Share and Cite:

Liu, B. and Wang, L. (2025) Crank-Nicolson Finite Difference Scheme for the 3D Allen-Cahn Equation with PINN Comparison. Applied Mathematics, 16, 724-739. doi: 10.4236/am.2025.1610038.

Keywords:

1. Introduction

The Allen-Cahn equation is an important phase-field model, proposed by Allen and Cahn in 1979 [1], for describing phase separation and phase transition processes in alloy materials. This equation has wide applications in fields such as materials science, biology, and image processing, particularly playing a key role in simulating interface evolution. In this paper, we investigate the numerical approximation of the three-dimensional Allen-Cahn equation using a Crank-Nicolson scheme.

u t = ϵ 2 ( u x x + u y y + u z z ) f ( u ) , ( x , y , z ) Ω , t [ 0 , T ] , (1)

u ( x , y , z , 0 ) = u 0 ( x , y , z ) , ( x , y , z ) Ω . (2)

u ( x , y , z , t ) = α ( x , y , z , t ) = 0 , ( x , y , z ) Ω , t [ 0 , T ] . (3)

where, Ω = [ a , b ] 3 is a cubic region in R 3 , Ω is the boundary of Ω , the perturbation factor ϵ > 0 represents the width of the interface, and the non-linear term f ( u ) = u 3 u represents the polynomial double-well potential.

Extensive research has been conducted on finite difference schemes for the Allen-Cahn equation [2]-[6]. Evans et al. [7] demonstrated that the exact solution of the Allen-Cahn equation satisfies the maximum principle and energy stability. Tang et al. [8] proposed a first-order linear explicit-implicit scheme and proved

that it adheres to the discrete maximum principle when 0 < τ 1 2 , while also

analyzing its discrete energy stability. Li et al. [9] proposed a stabilized second-order CN/AB finite difference scheme for the Riesz space-fractional Allen-Cahn equation with logarithmic free energy. Under suitable constraints on the time step and stabilization parameter, they proved that the scheme preserves the discrete maximum bound principle, maximum-norm stability, discrete energy stability, and L error estimates, verified by numerical experiments. Chu et al. [10] constructed a second-order Crank-Nicolson difference scheme for the one-dimensional Allen-Cahn equation, proving the existence of the difference solution and its adherence to the discrete maximum principle, and further demonstrating the unconditional convergence of the numerical solution in the infinity norm.

In this paper, we develop a second-order Crank-Nicolson finite difference scheme for the three-dimensional Allen-Cahn equation and provide an analysis of its truncation error. We prove the existence, uniqueness, and convergence of the discrete solution under this scheme, and further establish its adherence to the discrete maximum principle. In the numerical experiments, the first two test cases validate the discrete maximum principle, while the third test case involves fitting the equation using both the Crank-Nicolson scheme and the Physics-Informed Neural Network (PINN) algorithm. Using the Crank-Nicolson solution as a benchmark, we compare the L 2 and L errors of the PINN algorithm under various network architectures and visualize the isosurface plots at identical time slices. The results demonstrate a high degree of consistency between the two methods. All three test cases confirm the feasibility and effectiveness of the proposed approach.

2. Construction of the Difference Scheme

Let m and n be positive integers. Partition the interval [ a , b ] into m equal subintervals and the interval [ 0 , T ] into n equal subintervals. Set h = ( b a ) / m , τ = T / n , and x i = a + i h , y j = a + j h , z l = a + l h , for 0 i , j , l m , and 0 k n . Here h and τ denote the spatial and temporal step sizes, respectively. Let Ω h = { ( x i , y j , z l ) | 0 i , j , l m } , Ω τ = { t k | 0 k n } , and Ω h τ = Ω h × Ω τ , A point ( x i , y j , z l , t k ) is called a grid node. For any grid function { v i , j , l k } defined on Ω h τ , we introduce the following notations:

v i , j , l k + 1 2 = 1 2 ( v i , j , l k + v i , j , l k + 1 ) , δ t v i , j , l k + 1 2 = 1 τ ( v i , j , l k + 1 v i , j , l k ) ,

δ x v i + 1 2 , j , l k = 1 h ( v i + 1 , j , l k v i , j , l k ) , δ x v i 1 2 , j , l k = 1 h ( v i , j , l k v i 1 , j , l k ) ,

δ y v i , j + 1 2 , l k = 1 h ( v i , j + 1 , l k v i , j , l k ) , δ y v i , j 1 2 , l k = 1 h ( v i , j , l k v i , j 1 , l k ) ,

δ z v i , j , l + 1 2 k = 1 h ( v i , j , l + 1 k v i , j , l k ) , δ z v i , j , l 1 2 k = 1 h ( v i , j , l k v i , j , l 1 k ) ,

δ x 2 v i , j , l k = 1 h 2 ( v i 1 , j , k k 2 v i , j , l k + v i + 1 , j , l k ) , δ y 2 v i , j , l k = 1 h 2 ( v i , j 1 , k k 2 v i , j , l k + v i , j + 1 , l k ) ,

δ z 2 v i , j , l k = 1 h 2 ( v i , j , l 1 k 2 v i , j , l k + v i , j , l + 1 k ) , Δ h v i , j , l k + 1 2 = δ x 2 v i , j , l k + 1 2 + δ y 2 v i , j , l k + 1 2 + δ z 2 v i , j , l k + 1 2 .

Denote

t k + 1 2 = 1 2 ( t k + t k + 1 ) , U i , j , l k = u ( x i , y j , z l , t k ) .

Evaluating the Allen-Cahn equation at the grid point ( x i , y j , z l , t k + 1 2 ) yields:

u t ( x i , y j , z l , t k + 1 2 ) = ϵ 2 Δ u ( x i , y j , z l , t k + 1 2 ) u 3 ( x i , y j , z l , t k + 1 2 ) + u ( x i , y j , z l , t k + 1 2 ) .

To ensure the validity of the Taylor expansions used below, we assume that the exact solution u ( x , y , z , t ) is sufficiently smooth, in particular that all mixed time derivatives up to third order and spatial derivatives up to fourth order exist and are continuous in Ω ¯ × [ 0 , T ] .

δ t U i , j , l k + 1 2 = ϵ 2 ( δ x 2 U i , j , l k + 1 2 + δ y 2 U i , j , l k + 1 2 + δ z 2 U i , j , l k + 1 2 ) ( U i , j . l k + 1 2 ) 3 + U i , j . l k + 1 2 + R i , j , l k .

where R i , j , l k denotes the truncation remainder term.

R i , j , l k = τ 2 [ 1 24 3 u t 3 ( x i , y j , z l , A i , j , l k ) ϵ 2 8 4 u t 2 x 2 ( x i , y j , z l , B i , j , l k ) ϵ 2 8 4 u t 2 y 2 ( x i , y j , z l , C i , j , l k ) ϵ 2 8 4 u t 2 z 2 ( x i , y j , z l , D i , j , l k ) 1 8 2 u t 2 ( x i , y j , z l , E i , j , l k ) ] h 2 ϵ 2 24 [ 4 u x 4 ( G i , j , l k , y j , z l , t k ) + 4 u x 4 ( H i , j , l k , y j , z l , t k + 1 ) + 4 u y 4 ( x i , I i , j , l k , z l , t k )

+ 4 u y 4 ( x i , J i , j , l k , z l , t k + 1 ) + 4 u z 4 ( x i , y j , K i , j , l k , t k ) + 4 u z 4 ( x i , y j , L i , j , l k , t k + 1 ) ] + [ τ 6 512 4 u t 2 ( x i , y j , z l , F i , j , l k ) ] 3 .

t k < A i , j , l k , B i , j , l k , , F i , j , l k < t k + 1 ,

x i 1 < G i , j , l k , H i , j , l k < x i + 1 , y j 1 < I i , j , l k , J i , j , l k < y j + 1 , z l 1 < K i , j , l k , L i , j , l k < z l + 1 .

Neglecting the truncation error R i , j , l k and replacing U i , j , l k by u i , j , l k in the Taylor expansion, we obtain the following difference scheme

δ t u i , j , l k + 1 2 = ϵ 2 ( δ x 2 u i , j , l k + 1 2 + δ y 2 u i , j , l k + 1 2 + δ z 2 u i , j , l k + 1 2 ) ( u i , j . l k + 1 2 ) 3 + u i , j , l k + 1 2 , 1 i , j , l m 1 , 0 k n 1. (4)

u i , j , l 0 = u 0 ( x i , y j , z l ) , 1 i , j , l m 1. (5)

u i , j , l k = 0 , ( i , j , l ) Ω , 0 k n . (6)

Denote

c = 1 24 max ( x , y , z ) Ω 0 t T | 3 u t 3 | + ϵ 2 8 ( max ( x , y , z ) Ω 0 t T | 4 u t 2 x 2 | + max ( x , y , z ) Ω 0 t T | 4 u t 2 y 2 | + max ( x , y , z ) Ω 0 t T | 4 u t 2 z 2 | ) + 1 8 max ( x , y , z ) Ω 0 t T | 2 u t 2 | .

c = ϵ 2 12 ( max ( x , y , z ) Ω 0 t T | 4 u x 4 | + max ( x , y , z ) Ω 0 t T | 4 u y 4 | + max ( x , y , z ) Ω 0 t T | 4 u z 4 | ) .

Set

c = max [ c , c ] .

Then the local truncation error satisfies

| R i , j , l k | c 3 ( τ 2 + h 2 ) , 1 i , j , l m 1 , 0 k n 1.

3. Main Results

We begin by introducing some notations. For grid functions v and w defined on Ω h τ , define the discrete inner product and norms by:

( v , w ) = h 3 i = 1 m 1 j = 1 m 1 l = 1 m 1 v i , j , l w i , j , l .

| v k | 1 2 = h 3 [ 1 i m , 1 j m 1 , 1 l m 1. ( δ x v i 1 2 , j , l k ) 2 + 1 i m 1 , 1 j m , 1 l m 1. ( δ y v i , j 1 2 , l k ) 2 + 1 i m 1 , 1 j m 1 , 1 l m . ( δ z v i , j , l 1 2 k ) 2 ] .

v 2 = ( v , v ) , v = max | v i , j , l k | .

Lemma 1 (Browder fixed point theorem). Let ( H , , ) be a finite dimensional inner product space, the associated norm, Π : H H be continuous. Assume that α > 0 , z H , z = α , there is Re ( Π ( z ) , z ) 0 , z * H such that Π ( z * ) = 0 , and z * α .

Theorem 2. The difference scheme (4)-(6) admits at least one solution.

Proof. Clearly, the Crank-Nicolson discretization of the Allen-Cahn equation leads to a two-level nonlinear difference scheme. Assume that the grid values u i , j , l k at time level k are given. Then the discrete system can be regarded as a nonlinear algebraic system for the midpoint values u i , j , l k + 1 2 . Once the midpoint values u i , j , l k + 1 2 are determined, the solution at the next time level is recovered by u i , j , l k + 1 = 2 u i , j , l k + 1 2 u i , j , l k .

Denote w i , j , l = u i , j , l k + 1 2 , 0 i , j , l m , the difference scheme can be written as

{ 2 τ ( ω i , j , l u i , j , l k ) ϵ 2 [ δ x 2 ω i , j , l + δ y 2 ω i , j , l + δ z 2 ω i , j , l ] + ω i , j , l 3 ω i , j , l = 0 , ω 0 = 0 , ω m = 0.

Let Π ( ω ) = 2 τ ( ω i , j , l u i , j , l k ) ϵ 2 [ δ x 2 ω i , j , l + δ y 2 ω i , j , l + δ z 2 ω i , j , l ] + ω i , j , l 3 ω i , j , l .

( Π ( ω ) , ω ) = 2 τ [ ( ω , ω ) ( u k , ω ) ] ( ϵ 2 Δ h ω , ω ) + ( ω 3 , ω ) ( ω , ω ) = 2 τ [ ω 2 ( u k , ω ) ] + ϵ 2 [ δ x ω 2 + δ y ω 2 + δ z ω 2 ] + ω 4 ω 2 2 τ ( ω 2 u k ω ) ω 2 = 2 τ ( 1 τ 2 ) ( ω 1 1 τ 2 u k ) ω . (7)

Hence, under the conditions τ 2 < 1 , and ω 1 1 τ 2 u k , it follows that ( Π ( ω ) , ω ) 0 . By Lemma 1, a solution to the difference scheme exists.

Theorem 3. Given the current time level u i , j , l k is known, if the time step size satisfies τ < 2 , then the solution at the next time level u i , j , l k + 1 is unique.

Proof. Assume that there exist two solutions u i , j , l k and v i , j , l k .Hence,

u i , j , l k + 1 u i , j , l k = τ ϵ 2 2 Δ h ( u i , j , l k + 1 + u i , j , l k ) + τ 2 [ f ( u i , j , l k + 1 ) + f ( u i , j , l k ) ] .

v i , j , l k + 1 u i , j , l k = τ ϵ 2 2 Δ h ( v i , j , l k + 1 + u i , j , l k ) + τ 2 [ f ( v i , j , l k + 1 ) + f ( u i , j , l k ) ] .

Subtracting the above two equations and letting d i , j , l k + 1 = u i , j , l k + 1 v i , j , l k + 1 , we can obtain,

d i , j , l k + 1 = τ ϵ 2 2 Δ h d i , j , l k + 1 + τ 2 [ f ( u i , j , l k + 1 ) f ( v i , j , l k ) ] . (8)

Taking the discrete L 2 inner product with d i , j , l k + 1 ,

d i , j , l k + 1 2 + τ ϵ 2 2 h d i , j , l k + 1 2 = τ 2 [ f ( u i , j , l k + 1 ) f ( v i , j , l k ) , d i , j , l k + 1 ] . (9)

Expand f ( u ) f ( v ) = ( u 3 v 3 ) + ( u v ) = ( u v ) [ 1 ( u 2 + u v + v 2 ) ] .

Thus

[ f ( u i , j , l k + 1 ) f ( v i , j , l k + 1 ) , d i , j , l k + 1 ] d i , j , l k + 1 2 . (10)

Substituting (8), (9) and (10), we obtain

d i , j , l k + 1 2 d i , j , l k + 1 2 + τ ϵ 2 2 h d i , j , l k + 1 2 τ 2 d i , j , l k + 1 2 .

Hence

( 1 τ 2 ) d i , j , l k + 1 2 0.

In Theorem 2, we proved that when τ < 2 , the solution of the difference scheme exists. Therefore, d i , j , l k + 1 2 = 0 and u i , j , l k + 1 = v i , j , l k + 1 .

Lemma 4. [10] Define

Φ ( u ) = { u 3 , | u | B , B 3 , u B , B 3 , u B .

Φ ( u ) is bounded continuous functions on R. M 0 = max a x b 0 t T | u ( x , t ) | , B = M 0 + 1 . Φ ( u ) satisfies the Lipschitz condition, for any u 1 , u 2 R ,

| Φ ( u 1 ) Φ ( u 2 ) | c | u 1 u 2 | ,

with c = 3 B 2 .

Lemma 5. Let V = { v | v = ( v 0 , v 1 , , v m ) , v 0 = v m = 0 } . Let v V , we have the following relationship among the norms:

v b a 2 | v | 1 , v b a 6 | v | 1

In order to consider the convergence of difference schemes (4)-(6), we discuss the following difference scheme:

δ t u i , j , l k + 1 2 = ϵ 2 ( δ x 2 u i , j , l k + 1 2 + δ y 2 u i , j , l k + 1 2 + δ z 2 u i , j , l k + 1 2 ) Φ ( u i , j , l k + 1 2 ) + u i , j . l k + 1 2 , 1 i , j , l m 1 , 0 k n 1 , (11)

u i , j , l 0 = u 0 ( x i , y j , z l ) , 1 i , j , l m 1 , (12)

u i , j , l k = 0 , ( i , j , l ) Ω , 0 k n . (13)

Theorem 6. Assume that U i , j , l is the exact solution of Equations (1)-(3). u i , j , l is the solution of (11)-(13). Denote e i , j , l k as the error,

e i , j , l k = U i , j , l k u i , j , l k , 0 i , j , l m , 0 k n .

There exists a constant c 2 independent of h and τ such that

| e k | 1 c 2 ( τ 2 + h 2 ) , 0 k n .

e k b a 2 3 h c 2 ( τ 2 + h 2 ) , 0 k n .

Proof. Subtracting Equation (1) from (11), we obtain the following error equation

δ t e i , j , l k + 1 2 = ϵ 2 Δ h e i , j , l k + 1 2 Φ ( U i , j . l k + 1 2 ) + Φ ( u i , j . l k + 1 2 ) + e i , j , l k + R i , j , l k , 1 i , j , l m 1 , 0 k n 1 , (14)

e i , j , l 0 = 0 , 1 i , j , l n 1 , (15)

e i , j , l k = 0 , ( i , j , l ) Ω , 0 k n . (16)

Now, we aim to estimate | e k | 1 . Taking the product of (14) with h 3 δ t e i , j , l k + 1 2 , summing over i , j , l from 1 to m 1 , and simplifying the resulting expression yields, we have

h 3 ε 2 i , j , l = 1 m 1 ( δ t e i j l k + 1 2 ) ( δ x 2 e i j l k + 1 2 + δ y 2 e i j l k + 1 2 + δ z 2 e i j l k + 1 2 ) = h 3 i , j , l = 1 m 1 ( δ t e i j l k + 1 2 ) 2 + h 3 i , j , l = 1 m 1 ( δ t e i j l k + 1 2 ) e i j l k + 1 2 h 3 i , j , l = 1 m 1 δ t e i j l k + 1 2 [ Φ ( U i j l k + 1 2 ) Φ ( u i j l k + 1 2 ) ] + h 3 i , j , l = 1 m 1 ( δ t e i j l k + 1 2 ) R i j l k + 1 2 . (17)

On the left-hand side, we have

h 3 ε 2 i , j , l = 1 m 1 ( δ t e i j l k + 1 2 ) ( δ x 2 e i j l k + 1 2 + δ y 2 e i j l k + 1 2 + δ z 2 e i j l k + 1 2 ) = ϵ 2 2 τ ( | e k + 1 | 1 2 | e k | 1 2 ) . (18)

The first term on the right-hand side,

h 3 i , j , l = 1 m 1 ( δ t e i j l k + 1 2 ) 2 = δ t e k + 1 2 2 . (19)

For the second term on the right-hand side, by Young’s inequality to obtain

h 3 i , j , l = 1 m 1 ( δ t e i j l k + 1 2 ) e i j l k + 1 2 δ t e k + 1 2 e k + 1 2 1 3 δ t e k + 1 2 2 + 3 4 e k + 1 2 2 . (20)

The third term on the right-hand side,

h 3 i , j , l = 1 m 1 δ t e i j l k + 1 2 [ Φ ( U i j l k + 1 2 ) Φ ( u i j l k + 1 2 ) ] h 3 c i , j , l = 1 m 1 | δ t e i j l k + 1 2 | | e i j l k + 1 2 | c δ t e k + 1 2 e k + 1 2 1 3 δ t e k + 1 2 2 + 3 c 2 4 e k + 1 2 2 . (21)

The fourth term on the right-hand side,

h 3 i , j , l = 1 m 1 ( δ t e i j l k + 1 2 ) R i j l k + 1 2 δ t e k + 1 2 R k + 1 2 1 3 δ t e k + 1 2 2 + 3 4 R k + 1 2 2 . (22)

Substituting Equations (18)-(22) into Equation (17), we obtain

ε 2 2 τ ( | e k + 1 | 1 2 | e k | 1 2 ) 3 ( 1 + c 2 ) 8 ( e k + 1 2 + e k 2 ) + 3 4 e k + 1 2 2 + 3 4 R k + 1 2 2 3 ( 1 + c 2 ) ( b a ) 2 48 [ ( | e k + 1 | 1 ) 2 + ( | e k | 1 ) 2 ] + 3 4 ( b a ) c 1 2 ( τ 2 + h 2 ) 2 . (23)

Hence,

| e k + 1 | 1 2 | e k | 1 2 ( 1 + c 2 ) ( b a ) 2 τ 8 ε 2 ( | e k + 1 | 1 2 + | e k | 1 2 ) + 3 τ c 1 2 2 ε 2 ( b a ) ( τ 2 + h 2 ) 2 .

Define

β 1 = ( 1 + c 2 ) ( b a ) 2 8 ε 2 , β 2 = 3 c 1 2 2 ε 2 ( b a ) .

We can obtain

| e k + 1 | 1 2 1 + β 1 τ 1 β 1 τ | e k | 1 2 + β 2 τ 1 β 1 τ ( τ 2 + h 2 ) 2 = γ | e k | 1 2 + δ . (24)

By the above inequality (24), we obtain

| e 1 | 1 2 δ , | e 2 | γ | e 1 | 1 2 + δ γ δ + δ ,

| e k | 1 2 δ n = 0 k 1 γ n = δ ( γ k 1 ) γ 1 .

When β 1 τ 1 , γ = 1 + β 1 τ 1 β 1 τ 1 + 2 β 1 τ , and γ k 1 γ 1 e 2 β 1 k τ 1 2 β 1 τ e 2 β 1 T 1 2 β 1 τ , thus,

| e k | 1 β 2 ( e 2 β 1 T 1 ) 2 β 1 ( 1 β 1 ) τ ( τ 2 + h 2 ) = c 2 ( τ 2 + h 2 ) .

Now we focus on the estimates of e k .

| e i 0 , j 0 , l 0 k | 2 b a 4 h i = 1 m ( δ x e i 1 2 , j 0 , l 0 ) 2 ,

| e i 0 , j 0 , l 0 k | 2 b a 4 h j = 1 m ( δ y e i 0 , j 1 2 , l 0 ) 2 ,

| e i 0 , j 0 , l 0 k | 2 b a 4 h l = 1 m ( δ z e i 0 , j 0 , l 1 2 ) 2 .

Adding the above three terms, we obtain

h 2 j = 1 m 1 l = 1 m 1 ( e i 0 , j , l k ) 2 + h 2 i = 1 m 1 l = 1 m 1 ( e i , j 0 , l k ) 2 + h 2 i = 1 m 1 j = 1 m 1 ( e i , j , l 0 k ) 2 b a 4 | e k | 1 2 .

Thus,

3 h 2 ( e i 0 , j 0 , l 0 k ) 2 b a 4 | e k | 1 2 ,

e k = | e i 0 , j 0 , l 0 k | b a 2 3 h c 2 ( τ 2 + h 2 ) .

Theorem 7. The numerical of the fully discrete scheme (4)-(6) converges to the solution of the problem (1)-(3), provided that the step size satisfies b a 2 3 h c 2 ( τ 2 + h 2 ) 1 .

Proof. We need to prove that the difference scheme (11)-(13) is equivalent to the difference scheme (4)-(6). Since the solution of the difference scheme (11)-(13) converges to that of the scheme (1)-(3), it follows that when

b a 2 3 h c 2 ( τ 2 + h 2 ) , we have

max 1 i , j , l m 1 0 k n | e i , j , l k | b a 2 3 h c 2 ( τ 2 + h 2 ) 1.

Since

| u i , j , l k | = | U i , j , l k | + | e i , j , l k | M 0 + 1 = B ,

| u i , j , l k + 1 | = | U i , j , l k + 1 | + | e i , j , l k + 1 | M 0 + 1 = B ,

we obtain

| u i , j , l k + 1 2 | = | U i , j , l k + 1 2 | + | e i , j , l k + 1 2 | M 0 + 1 = B .

Thus #Math_177#, and the difference scheme (4)-(6) converges to (1)-(3).

Theorem 8. If the initial value u 0 is bounded by 1, then for b a 2 3 h c 2 ( τ 2 + h 2 ) 1 and for each time level k , it holds that U k 1 .

Proof. According to Theorem 8,

max 1 i , j , l m 1 1 k n | e i , j , l k | = max 1 i , j , l m 1 1 k n | U i , j , l k u i , j , l k | = | e i , j , l k | b a 2 3 h c 2 ( τ 2 + h 2 ) = ε 0 .

We can obtain,

u i , j , l k [ U i , j , l k ε 0 , U i , j , l k + ε 0 ] ,

the solution of the Allen-Cahn equation | U i , j , l k | [ 0 , 1 ] , hence | u i , j , l k | [ ε 0 , 1 + ε 0 ] .When h 0 and τ 0 , ε 0 0 . Therefore,

max 1 i , j , l m 1 0 k n | u i , j , l k | 1 ,

It holds that U k 1 .

4. Numerical Experiment

We performed three numerical experiments to test our hypotheses. Tests 1 - 2 verify the maximum-value theorem: with initial data bounded by 1, the solution remains ≤ 1. Test 3 uses the Crank-Nicolson (CN) scheme from this paper as the reference to compare L 2 and L errors between PINN and CN. Because the problem is high-dimensional, we compare isosurfaces on identical time slices rather than full 3D visualization.

We first provide a brief introduction to the Physics-Informed Neural Network (PINN) algorithm (for detailed discussion, refer to [11]).

Physics-Informed Neural Networks (PINNs) combine deep learning with physical models to solve partial differential equations (PDEs). As depicted in Figure 1, PINNs incorporate PDE residuals, boundary conditions, and initial conditions into the loss function. Through backpropagation, the network minimizes this loss, yielding accurate numerical solutions that satisfy the governing physics.

Figure 1. Illustration of the PINN framework.

Physics Loss: The residual of the equation is defined as:

r ( a , t ) = u ( a , t ) t ϵ 2 Δ u ( a , t ) + u ( a , t ) u ( a , t ) 3 , a = ( x , y , z ) .

All derivatives are computed via automatic differentiation from the neural network’s output. The physics loss is the mean squared error of the residual over N f randomly sampled collocation points in the domain:

L f = 1 N f i = 1 N f | r ( a i , t i ) | 2 .

Boundary Loss: The boundary loss ensures that the neural network satisfies the Dirichlet boundary condition u = 0 on the six faces of the domain Ω for all t [ 0 , T ] . The boundary loss is defined as the mean squared error of the network’s output at N b randomly sampled points on the boundary:

L f = 1 N b i = 1 N b | r ( a i b , t i ) | 2 .

where a i b Ω are boundary points. This loss enforces the physical constraint that the solution remains zero at the domain boundaries, enhancing the solution’s accuracy and physical consistency.

Initial Condition Loss: The initial condition loss ensures that the neural network’s output at t = 0 matches the prescribed initial condition. This loss is computed as the mean squared error over N i randomly sampled points in the spatial domain at t = 0 :

L i = 1 N i i = 1 N i | u ( a i , 0 ) 0.1 sin ( π x i ) sin ( π y i ) sin ( π z i ) | 2 .

Total Loss Function: The total loss function, which is the objective of the PINN training, is a weighted sum of the three components:

L = L f + λ 1 L i + λ 2 L b .

where λ 1 and λ 2 are weighting coefficients determined through experimentation to balance the contributions of the physics, initial condition, and boundary losses.

Example 4.1. We consider the three-dimensional Allen-Cahn equation subject to an initial condition.

u 0 ( x , y , z ) = 0.05 sin ( π x ) sin ( π y ) sin ( π z ) , ( x , y , z ) [ 0 , 1 ] 3 .

For other relevant parameters, we denote ϵ = 0.05 , h = 1 64 , T = 15 . We take τ = 5 × 10 4 , 2.5 × 10 4 , 1 × 10 4 . We consider the second-order Crank-Nicolson scheme with varying time step sizes. The following three figures illustrate the evolution of the infinity norm | u | m a x of the solution under different time steps. From Figure 2, it can be observed that the scheme satisfies the maximum principle.

Example 4.2. Consider:

u 0 ( x , y , z ) = 0.5 × r a n d ( x , y , z ) 0.25 , ( x , y , z ) ( 0 , 1 ) 3 .

The parameter settings are identical to those in Example 4.1. This example also plots the infinity norm of u, denoted as | u | m a x , for each time step under τ = 5 × 10 4 , 2.5 × 10 4 , 1 × 10 4 . As shown in Figure 3, the results similarly satisfy the maximum principle.

Example 4.3. Consider:

u t = ϵ 2 ( u x x + u y y + u z z ) f ( u ) , ( x , y , z ) [ 0 , 1 ] 3 , t [ 0 , 1 ] ,

u ( x , y , z , 0 ) = 0.1 sin ( π x ) sin ( π y ) sin ( π z ) , ( x , y , z ) [ 0 , 1 ] 3 ,

u ( x , y , z , t ) = 0 , ( x , y , z ) Γ , t [ 0 , 1 ] .

In the Crank-Nicolson finite-difference scheme we set the parameters ϵ = 0.1 ,

Figure 2. Maximum values for scheme (4) with time step τ = 5 × 10 4 , 2.5 × 10 4 and 1 × 10 4 .

Figure 3. Maximum values for scheme (4) with time step τ = 5 × 10 4 , 2.5 × 10 4 and 1 × 10 4 .

h = 1 64 , T = 1 and τ = 0.001 . For the PINN algorithm, training was performed

using the Adam optimizer with a learning rate of 10−3 to minimize the loss. The weights of the two loss terms, λ 1 and λ 2 , were both set to 10. Network parameters were initialized using the Xavier scheme. During training, we randomly sampled 30,000 collocation (physics) points, 12,000 boundary points, and 10,000 initial-condition points for optimization; the training proceeded for a total of 20,000 iterations. We computed the L 2 and L errors for different network architectures. Table 1 shows these results; the 8 × 60 architecture (eight hidden layers with 60 neurons per layer) produced the smallest L 2 and L errors.

Table 1. L 2 and L errors under different network architectures.

Because the equation is high-dimensional, direct visualization of the full solution is infeasible. To facilitate presentation, we generated isosurface renderings of u ( x , y , z ) = 0.05 at the time slices t = 0.01 , 0.1 , 0.9 using both a Crank-Nicolson finite-difference scheme and a physics-informed neural network (PINN); the results are shown in Figure 4 and Figure 5. In future work, PINNs and their improved variants can be integrated into the Allen-Cahn framework to achieve higher-accuracy computations.

5. Conclusions and Suggestions

In this paper, we establish a Crank-Nicolson finite difference scheme for the three-dimensional Allen-Cahn equation and rigorously prove key properties of its solutions, including existence, uniqueness, and the maximum principle. These theoretical results lay a solid mathematical foundation for numerical simulations.

In the numerical experiments, we first validate the effectiveness of the maximum principle. Subsequently, employing the Crank-Nicolson scheme as the benchmark solution, we utilize the Physics-Informed Neural Network (PINN) algorithm to approximate the equation and compute the L 2 and L errors. The results indicate satisfactory accuracy of the PINN algorithm, highlighting its

Figure 4. Contour plots of u = 0.05 for difference scheme (4) at t = 0.01 , 0.1 and 0.9.

Figure 5. Contour plots of u = 0.05 for PINN at t = 0.01 , 0.1 and 0.9.

potential for solving phase-field equations of this type. Visualization further corroborates these findings: isosurface plots of the Crank-Nicolson scheme and PINN algorithm at identical time slices exhibit high consistency.

In the future, the PINN algorithm can be extended to more complex Allen-Cahn equations and their variants, offering efficient computational tools for phase-field modeling.

Acknowledgements

I would like to thank the ISCAM 2025 Organizing Committee for providing me with the opportunity to submit this paper.

Conflicts of Interest

The authors declare no conflicts of interest regarding the publication of this paper.

References

[1] Allen, S.M. and Cahn, J.W. (1979) A Microscopic Theory for Antiphase Boundary Motion and Its Application to Antiphase Domain Coarsening. Acta Metallurgica, 27, 1085-1095.[CrossRef]
[2] Ham, S., Kang, S., Hwang, Y., Lee, G., Kwak, S., Jyoti, et al. (2025) A Fourth-Order Finite Difference Method for the Allen-Cahn Equation. Journal of Computational and Applied Mathematics, 453, Article ID: 116159.[CrossRef]
[3] Xu, C., Cao, Y. and Hou, T. (2025) Numerical Analysis of a Second-Order Finite Difference Scheme for Riesz Space-Fractional Allen-Cahn Equations. Advances in Continuous and Discrete Models, 2025, Article No. 2.[CrossRef]
[4] Hou, T., Tang, T. and Yang, J. (2017) Numerical Analysis of Fully Discretized Crank-Nicolson Scheme for Fractional-In-Space Allen-Cahn Equations. Journal of Scientific Computing, 72, 1214-1231.[CrossRef]
[5] Choi, J., Ham, S., Kwak, S., Hwang, Y. and Kim, J. (2024) Stability Analysis of an Explicit Numerical Scheme for the Allen-Cahn Equation with High-Order Polynomial Potentials. AIMS Mathematics, 9, 19332-19344.[CrossRef]
[6] Alqanawi, B. and Aigo, M.A. (2023) Semi-Implicit Scheme to Solve Allen-Cahn Equation with Different Boundary Conditions. American Journal of Computational Mathematics, 13, 122-135.[CrossRef]
[7] Evans, L.C., Soner, H.M. and Souganidis, P.E. (1992) Phase Transitions and Generalized Motion by Mean Curvature. Communications on Pure and Applied Mathematics, 45, 1097-1123.[CrossRef]
[8] Tang, T. and Yang, J. (2016) Implicit-Explicit Scheme for the Allen-Cahn Equation Preserves the Maximum Principle. Journal of Computational Mathematics, 34, 451-461.[CrossRef]
[9] Li, M., Li, W., Du, Z. and Hou, T. (2025) A Maximum Bound Principle Preserving CN/AB Finite Difference Scheme for Riesz Space-Fractional Allen-Cahn Equations with Logarithmic Free Energy. Advances in Continuous and Discrete Models, 2025, Article No. 69.[CrossRef]
[10] Chu, Q., Jin, G., Shen, J. and Jin, Y. (2021) Numerical Analysis of Crank-Nicolson Scheme for the Allen-Cahn Equation. Journal of Computational Mathematics, 39, 655-665.[CrossRef]
[11] Raissi, M., Perdikaris, P. and Karniadakis, G.E. (2019) 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.[CrossRef]

Copyright © 2026 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.