Welcome to visit Communications in Theoretical Physics,
Mathematical Physics

Data-driven discovery of soliton solutions and parameter inversion for the discrete mKdV equation via the traveling-wave constrained PINNs with soft and hard constraints

  • Li Sun ,
  • Xiao-Yong Wen , * ,
  • Jian-Chen Zhou
Expand
  • School of Applied Science, Beijing Information Science and Technology University, Beijing 100192, China

*Author to whom any correspondence should be addressed.

Received date: 2026-02-26

  Revised date: 2026-06-04

  Accepted date: 2026-06-05

  Online published: 2026-07-15

Copyright

© 2026 Institute of Theoretical Physics CAS, Chinese Physical Society and IOP Publishing. All rights, including for text and data mining, AI training, and similar technologies, are reserved.
This article is available under the terms of the IOP-Standard License.

Abstract

This paper proposes a discrete deep learning method, termed the traveling-wave constrained physics-informed neural networks (TC-PINNs), for addressing both the forward and inverse problems of discrete nonlinear lattice equations (NLEs). The discrete mKdV equation is used as a representative example to validate the effectiveness of the proposed approach. We respectively carry out numerical simulations and parameter inversion for one- and two-soliton solutions of the discrete mKdV equation by employing the traveling-wave transformation and propagation properties through soft constraint and hard constraint schemes, and further extend this approach to rational soliton solutions. Numerical experiments show that the TC-PINNs consistently outperform traditional PINNs and symmetric difference data enhancement physics-informed neural networks (SDE-PINNs) in both the interior and extrapolation predictions of soliton solutions as well as parameter inversion. Compared with soft constraints, TC-PINNs under hard constraints achieve a higher prediction accuracy. This method can also be applied to solve other discrete NLEs and perform parameter inversion.

Cite this article

Li Sun , Xiao-Yong Wen , Jian-Chen Zhou . Data-driven discovery of soliton solutions and parameter inversion for the discrete mKdV equation via the traveling-wave constrained PINNs with soft and hard constraints[J]. Communications in Theoretical Physics, 2026 , 78(9) : 095005 . DOI: 10.1088/1572-9494/ae78bb

1. Introduction

In recent years, artificial intelligence (AI), supported by big data and deep learning, has been extensively utilized across a wide range of fields, including computer network technology [1], e-commerce [2], pharmaceutical sciences [3], and educational management [4]. Currently, the application of AI methodologies to the study of nonlinear partial differential equations (NPDEs) has emerged as an innovative research frontier. NPDEs, as fundamental mathematical tools for describing complex natural and engineering phenomena, serve as a crucial link between mathematical theory and practical applications. Progress in solving these equations directly facilitates advancements in physics, engineering, meteorology, and related disciplines. However, solving NPDEs presents significant challenges, such as the high data costs associated with solution generation and limited generalization capabilities. Researchers are actively investigating the integration of deep learning to enable efficient and rapid solutions and discoveries of these equations. To address these challenges, researchers have developed a deep learning algorithm based on the physical laws of nonlinear equations, i.e. PINNs [5], which has attracted widespread attention and exerted a revolutionary impact.
In contrast to purely data-driven paradigms that depend on extensive labeled datasets [6], the principal innovation of PINNs lies in the integration of physical laws as prior knowledge within the neural network training process. By formulating a composite optimization objective, PINNs facilitate the efficient approximation of solution fields in physical systems and enable precise parameter identification [7]. Since the introduction of this framework, PINNs have swiftly emerged as a prominent research focus across various disciplines, attributable to their advantages such as data efficiency [8], high interpretability [9], and grid-free discretization [10]. They have been effectively employed to address both forward solution problems and inverse parameter estimation tasks across a wide range of classical physical problems [11].
To overcome the performance bottlenecks of traditional PINNs, academia has seen numerous innovative improvements. In terms of constraint enhancement: Lin et al have proposed a two-stage PINNs method based on conservation laws, which has improved prediction accuracy and generalization capabilities [12]; Xiao et al have adopted a domain decomposition strategy to efficiently enable parallel computing, enhancing the stability of solving complex-domain problems [13]; Gao et al have optimized the loss function structure via an adaptive weighting algorithm, improving the balance between physical constraints and data fitting [14]; focusing on parameter prediction and integrable systems, Pu et al have introduced parameter regularization and integrated Lax pair constraints into PINNs to improve physical consistency and acquire reliable solutions [15, 16]. In terms of architecture optimization: fast finite volume PINNs integrate discretization and residual correction loss, enabling fast solution of high-Reynolds-number flow problems [17]; Wang et al have proposed extended hybrid-training PINNs, which combine initial-boundary points and internal points of equations, significantly improving prediction accuracy and stability [18]; eXtended PINNs support spatiotemporal domain decomposition for irregular geometries, reducing computational costs [19]; Song et al have proposed a volume weighting strategy to dynamically adjust PDE residuals, alleviating the imbalance between different loss terms [20]. In terms of application expansion: PINNs have been successfully applied to the simulation and parameter inversion of the internal solitary wave KdV equation [21], the solution of soliton solutions for nonlinear Schrödinger equations [22, 23], and data-driven discovery of variable-coefficient coupled nonlinear Schrödinger systems [24]; meanwhile, discrete-time PINNs provide a better network representation for high-dimensional problems [25].
Although significant progress has been made in PINNs research, most existing achievements focus on solving continuous NPDEs [26], while exploration of discrete nonlinear lattice equation (NLEs) remains relatively scarce [27]. Compared with continuous NPDEs, discrete NLEs are constructed on spatial lattices. Their core advantage is that they can characterize physical phenomena and dynamic behaviors originating from the intrinsic discreteness of systems, which cannot be captured by continuous NPDEs. Their applications span a wide range of fields, including fundamental physics, engineering technology, biochemistry [28], and AI. In traditional PINNs, the differentiation of continuous equations can be achieved via automatic differentiation, whereas the differentiation of discrete equations is far more difficult, posing certain challenges to conventional PINN methods. Lin et al have realized the prediction of solutions to discrete equations by performing difference operations with and without pseudo-grids [29]. Zhou et al have proposed SDE-PINNs, which adopt forward and backward differences based on symmetry to investigate the numerical simulation and parameter inversion of soliton solutions for discrete equations, achieving extremely high accuracy [30, 31]. These innovations have verified feasibility, but a mature methodological system has not yet been formed, and there are deficiencies in physical information constraints that require further exploration.
Our research focuses on discrete NLEs, which are widely present in scenarios such as atomic chain vibrations [32], lattice mechanics [33], and optical fiber communications [34]. The unique dynamical behaviors of their soliton solutions such as elastic collisions and shape invariance [35] are essentially dominated by two core physical properties: translation and symmetry [36], which impose higher requirements on the stability and accuracy of numerical methods. To further improve the accuracy of discrete NLEs solutions and parameter inversion, we develop traveling-wave constrained physics-informed neural networks (TC-PINNs) by incorporating traveling wave transformations and the translational propagation properties of solitons into existing discrete PINNs based on forward and backward differences. We propose this approach into neural networks using two distinct schemes: soft constraints and hard constraints, constructing soft-constrained TC-PINNs (s-TC-PINNs) and hard-constrained TC-PINNs (h-TC-PINNs) for comparative analysis.
We verify the effectiveness of the proposed method by taking the discrete mKdV equation [37] as an example, which is given by:
$\begin{align} u_{n, t} & = \left(1+u_{n}^{2}\right)\left[u_{n+2}-2 u_{n+1}+2 u_{n-1}-u_{n-2} \right. \nonumber\\ &\quad \left.+ u_{n+1}^{2}\left(u_{n+2}+u_{n}\right)-u_{n-1}^{2}\left(u_{n}+u_{n-2}\right)\right],\end{align}$
where $ u_n = u(n, t) $ denotes a real-valued function of the discrete variable $ n $ and time variable $ t $, and $ u_{n,t} = \frac{\mathrm{d}u_n}{\mathrm{d}t} $. Equation (1) is an integrable discretized form of the continuous mKdV equation, while the continuous version has extensive applications in fields such as plasma waves, traffic flow dynamics, fluid mechanics, and nonlinear optics [38]. Various soliton solutions and dynamical behaviors of equation (1) have been derived and investigated via the discrete generalized ($m, N - m$)-fold Darboux transformation (DT) and asymptotic analysis techniques [37], whereas neither numerical simulations nor parameter inversions have been carried out for it. We use equation (1) to perform comparative analysis of numerical simulations and parameter inversion among TC-PINNs (with soft/hard constraints), traditional PINNs, and SDE-PINNs (with soft/hard constraints).
The structure of this paper is organized as follows: section 2 elaborates on the traveling-wave constrained model with soft and hard constraints. Section 3 discusses numerical simulations of three soliton solutions of equation (1) under different models. Section 4 compares the parameter inversion accuracy across different models. Section 5 presents ablation experiments and parameter sensitivity analysis, including activation function selection, network architecture tuning, loss weight optimization, time step analysis, traveling wave transformation fairness verification, and applicability validation under unknown wave velocity. Section 6 summarizes the research findings and presents conclusions.

2. Model description

This section will elaborate on how to solve discrete NLEs by constructing TC-PINNs and leveraging them for this purpose.

2.1. Traveling wave transformation, translation processing, and hard constraints

