Figures
Abstract
This paper introduces a novel approach using physics-informed neural networks (PINNs) to simultaneously solve variable-order time fractional diffusion equations and infer the time-dependent fractional order from data. By embedding the governing equations into the neural network’s loss function, our method achieves high accuracy and flexibility, even with sparse or noisy data. We present a dual-network architecture where one network approximates the solution u(x,t) while another learns the fractional order . Numerical experiments demonstrate the effectiveness of our approach, achieving mean squared errors below 10−4 for solutions and 10−3 for fractional orders in smooth cases, while also handling noisy data and non-smooth orders robustly.
Citation: Ren L, Jin S (2026) Learning variable-order time fractional diffusion equations using Physics-Informed Neural Networks. PLoS One 21(6): e0352016. https://doi.org/10.1371/journal.pone.0352016
Editor: António M. Lopes, University of Porto Faculty of Engineering: Universidade do Porto Faculdade de Engenharia, PORTUGAL
Received: November 2, 2025; Accepted: June 4, 2026; Published: June 23, 2026
Copyright: © 2026 Ren, Jin. This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.
Data Availability: All relevant data are within the manuscript.
Funding: Financial support was provided by the Key Scientific Research Projects of Colleges and Universities in Henan Province (No. 24A110009), part by National Natural Science Foundation of China (No. 12102241). The funders had same role in study design, data collection and analysis, decision to publish, preparation of the manuscript.
Competing interests: The authors have declared that no competing interests exist.
Introduction
Time fractional order diffusion equations generalize the classical diffusion equation by incorporating fractional-order derivatives, enabling the modeling of anomalous diffusion processes where the mean squared displacement does not scale linearly with time. These equations are critical in fields such as physics, biology, and material science, where systems exhibit memory effects or non-local behavior [1–4]. For instance, they can describe how signals propagate in neural networks or how particles move through porous media. Variable-order fractional derivatives, where the order varies with time or space, offer enhanced flexibility for modeling complex systems with evolving diffusion characteristics. However, solving these equations is computationally challenging due to the non-local nature of fractional derivatives and the need for specialized discretization schemes. Traditional numerical methods, such as finite difference or spectral methods, often require significant computational resources and assume the fractional order is known a priori.
Physics-informed neural networks (PINNs) have emerged as a powerful alternative for solving partial differential equations (PDEs) by embedding physical laws into the neural network training process. PINNs have been successfully applied to fractional PDEs, demonstrating high accuracy and efficiency even with limited data [5]. Recent studies have extended PINNs to handle fractional derivatives, including variable-order cases, and to solve inverse problems where unknown parameters are inferred from data [6]. While prior works like [7] apply PINNs to time-fractional Black-Scholes equations in finance and [8] to space-fractional advection-diffusion, our method is the first to tackle inverse problems in variable-order time fractional diffusion equations, with improvements for non-smooth and noisy scenarios.
A key challenge in many applications is that the fractional order is not known beforehand and may need to be estimated from experimental or observational data. This paper proposes an innovative approach that uses PINNs to simultaneously solve variable-order time fractional diffusion equations and learn the time-dependent fractional order from data. This data-driven method addresses a critical gap in existing numerical techniques, offering a flexible and efficient solution for modeling complex diffusion processes.
The paper is organized as follows: Section 2 reviews the literature on time fractional diffusion equations and PINNs, highlighting recent advancements and gaps. Section 3 presents the mathematical formulation of variable-order time fractional diffusion equations and the proposed PINN framework. Section 4 details the methodology, including the neural network architecture and training process. Section 5 presents numerical experiments to validate the approach, and Section 6 discusses the findings and future research directions.
Literature review
The study of time fractional diffusion equations and their numerical solutions has garnered significant attention due to their ability to model anomalous diffusion processes in complex systems. This section provides a comprehensive review of the theoretical foundations, numerical methods, and recent advancements in physics-informed neural networks (PINNs) for fractional partial differential equations (PDEs), with a focus on variable-order derivatives and inverse problems.
Time fractional diffusion equations
Time fractional diffusion equations extend the classical diffusion equation by incorporating fractional-order derivatives, typically defined using the Caputo fractional derivative for a function u(t) [9]:
where and
is the Gamma function. The standard time fractional diffusion equation is given by:
where k is the diffusion coefficient and f(x,t) is a source term. This equation models subdiffusion () or standard diffusion (
), capturing phenomena where the mean squared displacement scales as
rather than linearly with time. Applications include modeling heat transfer in fractal media, tracer diffusion in porous materials, and signal propagation in biological systems [1].
Variable-order fractional derivatives introduce additional complexity, where the order varies with time:
This formulation is particularly useful for systems with time-varying diffusion properties, such as viscoelastic materials, biological tissues, or financial markets with dynamic volatility [2]. For instance, in biological systems, the fractional order may change due to evolving tissue properties during disease progression or drug delivery, making variable-order models highly relevant.
Traditional numerical methods for solving time fractional diffusion equations include finite difference methods, finite element methods, and spectral methods. Early approaches, such as the L1 approximation, discretize the Caputo derivative but suffer from high computational costs (O(n2)) due to the non-local nature of fractional operators [10]. Recent advancements have improved efficiency. For example, Zhang et al. [11] developed a fast second-order method for variable-order Caputo fractional sub-diffusion equations using the formula and exponential-sum approximation, reducing the complexity to
. Similarly, Qiao et al. [12] proposed an L1-2 formula on graded meshes to handle singularities at the initial time, though stability analysis remains challenging for variable-order cases. Despite these advances, traditional methods often assume a known fractional order, limiting their applicability in scenarios where
must be inferred from data.
Physics-informed neural networks
Physics-informed neural networks (PINNs), introduced by Raissi et al. [5], represent a paradigm shift in solving PDEs by embedding the governing equations into the loss function of a neural network. Unlike traditional methods that rely on grid-based discretization, PINNs use automatic differentiation to compute derivatives and enforce PDE constraints at collocation points, enabling solutions with high accuracy even with sparse data. PINNs have been successfully applied to a wide range of PDEs, including Navier-Stokes, Schrödinger, and Allen-Cahn equations [13]. PINNs have been successfully applied to various PDEs beyond those in the original work [5], such as the Navier-Stokes equations for fluid dynamics [14].
For fractional PDEs, Pang et al. [6] introduced fractional PINNs (fPINNs), which extend the PINN framework to handle fractional derivatives. Their work demonstrated the ability to solve space-time fractional advection-diffusion equations with high accuracy in multidimensional settings. The key advantage of fPINNs is their ability to handle non-local operators without explicit discretization, leveraging neural networks to approximate solutions over continuous domains. Subsequent studies have built on this framework, applying PINNs to time fractional diffusion equations and other fractional models in physics and finance [7]. Building on fPINNs [6], our approach adapts the framework for time-dependent orders, addressing limitations in handling dynamic .”
Recent advancements have focused on variable-order fractional equations. For example, Wang et al. [8] proposed a PINN algorithm for variable-order space-fractional advection-diffusion equations, using a dual-network architecture to estimate both the solution and the fractional order. Their approach achieved robust performance in two-dimensional problems, highlighting the potential of PINNs for inverse problems. Similarly, Nuugulu et al. [7] applied PINNs to time fractional Black-Scholes equations, demonstrating that the fractional order could be learned alongside the solution, even with noisy data. These studies underscore the versatility of PINNs in handling complex fractional PDEs.
Learning fractional order from data
The identification of fractional orders from data is a critical challenge in many applications, as the order often reflects underlying physical properties that are not directly measurable. In epidemiological modeling, Kharazmi et al. [3] used PINNs to identify time-dependent fractional orders in fractional SIR models, showing that PINNs can capture dynamic disease transmission rates. In financial modeling, variable-order fractional Black-Scholes equations have been used to model time-varying market behaviors, with PINNs successfully inferring the fractional order from historical data [7]. These studies demonstrate the power of PINNs for inverse problems, where data-driven learning complements physical constraints.
Other approaches to learning fractional orders include Bayesian methods and optimization-based techniques, but these often require extensive computational resources or prior knowledge of the order’s functional form [4]. PINNs, by contrast, offer a more flexible framework, as they do not require explicit assumptions about and can handle sparse or noisy datasets. However, challenges remain, such as ensuring identifiability of the fractional order and managing the computational cost of training neural networks for complex inverse problems.
Gaps and opportunities
Despite significant progress, several gaps remain in the literature. Traditional numerical methods, while efficient for fixed-order fractional PDEs, struggle with variable-order derivatives due to their non-local and time-dependent nature. Methods like those in [11] improve computational efficiency but are not designed for inverse problems where the fractional order is unknown. PINNs offer a promising alternative, but their application to variable-order time fractional diffusion equations with unknown orders is relatively underexplored. Existing studies, such as [8] for space-fractional cases and [7] for financial models, leave a gap in time-fractional diffusion with unknown time-dependent orders. Our work fills this by introducing adaptive regularization and testing on non-smooth orders, relevant to applications like evolving biological tissues [2].
Moreover, the integration of PINNs with real-world datasets remains limited. Most studies rely on synthetic data, which may not capture the noise and variability of experimental measurements. Developing robust PINN frameworks that can handle real-world data, such as MRI measurements in biological tissues or sensor data in environmental systems, is a critical opportunity. Additionally, the computational cost of training PINNs for high-dimensional problems or complex functions needs further optimization to compete with traditional methods in large-scale applications [15].
This paper addresses these gaps by proposing a PINN-based approach that simultaneously solves variable-order time fractional diffusion equations and learns the time-dependent fractional order . By combining the strengths of PINNs with a data-driven framework, this approach aims to enhance the flexibility and practicality of modeling anomalous diffusion in scientific and engineering contexts.
Methodology
This section details the proposed methodology for solving variable-order time fractional diffusion equations and learning the fractional order using physics-informed neural networks (PINNs). The approach leverages a dual-network architecture to approximate both the solution u(x,t) and the fractional order
, integrating physical constraints and data-driven learning to achieve high accuracy and flexibility.
Network architecture justification
We employ a dual-network architecture where:
approximates the solution u(x,t) with inputs (x,t)
approximates the fractional order
with input t
Rationale for Dual Networks: We compared this approach with a single-network architecture that simultaneously outputs both u(x,t) and . The dual-network approach demonstrated:
- 25% faster convergence in training
- Better generalization with sparse data
- Improved stability in fractional order estimation
- Reduced interference between solution and parameter learning tasks
The separation allows each network to specialize: captures spatial-temporal patterns while
focuses on temporal variations of the fractional order, leading to more robust inverse problem solutions. These benefits were observed in preliminary tests across various fractional orders, including the examples presented here (e.g., Examples 1–4 show stable estimation).
Mathematical formulation
Consider the variable-order time fractional diffusion equation in one spatial dimension:
defined on the domain 0 < x < L, 0 < t < T, with initial condition u(x,0) = u0(x) and Dirichlet boundary conditions u(0,t) = g0(t), . Here, k > 0 is the diffusion coefficient, f(x,t) is a source term, and
is the variable-order Caputo fractional derivative. The variable-order formulation allows the equation to model systems with evolving diffusion properties, such as subdiffusion processes in heterogeneous media.
The goal is to solve for u(x,t) and learn from a dataset of observations
, which may be sparse or noisy. The PINN framework achieves this by embedding the PDE, initial conditions, boundary conditions, and data constraints into the training process of two neural networks. Non-uniqueness in
inference can arise from ill-posedness; we mitigate via regularization (e.g., bounded
) and multiple initializations, observing consistent convergence in 95% of runs.
Compared to [7,8], our dual-network includes a time-specific regularization term adjusted adaptively, enhancing robustness for time-varying orders in diffusion equations.
Physics-informed neural networks with learnable fractional order
The proposed PINN framework consists of two neural networks: 1. , parameterized by
, which approximates the solution u(x,t). The input is (x,t), and the output is the predicted solution at that point. We use a fully connected network with 4 hidden layers and 50 neurons per layer, activated by tanh. 2.
, parameterized by
, which approximates the fractional order
. The input is t, and the output is the predicted fractional order, constrained to (0,1] using a sigmoid activation function in the final layer (similar architecture, 3 layers, 20 neurons).
The networks are trained by minimizing a composite loss function that enforces the PDE, initial and boundary conditions, and data fidelity. The loss function comprises four components. Measures the discrepancy between the predicted solution and the observed data points
:
where is the number of data points. It ensures that the predicted solution satisfies the PDE at a set of collocation points
:
where is the number of collocation points. The variable-order fractional derivative
is computed using automatic differentiation for
and numerical quadrature (e.g., trapezoidal rule with 100 points) for the integral, with
provided by the order network. It enforces the initial condition at points
:
where is the number of initial condition points. It enforces the boundary conditions at points
:
where is the number of boundary condition points.
The total loss is a weighted sum of these components:
where are hyperparameters that balance the contributions of each term. The weights are chosen to ensure that no single term dominates the optimization process, typically set empirically or through adaptive weighting strategies [16] (here, we use
,
).
The optimization problem is to find the parameters and
that minimize
:
This is solved using gradient-based optimization, such as the Adam optimizer with learning rate 0.001, implemented in PyTorch, for 10,000–20,000 epochs. A regularization term (approximated via finite differences,
) is added to promote smoothness in
where appropriate.
Numerical integration and error analysis
The variable-order fractional derivative computation employs numerical quadrature:
We conducted convergence analysis comparing trapezoidal rule (current), Simpson’s rule, and Gaussian quadrature with points (see Table 1):
Numerical experiments
To validate the proposed PINN approach for solving variable-order time fractional diffusion equations and learning the fractional order , we present four numerical experiments. These experiments test the method’s accuracy, robustness, and ability to handle both known and unknown fractional orders, as well as varying levels of data availability and noise. Simulations were run on synthetic data generated via finite difference methods, using PyTorch on a standard GPU. These examples are chosen to address open challenges in literature, such as non-smooth orders in physical diffusion (inspired by viscoelastic materials [2]), differing from financial applications in [7]. Results show mean squared errors (MSE) for u(x,t) below 10−4 and for
below 10−3 in smooth cases, confirming the abstract’s claims.
Hyperparameter tuning and sensitivity analysis
We systematically investigated the impact of loss weights on solution accuracy. The loss function in our PINN framework is composed of several terms: data loss (), PDE residual loss (
), initial condition loss (
), and boundary condition loss (
). These are weighted as
. To identify optimal weights, we tested various configurations on a representative smooth case (e.g., Example 1 with
). The analysis was conducted prior to the main experiments to establish baseline parameters, which were then applied consistently across all cases unless specified otherwise.
The hyperparameter combinations were selected based on common practices in PINN literature, such as moderate weighting of constraints to balance data fidelity and physics enforcement (e.g., weights in the range 1–20, as in [3,4]). We focused on configurations that maintain computational efficiency, with training times under 10 minutes per run on a standard GPU (e.g., NVIDIA RTX 3070). The adaptive weighting strategy [15] was employed in experiments with noisy data (e.g., Examples 3 and 4) and non-smooth to dynamically adjust weights, enhancing robustness.
Results are summarized in Table 2.
Experiments
In this section, the equation and appropriate boundary/initial conditions is chosen as it represents a canonical model for anomalous diffusion, allowing direct comparison with analytical solutions in smooth cases (Examples 1 and 2) and testing robustness in non-smooth scenarios (Example 3). This form balances computational tractability with real-world relevance, such as in porous media or biological transport [1,2], while enabling evaluation of the PINN’s ability to infer time-dependent without prior assumptions. The following example tests the PINN’s ability to solve the variable-order time fractional diffusion equation when the fractional order is known, providing a baseline for the method’s accuracy.
Example 1: Consider the one-dimensional variable-order time fractional diffusion equation:
with , initial condition
, and boundary conditions u(0,t) = u(1,t) = 0. The diffusion coefficient is k = 1, and the source term is f(x,t) = 0. A reference solution uref(x,t) is generated using a high-accuracy finite difference method (e.g., the
scheme from [11]). The PINN is trained with
fixed to the known
, using
data points sampled randomly from the reference solution,
collocation points,
initial condition points, and
boundary condition points. The training is performed for 10,000 epochs with the Adam optimizer.
The MSE for is
. In Fig 1, the results are visualized in a plot comparing the PINN solution
with the reference solution at t = 0.5. In Fig 2, the absolute error
is below 10−3.
The following example evaluates the PINN’s ability to learn both the solution u(x,t) and the fractional order from data, testing its performance in an inverse problem setting.
Example 2: The same PDE as in Example 1 is used, but is not provided to the PINN. Instead, synthetic data is generated from the reference solution, with
data points sampled randomly from
. The PINN simultaneously learns
and
, using the same number of collocation, initial, and boundary points as in Experiment 1. A regularization term with
is included to promote smoothness in
.
The MSE for is
, and for
is
. In Fig 3, a plot shows the true
versus the learned
over
. In Fig 4, the absolute error
below 10−2. A separate figure compares the PINN solution
with the reference solution at t = 0.5, similar to Example 1.
The following example tests the robustness of the PINN approach to noisy data, simulating real-world scenarios where measurements are imperfect.
Example 3: The same PDE and true are used. Synthetic data is generated with Gaussian noise (
) added to the reference solution, with
noisy data points. The PINN is trained to learn both
and
, using the same collocation and boundary point counts as before. The regularization parameter is increased to
to mitigate the impact of noise on
.
The MSE for is
, and for
is
. In Fig 5, a plot showing the PINN solution at t = 0.5 with noisy data; the alpha comparison is similar to Fig 3 compares the learned and true
, with an additional subplot showing the noisy data points overlaid on the PINN solution at t = 0.5.
This example tests the PINN’s ability to learn a non-smooth fractional order, simulating scenarios where the diffusion properties change abruptly.
Example 4: The PDE is the same, but the fractional order is a piecewise linear function:
This function has a discontinuity in its derivative at t = 0.5. Synthetic data is generated with points to provide sufficient information for learning the non-smooth
. The PINN is trained with the same parameters as in Experiment 2, but the regularization parameter is reduced to
to allow for sharper changes in
.
The MSE for is
(higher near t = 0.5), and for
is
. In Fig 6, a plot shows the true
versus the learned
. In Fig 7, the absolute error highlighting increased error near the discontinuity at t = 0.5.
Example 5: To demonstrate applicability to biological systems, we consider a drug diffusion model in heterogeneous tissue, where the fractional order varies due to tissue remodeling or inflammation, inspired by models in [2]. The PDE remains the same as previous examples, but with
, simulating a smooth transition in diffusion properties (e.g., from normal to inflamed tissue). Synthetic data is generated with
points, including mild Gaussian noise (
) to mimic experimental measurements.
The PINN is trained using the adaptive weighting strategy, with regularization . The MSE for
is
, and for
is
. Fig 8 shows the comparison of the learned and true fractional orders, along with the absolute error in Fig 9.
Additionally, Fig 10 illustrates the PINN solution at selected time points, compared to the reference solution, highlighting the method’s accuracy in capturing diffusion dynamics in varying tissue conditions.
Systematic noise analysis
This comparison evaluates the PINN approach against traditional finite difference methods (e.g., L1 scheme [6]) to demonstrate superior flexibility in handling variable orders without explicit discretization. Comparisons are based on Example 1 (smooth ) unless noted, as it represents a baseline case with known analytical solution. We conducted comprehensive noise robustness tests (see Table 3):
Comparison with traditional methods
Noise analysis tests real-world applicability, as experimental data often includes measurement errors, addressing a gap in synthetic-data-focused studies [10]. We benchmarked our PINN approach against established numerical methods [19] (see Table 4):
Empirical convergence analysis
Sensitivity to data sparsity justifies the method’s efficiency for sparse datasets, relevant for applications like biological imaging where data collection is costly. We conducted systematic convergence studies by varying network capacity (see Table 5):
The architecture provides the best accuracy-efficiency trade-off, with diminishing returns beyond this capacity.
Conclusion
This paper presents a novel application of physics-informed neural networks to solve variable-order time fractional diffusion equations while simultaneously learning the time-dependent fractional order from data. By combining physical laws with data-driven learning, the approach offers a flexible and efficient tool for modeling complex diffusion processes with unknown or varying fractional orders. Experiments achieved MSE <10−4 for u(x,t) and <10−3 for in smooth cases, with robust performance under 5% noise. These results bridge the gap in time-fractional variable-order models, outperforming traditional methods in inverse problems and noisy data scenarios. Numerical experiments demonstrate high accuracy and robustness to noise and non-smoothness. Our contributions advance PINN methods by focusing on time-fractional diffusion inverse problems, with novel handling of non-smoothness, bridging gaps in physical modeling not covered in prior space or finance-oriented works. Limitations include higher computational cost for large domains and potential non-uniqueness in inverse problems; future work could explore adaptive quadrature or hybrid methods for efficiency.
Acknowledgments
The authors would like to thank the editor and the reviewers for their valuable comments and suggestions to improve the results of this paper.
References
- 1. Metzler R, Klafter J. The random walk’s guide to anomalous diffusion: a fractional dynamics approach. Physics Reports. 2000;339(1):1–77.
- 2. Sun H, Zhang Y, Baleanu D, Chen W, Chen Y. A new collection of real world applications of fractional calculus in science and engineering. Communications in Nonlinear Science and Numerical Simulation. 2018;64:213–31.
- 3. Kharazmi E, Cai M, Zheng X, Zhang Z, Lin G, Karniadakis GE. Identifiability and predictability of integer- and fractional-order epidemiological models using physics-informed neural networks. Nat Comput Sci. 2021;1(11):744–53. pmid:38217142
- 4. Jiang L, Ou N. Bayesian Inference Using Intermediate Distribution Based on Coarse Multiscale Model for Time Fractional Diffusion Equations. Multiscale Model Simul. 2018;16(1):327–55.
- 5. Raissi M, Perdikaris P, Karniadakis GE. Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations. Journal of Computational Physics. 2019;378:686–707.
- 6. Pang G, Lu L, Karniadakis GE. fPINNs: Fractional Physics-Informed Neural Networks. SIAM J Sci Comput. 2019;41(4):A2603–26.
- 7. Nuugulu SM, Patidar KC, Tarla DT. A Physics informed neural network approach for solving time fractional Black-Scholes partial differential equations. Optim Eng. 2024;26(4):2419–48.
- 8. Wang S, Zhang H, Jiang X. Physics-informed neural network algorithm for solving forward and inverse problems of variable-order space-fractional advection–diffusion equations. Neurocomputing. 2023;535:64–82.
- 9. Caputo M. Linear Models of Dissipation whose Q is almost Frequency Independent--II. Geophysical Journal International. 1967;13(5):529–39.
- 10. Lin Y, Xu C. Finite difference/spectral approximations for the time-fractional diffusion equation. Journal of Computational Physics. 2007;225(2):1533–52.
- 11. Zhang J li, Pang Z wei, Sun H wei. Fast second-order evaluation for variable-order Caputo fractional sub-diffusion equations. Numerical Mathematics: Theory, Methods and Applications. 2022;15(1):200–26.
- 12. Qiao H, Cheng A. A fast high order method for time fractional diffusion equation with non-smooth data. DCDS-B. 2022;27(2):903.
- 13. Ji W, Qiu W, Shi Z, Pan S, Deng S. Stiff-PINN: Physics-Informed Neural Network for Stiff Chemical Kinetics. J Phys Chem A. 2021;125(36):8098–106. pmid:34463510
- 14. Font B, Weymouth GD, Nguyen V-T, Tutty OR. Deep learning of the spanwise-averaged Navier–Stokes equations. Journal of Computational Physics. 2021;434:110199.
- 15. Cuomo S, Di Cola VS, Giampaolo F, Rozza G, Raissi M, Piccialli F. Scientific Machine Learning Through Physics–Informed Neural Networks: Where we are and What’s Next. J Sci Comput. 2022;92(3).
- 16. Wang S, Teng Y, Perdikaris P. Understanding and Mitigating Gradient Flow Pathologies in Physics-Informed Neural Networks. SIAM J Sci Comput. 2021;43(5):A3055–81.
- 17. Huber PJ. Robust Estimation of a Location Parameter. Ann Math Statist. 1964;35(1):73–101.
- 18.
Hastie T, Tibshirani R, Friedman J. The Elements of Statistical Learning: Data Mining, Inference, and Prediction. Springer, New York, 2 edition, 2009.
- 19. Samko SG, Ross B. Integration and differentiation to a variable fractional order. Integral Transforms and Special Functions. 1993;1(4):277–300.