For soliton solutions of discrete NLEs with $M$ solitons, we first construct $M$ traveling wave invariants to characterize the translational invariance of each soliton:
$\begin{align} \xi_m = n - v_m t, \quad m = 1,2,\dots,M,\end{align}$
where $v_m$ denotes the exact physical velocity of the $m$-th soliton (fixed as analytical values derived from soliton solution formulations), $n$ is the discrete spatial variable, and $t$ is the temporal variable.
For any spacetime point $(n,t)$, we define $M+1$ prediction components $\{u_0, u_1, \dots, u_M\}$ via a shared neural network:

Current-time component $u_0$: The input to the shared neural network is the concatenated feature of all $M$ traveling wave invariants at the current point $(n,t)$:

$\begin{align} u_0 = \mathcal{N}\left( \left[ \xi_1\left(n,t\right), \xi_2\left(n,t\right), \dots, \xi_M\left(n,t\right) \right] \right),\end{align}$
where $\mathcal{N}(\cdot)$ represents the shared fully connected neural network with tanh activation and Xavier initialization.

Translated components $\{u_1, u_2, \dots, u_M\}$: For the $m$-th soliton, we calculate the translated spacetime point at the previous time step $t-\Delta t$, where $\Delta t$ denotes the fixed time step for hard constraint and is set to a constant value of $0.01$ in all experiments:

$\begin{align} \left(n_m^{^{\prime}}, t^{^{\prime}}\right) = \left( n - v_m \cdot \Delta t, \, t - \Delta t \right).\end{align}$
The input to the shared neural network for $u_m$ is the concatenated feature of all $M$ traveling wave invariants at this translated point:
$\begin{align} u_m = \mathcal{N}\left( \left[ \xi_1\left(n_m^{^{\prime}}, t^{^{\prime}}\right), \xi_2\left(n_m^{^{\prime}}, t^{^{\prime}}\right), \dots, \xi_M\left(n_m^{^{\prime}}, t^{^{\prime}}\right) \right] \right).\end{align}$

Unified hard constraint fusion: The final prediction of the wave field $u(n,t)$ is obtained by fusing all components to enforce time-step consistency and translational invariance:

$\begin{align} u_{\text{pred}}\left(n,t\right) = \frac{u_0 + \sum_{m = 1}^M u_m}{2}.\end{align}$

2.2. Neural network architecture

We denote the parameters in the neural network, namely the weights and biases, by $\theta$. In the design of the loss function, to represent the residual of the discrete mKdV equation, we perform automatic differentiation on the time dimension of the discrete mKdV equation, and handle the spatial dimension using forward and backward difference methods. That is, for its spatial domain, we use $n \pm i$ to represent $u_{n \pm i}$, and then obtain the residual $\xi(u, n \pm i, \theta)$. The specific expression of the loss function is as follows:
$\begin{align} \mathcal{L}\left(\theta\right) & = w_1\mathcal{L}_\mathrm{F}\left(\theta\right) + w_2\mathcal{L}_\mathrm{I}\left(\theta\right) + w_3\mathcal{L}_\mathrm{B}\left(\theta\right)\nonumber\\ &\quad + w_4\mathcal{L}_\mathrm{S}\left(\theta\right) + w_5\mathcal{L}_\mathrm{T}\left(\theta\right),\end{align}$
with
$\begin{align} \begin{cases} \mathcal{L}_\mathrm{F}\left(\theta\right) = \frac{1}{N_\mathrm{F}} \displaystyle\sum_{i = 1}^{N_\mathrm{F}} \left| u_t - \xi\left(u, n \pm i; \theta\right) \right|^2, \\[6pt] \mathcal{L}_\mathrm{I}\left(\theta\right) = \frac{1}{N_\mathrm{I}} \displaystyle\sum_{j = 1}^{N_\mathrm{I}} \left| u_{\theta}\left(t_0, n_i\right) - u_0\left(n_i\right) \right|^2, \\[6pt] \mathcal{L}_\mathrm{B}\left(\theta\right) = \frac{1}{N_\mathrm{B}} \displaystyle\sum_{k = 1}^{N_\mathrm{B}} \left| u_{\theta}\left(t_i, n_{\mathrm{B}, i}\right) - u_{B}\left(t_i\right) \right|^2, \\[6pt] \mathcal{L}_\mathrm{S}\left(\theta\right) = \frac{1}{N_\mathrm{S}} \displaystyle\sum_{m = 1}^{N_\mathrm{S}}\left|u_\theta\left(t_i, n_i\right) - u_\theta\left(2c_t - t_i, 2c_n - n_i\right)\right|^{2}, \\[6pt] \mathcal{L}_\mathrm{T}\left(\theta\right) = \frac{1}{N_\mathrm{T}} \displaystyle\sum_{n = 1}^{N_\mathrm{T}} \left| u_0 - \frac{u_0 + \sum_{m = 1}^M u_m}{2} \right|^2, \end{cases}\end{align}$
where $w_1$, $w_2$, $w_3$, $w_4$, and $w_5$ are weights for the five loss components, corresponding to the physics equation loss, initial condition loss, boundary condition loss, symmetry loss, and translation loss, respectively. $\mathcal{L}_\mathrm{F}(\theta)$ denotes the physics equation loss, $N_\mathrm{F}$ is the number of sampling points for computing PDE residuals, $\xi(u, n\pm i, \theta)$ represents the nonlinear terms of NLEs; $\mathcal{L}_\mathrm{I}(\theta)$ denotes the initial condition loss, $N_\mathrm{I}$ is the number of sampling points for the initial condition, $n_i$ is the spatial sampling point at the initial time; $\mathcal{L}_\mathrm{B}(\theta)$ denotes the boundary condition loss, which constrains the neural network output in the boundary region to match the given boundary condition, $N_\mathrm{B}$ is the number of sampling points at the boundary, when the boundary condition is $u(t, n_\mathrm{B}) = u_\mathrm{B}(t)$ ($n_\mathrm{B}$ is the point on the boundary), $(t_i, n_{\mathrm{B},i})$ is the spatiotemporal sampling point on the boundary; $\mathcal{L}_\mathrm{S}(\theta)$ denotes the symmetry loss, which constrains the neural network output to satisfy the central symmetry property. $N_\mathrm{S}$ is the number of sampling points for computing the symmetry loss; $(t_i, n_i)$ is a selected spatiotemporal sampling point, and $(2c_t - t_i, 2c_n - n_i)$ is its symmetric point with respect to the learnable symmetry center $(c_t, c_n)$. $\mathcal{L}_\mathrm{T}(\theta)$ denotes the translation loss, $N_\mathrm{T}$ is the number of sampling points for computing the translation loss, $u_0$ denotes the baseline value of the neural network prediction, $u_m$ ($m = 1,2,\dots,M$) represents the $m$th component of the neural network prediction at the sampling points, and the loss term constrains the difference between the baseline value $u_0$ and the average of $u_0$ and the sum of $M$ prediction components $\sum_{m = 1}^M u_m$ at each of the $N_\mathrm{T}$ sampling points.
The complete architecture is shown in figure 1.
Figure 1. Schematic of the TC-PINNs network architecture based on discrete NLEs.

2.3. Data preparation and training, network configuration, and model evaluation

This paper adopts the Hammersley sampling method [39] to generate the sampling training set $ N_\mathrm{F} $. First, the Adam optimizer is used for training, and then the Limited-memory Broyden–Fletcher–Goldfarb–Shanno (L-BFGS) optimizer is used for further refined training. In equation (7), we assign different weights to each loss term, and different weight configurations enable the neural network to correctly learn the physical laws of the equation.
In the neural network architecture adopted in this paper, it first includes an input layer for processing two-dimensional spatiotemporal data. For different soliton solutions, the number of hidden layers used is 4, and the number of neurons corresponding to each layer is 32/64. The activation function used is the hyperbolic tangent (tanh) function. In terms of optimizer settings, the learning rate of Adam is set to $ 1 \times 10^{-3} $, while the learning rate of L-BFGS is set to 1.
To effectively evaluate the performance of the model, we use the relative error as an indicator to evaluate the model’s effect. Its function is defined as follows:
$\begin{align} \text{RE} = \frac{\| u_{\theta,k} - u_{\text{true},k}\|_2}{\| u_{\text{true},k}\|_2}.\end{align}$
The code runs in a Python 3.11.7 environment using PyTorch version 2.7.0+cu126 on a high-performance computer equipped with an NVIDIA GeForce RTX 4060 laptop GPU.

2.4. Summary of the TC-PINNs method

Based on the above descriptions, the core concepts of TC-PINNs are summarized as follows, and their implementation details are summarized in table 1:

• A traveling wave transformation reduces the discrete NLEs’ spacetime variables $n, t$ to a single variable $\xi = n - vt$, applicable to constant-speed solitons.

• Solitons propagate at a constant speed while preserving their properties. By enforcing neural network outputs to be consistent under spatial translation, the translational invariance is naturally satisfied.

Table 1. Summary of the TC-PINNs framework (Discrete mKdV equation).
Step Implementation details
Step 1 Traveling wave transformation and translation processing
• Traveling-wave transformations: Construct $M$ traveling wave invariants $\xi_m = n - v_m t$, $m = 1,2,\dots,M$
where $v_m$ is the exact physical velocity of the $m$-th soliton (fixed analytical values)
• Translation-invariant coordinates at previous time step $t-\Delta t$:
For the $m$-th soliton, translated point $(n_m^{^{\prime}}, t^{^{\prime}}) = (n - v_m \cdot \Delta t, t - \Delta t)$
where $\Delta t = 0.01$ is the fixed time step for hard constraint
• Multi-basis implementation: Concatenate all $M$ traveling wave invariants into a feature vector:
For current time: $\left[\xi_1(n,t), \xi_2(n,t), \dots, \xi_M(n,t)\right]$
For translated point: $\left[\xi_1(n_m^{^{\prime}}, t^{^{\prime}}), \dots, \xi_M(n_m^{^{\prime}}, t^{^{\prime}})\right]$
• Neural network mapping: Shared fully connected network $\mathcal{N}(\cdot)$ (tanh activation, Xavier initialization)
Current-time component: $u_0 = \mathcal{N}\left(\left[\xi_1(n,t), \dots, \xi_M(n,t)\right]\right)$
Translated components: $u_m = \mathcal{N}\left(\left[\xi_1(n_m^{^{\prime}}, t^{^{\prime}}), \dots, \xi_M(n_m^{^{\prime}}, t^{^{\prime}})\right]\right)$, $m = 1,\dots,M$
• Hard constraint output fusion:
Final prediction: $u_{\text{pred}}(n,t) = \frac{u_0 + \sum_{m = 1}^M u_m}{2}$

Step 2 Neural network architecture
• Input layer: Process 2D spatiotemporal data
• Hidden layers:
– 4 hidden layers in total
– Number of neurons per layer: 32/64 (32 for one-soliton/first-order rational soliton (RS), 64 for two-soliton)
• Activation function: Hyperbolic tangent (tanh)
• Residual computation:
– Automatic differentiation on the time dimension of the discrete mKdV equation
– Forward and backward difference on spatial dimension ($n \pm i$ to represent $u_{n\pm i}$)
– Residual expression: $\xi(u, n \pm i, \theta)$

Step 3 Loss function formulation
• Total loss: $\mathcal{L}(\theta) = w_1\mathcal{L}_\mathrm{F}(\theta) + w_2\mathcal{L}_\mathrm{I}(\theta) + w_3\mathcal{L}_\mathrm{B}(\theta) + w_4\mathcal{L}_\mathrm{S}(\theta) + w_5\mathcal{L}_\mathrm{T}(\theta)$
• Component details:
– $\mathcal{L}_\mathrm{F}(\theta) = \frac{1}{N_\mathrm{F}} \sum_{i = 1}^{N_\mathrm{F}} \left| u_t - \xi(u, n \pm i; \theta) \right|^2$: Physics equation loss
– $\mathcal{L}_\mathrm{I}(\theta) = \frac{1}{N_\mathrm{I}} \sum_{j = 1}^{N_\mathrm{I}} \left| u_\theta(t_0, n_i) - u_0(n_i) \right|^2$: Initial condition loss
– $\mathcal{L}_\mathrm{B}(\theta) = \frac{1}{N_\mathrm{B}} \sum_{k = 1}^{N_\mathrm{B}} \left| u_\theta(t_i, n_{\mathrm{B},i}) - u_\mathrm{B}(t_i) \right|^2$: Boundary condition loss
– $\mathcal{L}_\mathrm{S}(\theta) = \frac{1}{N_\mathrm{S}} \sum_{m = 1}^{N_\mathrm{S}} \left| u_\theta(t_i, n_i) - u_\theta(2c_t - t_i, 2c_n - n_i) \right|^2$: Symmetry loss
– $\mathcal{L}_\mathrm{T}(\theta) = \frac{1}{N_\mathrm{T}} \sum_{n = 1}^{N_\mathrm{T}} \left| u_0 - \frac{u_0 + \sum_{m = 1}^M u_m}{2} \right|^2$: Translation symmetry loss
– Different weights $w_i$ assigned to each loss term for correct physical law learning

Step 4 Training Strategy and Configuration
• Optimization: Two-phase training
– Pre-training: Adam optimizer (learning rate = $1 \times 10^{-3}$)
– Fine-tuning: L-BFGS optimizer (learning rate = $1.0$)
• Data sampling: Hammersley sampling method to generate training set $N_\mathrm{F}$
• Evaluation metrics:
– Overall Relative Error (RE): $\text{RE} = \frac{\|u_{\theta,k} - u_{\text{true},k}\|_2}{\|u_{\text{true},k}\|_2}$
– $\text{RE}_{\text{Ins}}$: Inside predicting relative error
– $\text{RE}_{\text{Ext}}$: Extrapolation relative error
• Runtime environment:
– Python 3.11.7, PyTorch 2.7.0+cu126
– High-performance computer with NVIDIA GeForce RTX 4060 laptop GPU

3. Data-driven solutions of equation (1)

This section presents numerical simulations of soliton solutions for equation (1).

3.1. Numerical simulation of one-soliton solution to equation (1)

First, we study one-soliton solution of equation (1). We use one-soliton solution in [35] as follows:
$\begin{equation} u_n = \frac{1 - \lambda_1^4}{2\lambda_1^2} \operatorname{sech}\left( \xi_1 + \ln \lambda_1 \right),\end{equation}$
where $\xi_1 = \left(2\ln\lambda_1\right)n + \left(\lambda_1^4 - \frac{1}{\lambda_1^4} + \frac{2}{\lambda_1^2} - 2\lambda_1^2\right)t$, where $\lambda_1 \gt 0$ is the spectral parameter with a value of $\frac{1}{2}$, the soliton velocity corresponding to this one-soliton solution is given by $v = \frac{\lambda_1^8 - 2\lambda_1^6 + 2\lambda_1^2 - 1}{2\lambda_1^4 \ln \lambda_1}$. The training domain is $n \in [-5, 5]$ and $t \in [-1, 1]$. The Hammersley sampling method is adopted, with $N_\mathrm{F} = 2000$ physical sampling points and $N_\mathrm{B} = 200$ boundary sampling points. The initial time $t_0$ is set to $0.0$, and the number of initial points $N_\mathrm{I}$ is $100$. First, we conduct experiments using PINNs without soft/hard constraints, where the loss function weights are $w_1 = 10$, $w_2 = 100$, $w_3 = 100$. The training process is divided into two stages: the first stage uses the Adam optimizer for $2000$ iterations, and the second stage uses the L-BFGS optimizer for $50$ iterations, and the $\text{RE}_{\text{Ins}}$ is $9.6054 \times 10^{-4}$. Next, we apply soft and hard constraints based on the soliton symmetry property, respectively. For the soft constraint, a symmetry loss term is added to the loss function with $w_4 = 10$, and the $\text{RE}_{\text{Ins}}$ is $7.5113 \times 10^{-4}$. For the hard constraint, the symmetry property is embedded into the neural network without adding a symmetry loss term, and the $\text{RE}_{\text{Ins}}$ is $5.5394 \times 10^{-4}$. Finally, we apply soft and hard constraints based on the soliton translational property, respectively. For the soft constraint, a translational loss term is added to the loss function with $w_5 = 10$, and the $\text{RE}_{\text{Ins}}$ is $2.9499 \times 10^{-4}$. For the hard constraint, the translational property is embedded into the neural network without adding a translational loss term, and the $\text{RE}_{\text{Ins}}$ is $1.83885 \times 10^{-4}$. The spatiotemporal heatmaps under the five methods are compared in figure 2.
Figure 2. Data-driven one-soliton solution for equation (1): (a) shows the exact solution by the traditional discrete PINNs method; (b) shows the predicted solution obtained by the s-TC-PINNs method; (c) shows the predicted solution obtained by the h-TC-PINNs method; (d)–(f) display the simulation results of PINNs, s-TC-PINNs and h-TC-PINNs, respectively.
To enhance the credibility of the results, each method is tested with five different random seeds, and the relative errors are presented in the form of mean $\pm$ standard deviation. We also perform extrapolation to compare the generalization ability of the models, with the extrapolation range set to $n \in [-5, 5]$ and $t \in [-1.2, -1] \cup [1, 1.2]$. The experimental results are also stored in table 2. The results show that after applying soft or hard constraints, the model can learn the symmetry or translation properties of solitons and improve the accuracy of numerical simulations. Moreover, the improvement in model accuracy is more significant under hard constraints, and the extrapolation error accuracy of hard constraints is higher than that of soft constraints, indicating that hard constraints have superior generalization ability. Furthermore, under the same conditions, the prediction performance of TC-PINNs is more excellent. In terms of computational efficiency, the proposed h-TC-PINNs achieve the best trade-off between accuracy and training speed, requiring the least training time while maintaining the lowest errors. We plot the above experimental data into a boxplot for a more intuitive visualization, as shown in figure 3.
Figure 3. Boxplots of inside predicting and extrapolation relative errors for one-soliton solution with different methods (PINNs, s-SDE-PINNs, h-SDE-PINNs, s-TC-PINNs, h-TC-PINNs) using 5 random seeds per model.
Table 2. Accuracy and time consumption of numerical simulation for one-soliton solution under different models. Values in bold represent inside predicting and extrapolation relative errors of models with hard constraints, and the training time of h-TC-PINNs is also marked in bold, so as to intuitively compare whether our method achieves superior computational efficiency.
Model $\text{RE}_{\text{Ins}}$ $\text{RE}_{\text{Ext}}$ Time
PINNs $(8.32 \pm 1.13) \times 10^{-4}$ $(1.32 \pm 0.21) \times 10^{-2}$ $(111.73\pm15.31)$s
s-SDE-PINNs $(6.14 \pm 1.14) \times 10^{-4}$ $(1.31 \pm 0.23) \times 10^{-2}$ $(112.11\pm8.29)$s
h-SDE-PINNs $\mathbf{(5.58 \pm 0.86) \times 10^{-4}}$ $\mathbf{(1.20 \pm 0.33) \times 10^{-2}}$ $(91.97\pm12.65)$s
s-TC-PINNs $(2.75 \pm 0.95) \times 10^{-4}$ $(5.05 \pm 1.99) \times 10^{-3}$ $(77.12\pm12.22)s$
h-TC-PINNs $\mathbf{(2.11 \pm 0.95) \times 10^{-4}}$ $\mathbf{(4.01 \pm 1.36) \times 10^{-3}}$ $\mathbf{(68.01\pm2.59)\mathrm{s}}$
To observe the spatiotemporal evolution of the one-soliton solution, we present the evolution diagrams obtained by h-TC-PINNs at three time instants. As can be seen from figure 4, the predicted solutions almost coincide with the true solutions, indicating that the model has successfully learned the nonlinear characteristics of the equation.
Figure 4. The time evolution of one-soliton solution at three different space-time points based on h-TC-PINNs.

3.2. Numerical simulation of two-soliton solution to equation (1)

Subsequently, we compare the soft and hard constraints using the translation or symmetry properties of the two-soliton solution. We use the two-soliton solution from [35]:
$\begin{align} u_n = \frac{F}{G},\end{align}$
where
$\begin{align} \begin{cases} F = \left(\lambda_{1}^{2} \lambda_{2}^{2}-1\right)\left(\lambda_{1}^{2}-\lambda_{2}^{2}\right)[\lambda_{1}^{2}\left(1-\lambda_{2}^{4}\right) \cosh \left(\eta_{1}+\ln \lambda_{1}\right)\\ \quad -\lambda_{2}^{2}\left(1-\lambda_{1}^{4}\right) \cosh \left(\eta_{2}+\ln \lambda_{2}\right)], \\[6pt] G = \lambda_{1}^{2} \lambda_{2}^{2}\Big[\bigl(\lambda_{1}^{2}-\lambda_{2}^{2}\bigr)^{2} \cosh \bigl(\eta_{1}+\ln \lambda_{1}+\eta_{2}+\ln \lambda_{2}\bigr) \\ \quad + \bigl(\lambda_{1}^{2} \lambda_{2}^{2}-1\bigr)^{2} \cosh \bigl(\eta_{1}+\ln \lambda_{1}-\eta_{2}-\ln \lambda_{2}\bigr) \\ \quad -\bigl(1-\lambda_{1}^{4}\bigr)\bigl(1-\lambda_{2}^{4}\bigr)\Big]. \end{cases}\end{align}$
Subsequently, we take $\lambda_1 = \frac{5}{2}$, $\lambda_2 = \frac{1}{2}$ and perform numerical simulations on its two bell-shaped soliton solution (11). The training domain is the same as that for the single soliton, with $N_\mathrm{F} = 3000$ Hammersley sampling points generated and $N_\mathrm{B} = 200$ boundary sampling points. The initial time $t_0$ is set to $0.0$ and $N_\mathrm{I} = 100$ initial points are used. The soliton velocities corresponding to this two-soliton solution are given by $v_1 = \frac{\lambda_1^8 - 2\lambda_1^6 + 2\lambda_1^2 - 1}{2\lambda_1^4 \ln \lambda_1}$ and $v_2 = \frac{\lambda_2^8 - 2\lambda_2^6 + 2\lambda_2^2 - 1}{2\lambda_2^4 \ln \lambda_2}$, respectively. First, we conduct experiments without any soft or hard constraints. In the loss function, $w_1 = 10$, $w_2 = 100$, $w_3 = 100$. The model is first trained with the Adam optimizer for 2000 iterations and then with the L-BFGS optimizer for 50 iterations. After training, the $\text{RE}_{\text{Ins}}$ is $1.7925 \times 10^{-3}$. Next, we apply soft and hard constraints respectively using the soliton symmetry property. For the soft constraint, a symmetry loss term is added to the loss function with $w_4 = 10$, and the $\text{RE}_{\text{Ins}}$ is $9.1458 \times 10^{-4}$. For the hard constraint, instead of adding a symmetry loss term, the symmetry property is embedded into the neural network, and the $\text{RE}_{\text{Ins}}$ is $8.8923 \times 10^{-4}$. Finally, we apply soft and hard constraints respectively using the soliton translation property. For the soft constraint, a translation loss term is added to the loss function with $w_5 = 10$, and the $\text{RE}_{\text{Ins}}$ is $7.3507 \times 10^{-4}$. For the hard constraint, the translational property is embedded into the neural network without adding a translational loss term, and the $\text{RE}_{\text{Ins}}$ is $5.0489 \times 10^{-4}$. The spatiotemporal heatmaps under the five methods are compared in figure 5.
Figure 5. Data-driven two-soliton solution for equation (1): (a) shows the exact solution via the traditional discrete PINNs method; (b) shows the predicted solution obtained by the s-TC-PINNs method; (c) shows the predicted solution obtained by the h-TC-PINNs method; (d)–(f) display the simulation results of PINNs, s-TC-PINNs and h-TC-PINNs, respectively.
To enhance the credibility of the results, each method is tested with five different random seeds, and the relative errors are presented in the form of mean $\pm$ standard deviation. We also perform extrapolation to compare the generalization ability of the models, with the extrapolation range set to $n \in [-5, 5]$ and $t \in [-1.2, -1] \cup [1, 1.2]$. The experimental results are also stored in table 3. The results show that after applying soft or hard constraints, the model can learn the symmetry or translation properties of solitons and improve the accuracy of numerical simulations. Moreover, the improvement in model accuracy is more significant under hard constraints, and the extrapolation error accuracy of hard constraints is higher than that of soft constraints, indicating that hard constraints have superior generalization ability. In terms of computational efficiency, although the TC-PINNs require slightly longer training time than SDE-PINNs, they deliver substantially better prediction accuracy and generalization performance, representing a favorable trade-off between computational cost and solution quality for two-soliton problems. Furthermore, under the same conditions, the prediction performance of TC-PINNs is more excellent. We plot the above experimental data into a boxplot for a more intuitive visualization, as shown in figure 6.
Figure 6. Boxplots of inside predicting and extrapolation relative errors for two-soliton solution with different methods (PINNs, s-SDE-PINNs, h-SDE-PINNs, s-TC-PINNs, h-TC-PINNs) using five random seeds per model.
Table 3. Accuracy and time consumption of numerical simulation for two-soliton solution under different models. Values in bold represent inside predicting and extrapolation relative errors of models with hard constraints, and the training time of h-TC-PINNs is also marked in bold, so as to intuitively compare whether our method achieves superior computational efficiency.
Model $\text{RE}_{\text{Ins}}$ $\text{RE}_{\text{Ext}}$ Time
PINNs $(1.42 \pm 0.28) \times 10^{-3}$ $(6.79 \pm 2.39) \times 10^{-2}$ $(112.68\pm8.50)$s
s-SDE-PINNs $(1.14 \pm 0.12) \times 10^{-3}$ $(5.93 \pm 1.08) \times 10^{-3}$ $(107.66\pm25.00)$s
h-SDE-PINNs $\mathbf{(8.54 \pm 1.28) \times 10^{-4}}$ $\mathbf{(5.73 \pm 4.43) \times 10^{-3}}$ $(127.52\pm41.01)$s
s-TC-PINNs $(7.36 \pm 0.79) \times 10^{-4}$ $(3.02 \pm 1.02) \times 10^{-3}$ $(208.65\pm19.90)$s
h-TC-PINNs $\mathbf{(7.28 \pm 1.59) \times 10^{-4}}$ $\mathbf{(2.57 \pm 0.66) \times 10^{-3}}$ $\mathbf{(240.18\pm16.89)\mathrm{s}}$

3.3. Numerical simulation of first-order RS solution to equation (1)

Finally, we further extend the proposed method to RS solutions of the discrete mKdV equation. We take the first-order RS solution in [35] as an example:
$\begin{align} u_n = \frac{3}{4} - \frac{4.6875}{\left[ \left( 3/2 \right) \left( n + \left( 675/64 \right) t \right) - \left( 1/2 \right) \right]^2 + 1}.\end{align}$
For the numerical simulation of first-order RS solution, the spatiotemporal domain for training is the same as that in section 3.1, and the number of sampling points and neural network settings are also the same as those in section 3.1, the soliton velocity corresponding to this first-order RS solution is given by $v = -\frac{675}{64}$. First, we conduct experiments using PINNs without any soft or hard constraints. In this case, the loss function has $w_1 = 10$, $w_2 = 100$, $w_3 = 100$. The training process is divided into two stages: the first stage uses the Adam optimizer for $2000$ iterations, and the second stage uses the L-BFGS optimizer for $50$ iterations. The final $\text{RE}_{\text{Ins}}$ is $3.2045 \times 10^{-3}$. Next, we apply soft and hard constraints respectively using the soliton symmetry property. For the soft constraint, a symmetry loss term is added to the loss function with $w_4 = 10$, and the $\text{RE}_{\text{Ins}}$ is $2.3498 \times 10^{-3}$. For the hard constraint, instead of adding a symmetry loss term, the symmetry property is embedded into the neural network, and the $\text{RE}_{\text{Ins}}$ is $1.0941 \times 10^{-3}$. Finally, we apply soft and hard constraints based on the soliton translational property, respectively. For the soft constraint, a translational loss term is added to the loss function with $w_5 = 10$, resulting in a $\text{RE}_{\text{Ins}}$ of $5.3870 \times 10^{-4}$. For the hard constraint, the translational property is embedded into the neural network without adding a translational loss term, and the $\text{RE}_{\text{Ins}}$ is $3.7200 \times 10^{-4}$. The spatiotemporal heatmaps under the five methods are compared in figure 7.
Figure 7. Data-driven first-order RS solution for equation (1): (a) shows the exact solution by the traditional discrete PINNs method; (b) shows the predicted solution obtained by the s-TC-PINNs method; (c) shows the predicted solution obtained by the h-TC-PINNs method; (d)–(f) display the simulation results of PINNs, s-TC-PINNs and h-TC-PINNs, respectively.
To enhance the credibility of the results, each method is tested with five different random seeds, and the relative errors are presented in the form of mean $\pm$ standard deviation. We also perform extrapolation to compare the generalization ability of the models, with the extrapolation range set to $n \in [-5, 5]$ and $t \in [-1.2, -1] \cup [1, 1.2]$. The experimental results are also stored in table 4. The results show that after applying soft or hard constraints, the model can learn the symmetry or translation properties of solitons and improve the accuracy of numerical simulations. Moreover, the improvement in model accuracy is more significant under hard constraints, and the extrapolation error accuracy of hard constraints is higher than that of soft constraints, indicating that hard constraints have superior generalization ability. In terms of computational efficiency, the proposed h-TC-PINNs achieve the best trade-off between accuracy and training speed, requiring the least training time while maintaining the lowest errors. Furthermore, under the same conditions, the prediction performance of TC-PINNs is more excellent. We plot the above experimental data into a boxplot for a more intuitive visualization, as shown in figure 8.
Figure 8. Boxplots of inside predicting and extrapolation relative errors for first-order RS solution with different methods (PINNs, s-SDE-PINNs, h-SDE-PINNs, s-TC-PINNs, h-TC-PINNs) using 5 random seeds per model.
Table 4. Accuracy and time consumption of numerical simulation for first-order RS solution under different models. Values in bold represent inside predicting and extrapolation relative errors of models with hard constraints, and the training time of h-TC-PINNs is also marked in bold, so as to intuitively compare whether our method achieves superior computational efficiency.
Model $\text{RE}_{\text{Ins}}$ $\text{RE}_{\text{Ext}}$ Time
PINNs $(2.75 \pm 0.52) \times 10^{-3}$ $(4.67 \pm 1.72) \times 10^{-3}$ $(139.47\pm22.06)$s
s-SDE-PINNs $(2.56 \pm 1.53) \times 10^{-3}$ $(4.53 \pm 2.32) \times 10^{-3}$ $(135.49\pm24.49)$s
h-SDE-PINNs $\mathbf{(1.86 \pm 0.82) \times 10^{-3}}$ $\mathbf{(4.44 \pm 2.05) \times 10^{-3}}$ $(162.08\pm28.58)$s
s-TC-PINNs $(5.14 \pm 1.58) \times 10^{-4}$ $(1.37 \pm 0.37) \times 10^{-3}$ $(146.76\pm26.94)$s
h-TC-PINNs $\mathbf{(4.30 \pm 1.10) \times 10^{-4}}$ $\mathbf{(7.35 \pm 1.64) \times 10^{-4}}$ $\mathbf{(121.84\pm24.49)\mathrm{s}}$

4. Parameter inversion of equation (1)

Extensive experiments show that applying soft and hard constraints of translation or symmetry achieves good performance in the numerical simulation of discrete NLEs. Based on this, we shift our focus from the forward problem to the parameter inversion of discrete NLEs. In this section, we still use equation (1) for parameter inversion.
In the process of parameter inversion for the discrete mKdV equation, we replace the coefficient $1$ for the linear and nonlinear terms on the right-hand side of equation (1) with $\lambda_1$ and $\lambda_2$, respectively. The updated equation is given as follows:
$\begin{align} u_{n, t} & = \left(1+u_{n}^{2}\right)\left\{\lambda_{1}\left(u_{n+2}-2 u_{n+1}+2 u_{n-1}-u_{n-2}\right)\right.\nonumber \\ & \left.\quad + \lambda_{2}\left[u_{n+1}^{2}\left(u_{n+2}+u_{n}\right)-u_{n-1}^{2}\left(u_{n}+u_{n-2}\right)\right]\right\}.\end{align}$
After introducing unknown parameters into the equation, the transformed parameters are also incorporated into the corresponding terms of the loss function, and the model parameters are optimized by combining physical constraints and observation data. We generate 100 internal labeled data points under different Gaussian noise conditions using uniform sampling and update the loss function by introducing a data loss term. The updated data loss term is as follows:
$\begin{align} \mathcal{L}_\mathrm{D}\left(\theta\right) = \frac{1}{N_\mathrm{D}} \sum_{l = 1}^{N_\mathrm{D}} \left| u_\theta\left(t_l, n_l\right) - u_\mathrm{D}\left(t_l, n_l\right) \right|^2.\end{align}$
The weight of the data loss term $w_6 = 1.0$. Using the same three soliton solutions as those in section 3, the parameter inversion is performed for equation (14) under 0%, 3%, 5% and 10% noise conditions respectively for each soliton solution. For each case, we take the average value of the inversion results from five different seeds, and the inversion results are presented in tables 57.
Table 5. Comparison of parameter inversion results for one-soliton solution under five models and different noise conditions.
Model Condition Parameter $(\lambda_{1},\lambda_{2})$ Relative error
Correct $(1.000\,000,1\,000\,000)$ $(0.0000,0.0000)$

PINNs Clean data $(1.000\,514,0.999\,946)$ $(5.1400 \times 10^{-4},5.4000 \times 10^{-5})$
3% noise $(0.994\,003,0.996\,814)$ $(5.9970 \times 10^{-3},3.1860 \times 10^{-3})$
5% noise $(0.994\,599,0.995\,671)$ $(5.4010 \times 10^{-3},4.3290 \times 10^{-3})$
10% noise $(0.862\,656,0.942\,404)$ $(1.3734 \times 10^{-1},5.7596 \times 10^{-2})$

s-SDE-PINNs Clean data $(0.999\,580,0.999\,820)$ $(4.2000 \times 10^{-4},1.8000 \times 10^{-4})$
3% noise $(1.002\,307,0.999\,582)$ $(6.5600 \times 10^{-3},5.3700 \times 10^{-4})$
5% noise $(1.006\,560,1.000\,537)$ $(2.3070 \times 10^{-3},4.1800 \times 10^{-4})$
10% noise $(1.012\,264,0.999\,902)$ $(1.2264 \times 10^{-2},9.8000 \times 10^{-5})$

h-SDE-PINNs Clean data $(0.999\,291,0.999\,749)$ $(7.0900 \times 10^{-4},2.5100 \times 10^{-4})$
3% noise $(0.998\,021,0.999\,240)$ $(1.9700 \times 10^{-3},2.8400 \times 10^{-4})$
5% noise $(0.997\,840,0.999\,375)$ $(2.1600 \times 10^{-3},6.2500 \times 10^{-4})$
10% noise $(0.999\,912,1.000\,284)$ $(8.8000 \times 10^{-5},2.8400 \times 10^{-4})$

s-TC-PINNs Clean data $0.999\,966,0.999\,940)$ $(3.4000 \times 10^{-5},6.0000 \times 10^{-5})$
3% noise $(1.000\,327,0.999\,887)$ $(3.2720 \times 10^{-4},1.1320 \times 10^{-4})$
5% noise $(1.000\,138,0.999\,572)$ $(1.3840 \times 10^{-4},4.2800 \times 10^{-4})$
10% noise $(1.000\,487,0.999\,153)$ $(4.8660 \times 10^{-4},8.4700 \times 10^{-4})$

h-TC-PINNs Clean data $(0.999\,878,1.000\,009)$ $(1.2200 \times 10^{-4},9.0000 \times 10^{-6})$
3% noise $(1.000\,207,0.999\,911)$ $(2.0700 \times 10^{-4},8.9000 \times 10^{-5})$
5% noise $(1.000\,112,0.999\,744)$ $(1.1200 \times 10^{-4},2.5600 \times 10^{-4})$
10% noise $(1.000\,896,0.999\,415)$ $(8.9600 \times 10^{-4},5.8500 \times 10^{-4})$
It can be seen from the experimental results that, overall, s-TC-PINNs, h-TC-PINNs, s-SDE-PINNs, and h-SDE-PINNs have a higher parameter inversion accuracy than the ordinary PINNs, and the hard constraints with translation or symmetry properties achieve the highest accuracy. As listed in tables 5 and 6, when performing parameter inversion using one-soliton solution and two-soliton solution, the accuracy order of hard constraints can reach $10^{-4}$ even under high noise conditions. The same approach is applied to RS solution, as shown in table 7, when performing parameter inversion using the first-order RS solution, the accuracy order of hard constraints can reach $10^{-4}$ even under high noise conditions. The experiments demonstrate that the model has strong robustness.
Table 6. Comparison of parameter inversion results for two-soliton solution under five models and different noise conditions.
Model Condition Parameter $(\lambda_{1},\lambda_{2})$ Relative error
Correct $(1.000\,000,1.000\,000)$ $(0.0000.0000)$

PINNs Clean data $(0.999\,697,1.000\,429)$ $(3.0300 \times 10^{-4},4.2900 \times 10^{-4})$
3% noise $(0.990\,605,0.992\,072)$ $(9.3950 \times 10^{-3},7.9280 \times 10^{-3})$
5% noise $(0.973\,323,0.984\,313)$ $(2.6677 \times 10^{-2},1.5687 \times 10^{-2})$
10% noise $(0.907\,931,0.952\,665)$ $(9.2069 \times 10^{-2},4.7335 \times 10^{-2})$

s-SDE-PINNs Clean data $(0.998\,493,0.999\,543)$ $(1.5070 \times 10^{-3},4.5700 \times 10^{-4})$
3% noise $(1.000\,989,0.998\,826)$ $(9.8900 \times 10^{-4},1.1740 \times 10^{-3})$
5% noise $(1.001\,941,0.998\,916)$ $(1.9410 \times 10^{-3},1.0840 \times 10^{-3})$
10% noise $(1.004\,893,0.997\,931)$ $(4.8930 \times 10^{-3},2.0690 \times 10^{-3})$

h-SDE-PINNs Clean data $(0.999\,410,0.999\,597)$ $(5.9000 \times 10^{-4},4.0300 \times 10^{-4})$
3% noise $(1.000\,632,0.999\,331)$ $(6.3200 \times 10^{-4},6.6900 \times 10^{-4})$
5% noise $(1.000\,676,0.998\,904)$ $(6.7600 \times 10^{-4},1.0960 \times 10^{-3})$
10% noise $(1.003\,399,0.998\,338)$ $(3.3990 \times 10^{-3},1.6620 \times 10^{-3})$

s-TC-PINNs Clean data $(1.000\,395,1.000\,034)$ $(3.9500 \times 10^{-4},3.4000 \times 10^{-5})$
3% noise $(0.999\,385,0.999\,161)$ $(6.1500 \times 10^{-4},8.3900 \times 10^{-4})$
5% noise $(0.999\,279,0.998\,446)$ $(7.2100 \times 10^{-4},1.5540 \times 10^{-3})$
10% noise $(0.999\,217,0.997\,335)$ $(7.8300 \times 10^{-4},2.6550 \times 10^{-3})$

h-TC-PINNs Clean data $(0.999\,743,0.999\,870)$ $(2.5700 \times 10^{-4},1.3000 \times 10^{-4})$
3% noise $(0.999\,390,0.999\,092)$ $(6.1000 \times 10^{-4},9.0800 \times 10^{-4})$
5% noise $(0.998\,459,0.998\,205)$ $(1.5410 \times 10^{-3},1.7950 \times 10^{-3})$
10% noise $(0.997\,753,0.996\,620)$ $(2.2470 \times 10^{-3},3.3800 \times 10^{-3})$
Table 7. Comparison of parameter inversion results for first-order RS solution under five models and different noise conditions.
Model Condition Parameter $(\lambda_{1},\lambda_{2})$ Relative error
Correct $(1.000\,000,1.000\,000)$ $(0.0000,0.0000)$

PINNs Clean data $(0.998\,249,1.000\,733)$ $(1.7510 \times 10^{-4},7.3300 \times 10^{-4})$
3% noise $(1.001\,975,1.004\,498)$ $(1.9750 \times 10^{-3},4.4980 \times 10^{-3})$
5% noise $(0.989\,970,0.992\,871)$ $(1.0030 \times 10^{-2},7.1290 \times 10^{-3})$
10% noise $(0.877\,464,0.922\,756)$ $(1.2254 \times 10^{-1},7.7244 \times 10^{-2})$

s-SDE-PINNs Clean data $(1.000\,043,1.000\,119)$ $(4.3400 \times 10^{-4},2.1190 \times 10^{-3})$
3% noise $(0.998\,565,0.998\,770)$ $(1.4350 \times 10^{-3},1.2300 \times 10^{-4})$
5% noise $(0.999\,976,0.999\,822)$ $(8.4000 \times 10^{-5},1.7800 \times 10^{-4})$
10% noise $(0.997\,193,0.999\,446)$ $(2.8070 \times 10^{-3},5.5400 \times 10^{-4})$

h-SDE-PINNs Clean data $(1.002\,695,0.999\,122)$ $(2.6950 \times 10^{-3},7.8400 \times 10^{-4})$
3% noise $(1.012\,460,1.002\,166)$ $(1.2460 \times 10^{-2},2.1660 \times 10^{-3})$
5% noise $(0.998\,538,0.999\,106)$ $(1.4620 \times 10^{-3},8.9400 \times 10^{-4})$
10% noise $(1.002\,766,0.999\,035)$ $(2.6660 \times 10^{-3},9.6500 \times 10^{-4})$

s-TC-PINNs Clean data $(1.000\,459,1.000\,326)$ $(4.5900 \times 10^{-4},3.2600 \times 10^{-4})$
3% noise $(1.000\,477,1.000\,435)$ $(4.7700 \times 10^{-4},4.3500 \times 10^{-4})$
5% noise $(1.000\,445,1.000\,494)$ $(4.4500 \times 10^{-4},4.9400 \times 10^{-4})$
10% noise $(1.000\,720,1.000\,587)$ $(7.2000 \times 10^{-4},5.8700 \times 10^{-4})$

h-TC-PINNs Clean data $(1.000\,538,1.000\,215)$ $(5.3800 \times 10^{-4},2.1500 \times 10^{-4})$
3% noise $(1.000\,346,1.000\,330)$ $(3.4600 \times 10^{-4},3.3000 \times 10^{-4})$
5% noise $(1.000\,646,1.000\,446)$ $(6.4600 \times 10^{-4},4.4600 \times 10^{-4})$
10% noise $(1.000\,131,1.000\,595)$ $(1.3100 \times 10^{-4},5.9500 \times 10^{-4})$

5. Ablation experiments and parameter sensitivity analysis

All ablation experiments and parameter sensitivity analyses in this section are carried out on the one-soliton solution of equation (1). As previous experiments have demonstrated that hard constraints outperform soft constraints, we adopt h-TC-PINN for all tests in this section. Taking this benchmark as our test platform, we systematically examine how the core components of the proposed h-TC-PINNs framework affect model performance, covering activation function, network architecture, loss weights, time step selection, traveling wave transformation, and the scenario with unknown soliton velocity.

5.1. Selection of activation function

To explore the effect of activation functions on model performance, we conduct comparative experiments using five typical activation functions, namely tanh, sin, ReLU, SiLU and Sigmoid. The quantitative results of inside predicting and extrapolation relative errors are presented in table 8.
Table 8. Performance comparison with different activation functions.
Activation function $\text{RE}_{\text{Ins}}$ $\text{RE}_{\text{Ext}}$
Tanh $(2.11 \pm 0.95)\times 10^{-4}$ $(4.01 \pm 1.36)\times 10^{-3}$
Sin $(2.24 \pm 0.79)\times 10^{-4}$ $(5.35 \pm 2.15)\times 10^{-3}$
ReLU $(1.34 \pm 0.55)\times 10^{-1}$ $(4.75 \pm 1.65)\times 10^{-1}$
SiLU $(2.11 \pm 0.74)\times 10^{-4}$ $(4.92 \pm 1.66)\times 10^{-3}$
Sigmoid $(2.14 \pm 0.72)\times 10^{-4}$ $(3.52 \pm 1.25)\times 10^{-3}$
It can be observed that the model with ReLU activation function exhibits the worst performance, with both errors reaching the order of $10^{-1}$, indicating severe instability during training. In contrast, smooth activation functions including tanh, sin, SiLU and Sigmoid achieve superior accuracy. In this work, we adopt the commonly used tanh activation function.

5.2. Selection of network architecture

On the basis of determining the activation function, we further investigate the influence of network depth and width on model performance. Experiments are conducted on networks with different depths (2, 4, 6 layers) and widths (16, 32, 64 neurons per layer), and the corresponding errors are listed in table 9.
Table 9. Performance under different network depths and widths (h-TC-PINNs vs. PINNs).
Depth Width h-TC-PINNs PINNs
$\text{RE}_{\text{Ins}}$ $\text{RE}_{\text{Ext}}$ $\text{RE}_{\text{Ins}}$ $\text{RE}_{\text{Ext}}$
2 16 $1.2306 \times 10^{-4}$ $2.8053 \times 10^{-3}$ $1.5685 \times 10^{-4}$ $4.0075 \times 10^{-3}$
32 $1.7000 \times 10^{-4}$ $3.3711 \times 10^{-3}$ $5.0491 \times 10^{-4}$ $1.0152 \times 10^{-2}$
64 $2.2712 \times 10^{-4}$ $4.9042 \times 10^{-3}$ $4.2500 \times 10^{-4}$ $7.2540 \times 10^{-3}$

4 16 $1.1468 \times 10^{-4}$ $2.0748 \times 10^{-3}$ $4.3244 \times 10^{-4}$ $6.7950 \times 10^{-3}$
32 $2.3491 \times 10^{-4}$ $4.9491 \times 10^{-3}$ $5.2000 \times 10^{-4}$ $7.2580 \times 10^{-3}$
64 $2.1359 \times 10^{-4}$ $4.1940 \times 10^{-3}$ $6.4000 \times 10^{-4}$ $1.2342 \times 10^{-2}$

6 16 $2.2858 \times 10^{-4}$ $4.5635 \times 10^{-3}$ $1.2630 \times 10^{-3}$ $1.8837 \times 10^{-2}$
32 $2.0512 \times 10^{-4}$ $3.9888 \times 10^{-3}$ $6.0300 \times 10^{-4}$ $1.1938 \times 10^{-2}$
64 $1.3145 \times 10^{-4}$ $1.8964 \times 10^{-3}$ $6.7500 \times 10^{-4}$ $1.0223 \times 10^{-2}$
The results show that all configurations achieve comparable performance with errors at the same order of magnitude. For h-TC-PINNs, $\text{RE}_{\text{Ins}}$ range from $1.1468\times 10^{-4}$ to $2.2858\times 10^{-4}$, and $\text{RE}_{\text{Ext}}$ range from $1.8964\times 10^{-3}$ to $4.9042\times 10^{-3}$, indicating that variations in network depth and width do not lead to significant performance differences. Meanwhile, h-TC-PINNs consistently outperform standard PINNs across all architectures, with both $\text{RE}_{\text{Ins}}$ and $\text{RE}_{\text{Ext}}$ being lower than those of standard PINNs.
Considering both computational efficiency and model stability, the 4-layer network with 32 neurons per layer is chosen as the default structure for its optimal trade-off. While deeper or wider networks can yield slightly lower errors in specific cases, they introduce higher computational overhead without substantial performance gains. The selected configuration achieves balanced performance ($\text{RE}_{\text{Ins}} = 2.3491\times 10^{-4}$, $\text{RE}_{\text{Ext}} = 4.9491\times 10^{-3}$) while maintaining a reasonable computational cost. Meanwhile, the network with 64 neurons per layer can be adopted as an alternative when dealing with more complex soliton solutions that require stronger feature fitting capability.

5.3. Selection of loss weights

After determining the activation function and network structure, an ablation study on loss weights is conducted to evaluate their effects on the model’s inside predicting and extrapolation performance, as illustrated in figures 9 and 10. The boxplots clearly present the median errors and distribution dispersion of h-TC-PINNs and standard PINNs under different weight combinations.
Figure 9. Box plots of inside predicting and extrapolation relative errors of the h-TC-PINNs method under different loss weights.
Figure 10. Box plots of inside predicting and extrapolation relative errors of the PINNs method under different loss weights.
Regarding the individual influence of each weight, when the PDE residual weight $w_1$ increases from 1 to 10, the median values of both inside predicting and extrapolation relative errors decrease significantly for both models. When $w_1$ is further raised to 50, the box widths become noticeably wider, indicating an increase in error dispersion. For the initial condition weight $w_2$, the configuration $w_2 = 10$ achieves lower median error and more concentrated distribution, while $w_2 = 1$ and $w_2 = 50$ lead to larger error fluctuations. As the boundary condition weight $w_3$ grows from 10 to 100, the median extrapolation errors of both models decline gradually with more concentrated error distributions.
By comparing the two models, h-TC-PINNs exhibits narrower box widths and more stable error distributions than standard PINNs under most weight settings. In contrast, standard PINNs suffers from more significant error fluctuations especially under $w_1 = 50$ and $w_3 = 10$. Based on all observations, the combination $(w_1,w_2,w_3) = (10,10,100)$ achieves the lowest median error and the narrowest box width for both models, which is therefore adopted as the optimal loss weight combination in all our experiments.

5.4. Basis for time step $\Delta t$ selection and its influence on hard constraints

To explore the sensitivity of the proposed model to the time step $\Delta t$, one hundred time step samples are uniformly sampled within the range of $[0.01, 0.1]$. For each $\Delta t$, the inside predicting and extrapolation relative errors are recorded. A series of statistical tests are conducted to quantitatively determine whether there exists a significant correlation between the magnitude of the time step and the model prediction errors. These methods include Pearson correlation analysis, Spearman correlation analysis, and the coefficient of determination $R^2$. The distribution of prediction errors with respect to different time steps is visualized in figure 11, which shows no apparent trend between $\Delta t$ and model errors.
Figure 11. Inside predicting and extrapolation relative errors under different time steps.
To comprehensively evaluate the relationship between time step and prediction errors, each statistical metric is used for a clear purpose, with specific judgment standards as follows: specifically, the Pearson correlation coefficient is used to check the linear correlation between time step and prediction errors—a value close to 0 means no obvious linear correlation, while values close to 1 or $-1$ mean a strong positive or negative linear correlation. The Spearman correlation coefficient is used to check the monotonic correlation between them—a value close to 0 means no obvious monotonic correlation, and values close to 1 or $-1$ mean a strong monotonic correlation. The corresponding $p$-value is used to judge significance: if $p \lt 0.05$, the correlation is statistically significant; if $p \ge 0.05$, there is no statistically significant correlation. In addition, the coefficient of determination $R^2$ is used to measure how much the change of prediction errors can be explained by the time step—a value close to 0 means the time step has almost no explanatory power for error changes, while a value close to 1 means the time step can well explain the error changes.
As presented in table 10, the Pearson and Spearman correlation coefficients between the time step and both prediction errors are all close to zero. All corresponding $p$-values are far greater than the significance level of $0.05$, indicating that no statistically significant linear or monotonic correlation exists between $\Delta t$ and model accuracy. Furthermore, the $R^2$ values are nearly zero, which confirms that the variation in prediction errors cannot be attributed to the change in the time step. These statistical results are consistent with the visual distribution in figure 11, where error points scatter randomly without any clear increasing or decreasing tendency as $\Delta t$ changes.
Table 10. Correlation analysis between time step and prediction errors.
Metric $\text{RE}_{\text{Ins}}$ $p$-value $\text{RE}_{\text{Ext}}$ $p$-value
Pearson correlation ($r$) $-0.110$ $0.2745$ $-0.112$ $0.2677$
Spearman correlation ($r$) $-0.027$ $0.7928$ $-0.040$ $0.6916$
Coefficient of determination ($R^2$) $0.012$ $0.013$
In summary, statistical analyses demonstrate that changing the time step within the tested interval imposes no significant impact on model performance. All our experiments use the minimum time step $\Delta t = 0.01$.

5.5. Fairness verification of traveling wave transformation

To verify the rationality of the traveling wave coordinate transformation in h-TC-PINNs, three comparative schemes are tested under the same network structure and training settings: the original PINNs, PINNs with fixed $v_m$ as input, and the proposed h-TC-PINNs with learnable $v_m$.
Table 11 shows that simply adding $v_m$ as a fixed input variable brings limited improvement to the model performance. Compared with the original PINNs, PINNs+$v_m$ achieves a slight reduction in $\text{RE}_{\text{Ins}}$, but its extrapolation performance does not show obvious improvement and even lags slightly behind, indicating that fixing $v_m$ as an input fails to effectively utilize the traveling wave physical priors. In sharp contrast, the proposed h-TC-PINNs with learnable $v_m$ traveling wave transformation achieves substantial improvements in both inside predicting and extrapolation accuracy, yielding much lower errors than the other two schemes. This fully demonstrates that the learnable traveling wave transformation can effectively embed inherent physical priors into the model, enhancing its fitting accuracy and generalization ability, and further verifying the rationality and effectiveness of the adopted traveling wave transformation.
Table 11. Performance comparison of different models.
Model $\text{RE}_{\text{Ins}}$ $\text{RE}_{\text{Ext}}$
PINNs $(8.32 \pm 1.13)\times 10^{-4}$ $(1.32 \pm 0.21)\times 10^{-2}$
PINNs+$v_m$ $(7.95 \pm 3.43)\times 10^{-4}$ $(2.21 \pm 1.27)\times 10^{-2}$
h-TC-PINNs $(2.11 \pm 0.95)\times 10^{-4}$ $(4.01 \pm 1.36)\times 10^{-3}$

5.6. Applicability analysis under unknown $v_m$

To validate the model’s applicability under unknown $v_m$, 50 initial velocities $v_0$ are sampled within $[-40.0, 10.0]$, and five random seeds are tested for each $v_0$. The results are presented in figure 12.
Figure 12. Inside predicting and extrapolation relative errors under different initial velocities. The red dashed line marks the position of the true velocity.
As can be seen, the model achieves the lowest errors near the true velocity (marked by the red dashed line). Specifically, within the range $[-20, 0]$ that accounts for 40% of the entire sampling interval, both $\text{RE}_{\text{Ins}}$ and $\text{RE}_{\text{Ext}}$ remain consistently low, showing excellent performance. As the deviation from the true velocity increases, the error gradually rises, and individual random seeds show instability. Nevertheless, the model maintains stable and low errors for most cases, demonstrating strong robustness to unknown $v_m$ and effectiveness without precise physical prior information.

6. Conclusions

This work focuses on the numerical simulation and parameter estimation of equation (1), with the goal of remedying the shortcomings of PINNs in embedding physical constraints into the solution of discrete NLEs. Our core innovations and principal findings are summarized as follows:

Significant improvement in the accuracy of predicted solutions: the proposed TC-PINNs are first applied to the numerical simulation of ordinary soliton solution (one-soliton solution, two-soliton solution), and then extended to the scenario of RS solution (first-order RS solution). The relative error of internal prediction of the model is reduced to the order of $10^{-4}$ for all cases, achieving a substantial improvement in the accuracy of predicted solutions. Moreover, h-TC-PINNs demonstrate even higher prediction accuracy.

Excellent extrapolation and generalization capability: this method has demonstrated outstanding extrapolation performance in the simulation of ordinary soliton solution (one-soliton solution, two-soliton solution), with the extrapolation error reduced by 30%–50% compared with traditional PINNs. When extended to RS solution (first-order RS solution), the model still maintains stable extrapolation accuracy, effectively breaking through the generalization bottleneck of data-driven methods in the extrapolation task of discrete systems, and reflecting the universal generalization ability of the constraint-enhanced mechanism for different types of soliton solutions. Furthermore, h-TC-PINNs exhibit stronger generalization robustness.

Superior performance in parameter inversion: the proposed constraint-based model exhibits outstanding performance in parameter inversion tasks for all types of soliton solutions. In the parameter inversion of one-soliton solution, two-soliton solution and first-order RS solution, even under the interference of 10% Gaussian noise, the relative inversion error is still controlled within the order of $10^{-3}$–$10^{-4}$, which is significantly better than traditional PINNs, fully verifying the reliability and robustness of the proposed method in parameter inversion.

Despite the promising results, this study has limitations. The current research is confined to the discrete mKdV equation, and the adaptability of TC-PINNs to other discrete NLEs (e.g. discrete nonlinear Schrödinger equations) requires further verification. Moreover, the selection of constraint forms and parameters for highly complex multi-soliton interaction systems still relies on empirical judgment, lacking an adaptive optimization mechanism. Future work will focus on extending the constraint-enhanced paradigm to more discrete nonlinear systems, developing an adaptive constraint selection algorithm based on system nonlinearity, and enhancing the universality and intelligence of PINNs in solving discrete NLEs.

This work is supported by the National Natural Science Foundation of China (Grant Nos. 12571263 and 12071042), Beijing Natural Science Foundation (Grant No. 1242004), BISTU Undergraduate Research Training Program 2025 (Grant No. 2025BKYY01) and BISTU Starlight Fund 2025 (Grant No. XG2025ZD31).

1
Wan H, Liu G L, Zhang L 2021 Research on the application of artificial intelligence in computer network technology EITCE 2021: 5th International Conference on Electronic Information Technology and Computer Engineering Xiamen, China 22–24 October 2021 704 707 ACM

DOI

2
Song X, Yang S, Huang Z, Huang T 2019 The application of artificial intelligence in electronic commerce J. Phys. Conf. Ser. 1302 032030

DOI

3
Yang Y J, Bang C S 2019 Application of artificial intelligence in gastroenterology World J. Gastroenterol. 25 1666

DOI

4
Igbokwe I C 2023 Application of artificial intelligence (AI) in educational management Int. J. Sci. Res. Publ. 13 300 307

DOI

5
Raissi M, Perdikaris P, Karniadakis G E 2019 Physics-informed neural networks: a deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations J. Comput. Phys. 378 686 707

DOI

6
Goodfellow I, Bengio Y, Courville A, Bengio Y 2016 Deep Learning MIT Press

7
Karniadakis G E, Kevrekidis I G, Lu L, Perdikaris P, Wang S, Yang L 2021 Physics-informed machine learning Nat. Rev. Phys. 3 422 440

DOI

8
Wang S, Teng Y, Perdikaris P 2021 Understanding and mitigating gradient flow pathologies in physics-informed neural networks SIAM J. Sci. Comput. 43 A3055 81

DOI

9
Ahmadi M 2025 Physics-informed neural modeling of interfacial tension in hydrogen-rich systems using attention-based learning Int. J. Hydrogen Energy 163 150829

DOI

10
Lu L, Meng X, Mao Z, Karniadakis G E 2021 DeepXDE: A deep learning library for solving differential equations SIAM Rev. 63 208 228

DOI

11
Sahin T, von Danwitz M, Popp A 2024 Solving forward and inverse problems of contact mechanics using physics-informed neural networks Adv. Model. Simul. Eng. Sci. 11 11

DOI

12
Lin S, Chen Y 2022 A two-stage physics-informed neural network method based on conserved quantities and applications in localized wave solutions J. Comput. Phys. 457 111053

DOI

13
Jagtap A D, Kharazmi E, Karniadakis G E 2020 Conservative physics-informed neural networks on discrete domains for conservation laws: Applications to forward and inverse problems Comput. Methods Appl. Mech. Eng. 365 113028

DOI

14
Gao B, Yao R, Li Y 2025 Physics-informed neural networks with adaptive loss weighting algorithm for solving partial differential equations Comput. Math. Appl. 181 216 227

DOI

15
Pu J C, Chen Y 2022 Data-driven vector localized waves and parameters discovery for Manakov system using deep learning approach Chaos Solitons Fract. 160 112182

DOI

16
Pu J C, Chen Y 2024 Lax pairs informed neural networks solving integrable systems J. Comput. Phys. 510 113090

DOI

17
Wei C, Fan Y, Wong J C, Ooi C C, Wang H, Chiu P-H 2025 FFV-PINN: A fast physics-informed neural network with simplified finite volume discretization and residual correction Comput. Methods Appl. Mech. Eng. 444 118139

DOI

18
Wang Y, Chen J, Li B 2025 Solving nonlinear Schrödinger equations and parameter discovery via extended mixed-training physics-informed neural networks Acta Phys. Sin. 74 160201 160201

DOI

19
Jagtap A D, Karniadakis G E 2020 Extended physics-informed neural networks (XPINNs): a generalized space-time domain decomposition based deep learning framework for nonlinear partial differential equations Commun. Comput. Phys. 28 2002 2041

DOI

20
Song J, Cao W, Liao F, Zhang W 2025 VW-PINNs: A volume weighting method for PDE residuals in physics-informed neural networks Acta Mech. Sin. 41 324140

DOI

21
Chen Y, Lu L, Karniadakis G E, Dal Negro L 2020 Physics-informed neural networks for inverse problems in nano-optics and metamaterials Opt. Express 28 11618 11633

DOI

22
Serkin L, Belyaeva T L 2025 Physics-informed neural networks for higher-order nonlinear Schrödinger equations: soliton dynamics in external potentials Mathematics 13 1882

DOI

23
Lin Z, Chen Y 2025 PE-RWP: A deep learning framework for polynomial feature extraction of rogue wave patterns and peregrine waves localization J. Comput. Phys. 539 114243

DOI

24
Qin S M, Li M, Xu T, Dong S Q 2023 A-WPINN algorithm for the data-driven vector-soliton solutions and parameter discovery of general coupled nonlinear equations Physica D 443 133562

DOI

25
Miao Z W, Chen Y 2022 Physics-informed neural networks method in high-dimensional integrable systems Mod. Phys. Lett. B 36 2150531

DOI

26
Blechschmidt J, Ernst O G 2021 Three ways to solve partial differential equations with neural networks: A review Gamm-Mitteilungen 44 e202100006

DOI

27
Saqlain S, Zhu W, Charalampidis E G, Kevrekidis P G 2023 Discovering governing equations in discrete systems using PINNs Commun. Nonlinear Sci. Numer. Simul. 126 107498

DOI

28
Molkenthin N, Hu S, Niemi A J 2011 Discrete nonlinear Schrödinger equation and polygonal solitons with applications to collapsed proteins Phys. Rev. Lett. 106 078102

DOI

29
Lin Z, Chen Y 2024 Pseudo grid-based physics-informed convolutional-recurrent network solving the integrable nonlinear lattice equations Physica D 468 134304

DOI

30
Zhou J C, Wen X Y, Guo M J 2025 Symmetric difference data enhancement physics-informed neural network for solving discrete nonlinear lattice equations Commun. Theor. Phys. 77 065002

DOI

31
Zhou J C, Wen X Y, Zhou P, Wei M C 2025 Prediction of discrete rogue wave solutions and model parameters of Ablowitz-Ladik equation via symmetric difference data enhancement physics-informed neural networks Commun. Nonlinear Sci. Numer. Simul. 151 109046

DOI

32
Surulere S A, Mkolesia A C, Shatalov M Y, Fedotov I 2018 An investigation of vibrations of linearly growing discrete chain of atoms in nano-structures Int. J. Appl. Eng. Res. 13 13596 14102 (available at: https://www.researchgate.net/profile/Andrew-Mkolesia/publication/328006336_An_Investigation_of_Vibrations_of_Linearly_Growing_Discrete_Chain_of_Atoms_in_Nano-structures/links/5bb25e4945851574f7f420a5/An-Investigation-of-Vibrations-of-Linearly-Growing-Discrete-Chain-of-Atoms-in-Nano-structures.pdf)

33
Xiao L, Shi G, Song W 2024 Machine learning predictions on the compressive stress strain response of lattice-based metamaterials Int. J. Solids Struct. 300 112893

DOI

34
Jiang X, Wang D, Chen X, Zhang M 2022 Physics-informed neural network for optical fiber parameter estimation from the nonlinear Schrödinger equation J. Lightwave Technol. 40 7095 7105

DOI

35
Ablowitz M J, Clarkson P A 1991 Solitons, Nonlinear Evolution Equations and Inverse Scattering Cambridge University Press

36
Olver P J 1993 Applications of Lie Groups to Differential Equations Springer

37
Lin Z, Wen X Y, Qin M L 2021 Various soliton solutions and asymptotic state analysis for the discrete modified Korteweg-de Vries equation Adv. Math. Phys. 2021 3445894

DOI

38
Gaillard P 2021 The mKdV equation and multi-parameters rational solutions Wave Motion 100 102667

DOI

39
Wu C X, Zhu M, tan Q Y, Kartha Y, Lu L 2023 A comprehensive study of non-adaptive and residual-based adaptive sampling for physics-informed neural networks Comput. Methods Appl. Mech. Eng. 403 115671

DOI

Outlines

/