The Porous Medium Equation (PME), given by ut=Δ(um) for m>1, is a degenerate nonlinear parabolic partial differential equation that arises in various physical applications such as fluid flow in porous media, heat transfer in plasmas, and population dynamics. It is known for its nonlinear diffusion and finite propagation speed. In this paper, we study numerical solutions of the one-dimensional direct and inverse PME using Physics-Informed Neural Networks (PINNs), and compare them with classical numerical methods and available analytical and manufactured solutions. While PINNs provide a flexible framework for solving both forward and inverse problems, we show that the standard inverse formulation suffers from a strong sensitivity to the initial guess, leading to only local convergence. To address this issue, we propose a novel two-stage PINN training framework for the inverse problem, which significantly improves convergence stability and allows reliable recovery of the unknown parameter even for poor initial guesses. Overall, the proposed approach demonstrates that PINNs are a flexible and accurate alternative to classical methods for the 1D PME, and the introduced two-stage training strategy substantially improves their robustness in inverse problems, providing a solid basis for extensions to more complex geometries and higher-dimensional cases.
Figures & tables
Parameter
Value
Spatial domain
x∈[−1,1] with N=100 intervals ( N+1 grid points)
Time domain
t∈[0,1] with Δt=0.01 ( 100 time steps)
Tolerance (Newton)
10−6
Maximum Newton iterations
20 per time step
Jacobian approximation
Finite differences with perturbation h=10−6
Table 1: Parameters for Direct Classical Method
Figure 1: Schematic of the direct PINN
Component
Specification
Input layer
Size 2 (for t and x )
Hidden layers
4 layers, each with 20 neurons
Activation function
Hyperbolic tangent tanh
Output layer
Single neuron returning uθ(t,x)
Table 2: Architecture of the neural network.
m
PINN vs Exact
Classical vs Exact
PINN vs Classial
2
1.774 ×10−2
2.475 ×10−2
2.591 ×10−2
3
5.378 ×10−4
1.557 ×10−2
1.315 ×10−2
4
3.394 ×10−4
7.232 ×10−3
6.404 ×10−3
5
1.575 ×10−4
3.652 ×10−3
3.322 ×10−3
Table 3: Relative L2 -errors for the Barenblatt Solution
Table 5
Figure 2: visual comparison of Barenblatt numerical solutions for m=3
Figure 3: Zoomed-in view of the exact Barenblatt solution for m=3 for t ∈[0,0.3]
Figure 4: visual comparison of the Polynomial numerical solutions
m
PINN vs Exact
Classical vs Exact
PINN vs Classical
2
1.548 ×10−2
1.012 ×10−2
2.255 ×10−2
3
8.050 ×10−4
1.134 ×10−2
1.127 ×10−2
4
1.255 ×10−3
1.186 ×10−2
1.157 ×10−2
5
1.740 ×10−3
1.215 ×10−2
1.180 ×10−2
Table 6: Relative L2 -errors for the Polynomial solution
Table 10
Figure 5: visual comparison of the Harmonic numerical solutions
m
PINN vs Exact
Classical vs Exact
PINN vs Classical
2
2.081 ×10−5
1.292 ×10−3
1.287 ×10−3
3
2.096 ×10−5
1.449 ×10−3
1.451 ×10−3
4
3.656 ×10−5
1.723 ×10−3
1.722 ×10−3
5
5.156 ×10−5
2.049 ×10−3
1.566 ×10−3
Table 9: Relative L2 -errors for the Damped Harmonic solution
Table 13
Figure 6: visual comparison of the m-dependent numerical solutions
m
PINN vs Exact
Classical vs Exact
PINN vs Classical
2
1.586 ×10−3
2.715 ×10−3
1.636 ×10−3
3
1.651 ×10−2
8.514 ×10−3
1.311 ×10−2
4
7.679 ×10−2
1.437 ×10−2
7.074 ×10−2
5
1.505 ×10−1
1.802 ×10−2
1.420 ×10−1
Table 12: Relative L2 -errors for the m-dependent solution
Table 16
m
PINN relative error
PINN training time
2
1.716 ×10−2
60.74
3
8.214 ×10−4
207.00
4
1.008 ×10−3
193.70
5
1.622 ×10−3
191.69
Table 15: Relative L2 -errors and training time (second) for the direct PINN applied to the polynomial solution using exact data
m
PINN relative error
PINN training time
2
1.109 ×10−3
69.66
3
1.283 ×10−2
71.18
4
6.747 ×10−2
71.32
5
2.284 ×10−1
46.68
Table 16: Relative L2 -errors and training time (second) for the direct PINN applied to the m-dependent solution using exact data
Figure 7: Relative error of the estimated parameter m with respect to different initial guesses. Each color corresponds to a different true value of m . The x-axis represents the initial guess m0 , taken around the true value ( ±50% and 80% perturbations). The y-axis shows the relative error (%). The left plot shows the standard inverse PINN, where the solution is accurate only when the initial guess is close to the true value, while the right plot shows the results after applying the 2-stage training PINN, where the method achieves significantly lower and more stable errors across different initial guesses.
Figure 8: Training Diagram
Parameter
Value
Optimization algorithm
Interior-point (MATLAB default)
Maximum iterations
50
Optimality tolerance
10−6
Lower bound
m=1
Upper bound
m=10
Table 17: fmincon Configuration
Category
Parameter
Value/Description
Training Points ( see Fig 9 )
n_int (interior points)
2048
n_sb (spatial boundary points per side)
256
n_tb (temporal boundary points)
256
n_meas (measurement points)
15x15 = 225
Domain
Time domain
[0, 1]
Space domain
[-1, 1]
Table 18: Configurations and Parameters for Inverse PINN Method
Figure 9: Distribution of Training Points
true m
initial guess
fmincon relative error
PINN relative error
fmincon time
PINN training time
2
0.4
failed
1.74%
2.30
228.70
1
failed
4.67%
0.70
238.43
3
0.28%
1.07%
14.50
229.50
3.6
0.28%
1.71%
19.88
124.91
3
0.6
failed
0.79%
0.76
230.82
1.5
0.37%
0.52%
12.52
238.57
Table 19: Relative error and computational time (seconds) comparison between the classical method and the PINN approach for the Barenblatt solution with different values of m and initial guesses.
Figure 11: Training loss and m evolution for case m=3 with initial guess =4.5
Figure 12: Training loss and m evolution for case m=4 with initial guess =7.5, before and after removing the early stopping function
true m
initial guess
fmincon relative error
PINN relative error
fmincon time
PINN training time
2
0.4
1.10%
0.51%
30.05
360.64
1
1.10%
0.28%
29.46
356.92
3
1.10%
0.15%
16.38
298.42
3.6
1.10%
0.22%
34.53
354.22
3
0.6
0.07%
0.14%
33.93
360.07
1.5
0.07%
0.20%
24.96
362.01
Table 20: Relative error and computational time (seconds) comparison between the classical method and the PINN approach for the polynomial solution with different values of m and initial guesses.
Figure 13: Inverse Polynomial solution plots
true m
initial guess
fmincon relative error
PINN relative error
fmincon time
PINN training time
2
0.4
0.85%
0.94%
5.38
338.86
1
0.85%
1.37%
7.32
338.78
3
0.85%
0.15%
12.32
250.15
3.6
0.85%
0.11%
14.43
341.01
3
0.6
0.70%
0.31%
9.31
352.13
1.5
0.70%
0.33%
7.77
349.41
Table 21: Relative error and computational time (seconds) comparison between the classical method and the inverse PINN approach for the harmonic solution with different values of m and initial guesses.
Figure 14: Inverse Harmonic solution plots
true m
initial guess
fmincon relative error
PINN relative error
fmincon time
PINN training time
2
0.4
0.08%
6.79%
107.29
379.69
1
0.08%
2.83%
110.53
382.94
3
0.08%
49.85%
71.56
266.39
3.6
0.08%
0.15%
55.11
366.76
3
0.6
failed
9.49%
26.84
370.63
1.5
0.27%
29.66%
1248.56
376.23
Table 22: Relative error and computational time (seconds) comparison between the classical method and the PINN approach for the m_dependent solution with different values of m and initial guesses.
Figure 15: Inverse m-dependent solution plots
Figure 16: Training loss and m evolution for case m=2 with initial guess =3, after increasing the epochs and removing the early stopping, for the m-dependent solution
Polynomial Solution
m
Barenblatt
Polynomial
Harmonic
m-dependent
2
0.078
0.087
0.182
0.134
3
0.040
0.053
0.033
0.054
4
0.388
0.529
0.496
0.938
5
0.378
0.524
0.491
1.133
Table 23: Computation time (seconds) for solving the direct problem using MATLAB for different manufactured solutions.
Parameter
Value
Noise model
Additive Gaussian, εi∼N(0,σ2)
Noise levels δ
0%,1%,5%
Standard deviation σ
δ⋅RMS(uPINN)
Perturbed quantity
Measurement dataset only (from direct PINN)
Number of perturbed points
Nmeas=225
Random seed
42
Table 24: Parameters of the data perturbation used in the inverse PINN experiments.
true m
initial guess
recovered m
PINN relative error
PINN training time s
2
0.4
2.00
0.22%
338.66
1.0
2.00
0.01%
285.76
3.0
2.00
0.30%
224.85
3.6
2.00
0.35%
244.06
3
0.6
3.00
0.28%
341.31
1.5
3.00
0.19%
337.40
Table 25: PINN inverse results for the polynomial solution using measurement data generated from the direct PINN with 0% additional noise
true m
initial guess
recovered m
PINN relative error pct
PINN training time s
2
0.4
2.00
0.04%
355.85
1
1.99
0.22%
254.72
3
1.99
0.02%
201.63
3.6
2.00
0.40%
223.58
3
0.6
3.00
0.04%
359.60
1.5
3.00
0.07%
360.32
Table 26: PINN inverse results for the polynomial solution using measurement data generated from the direct PINN with 1% additional noise
Appendix figures & tables40 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 40
Figure 19: Zoomed-in view of the exact Barenblatt solution for m=2 for t ∈[0,0.3]
Figure 42Figure 43
Figure 22: Zoomed-in view of the exact Barenblatt solution for m=3 for t ∈[0,0.3]
Figure 45Figure 46
Figure 25: Zoomed-in view of the exact Barenblatt solution for m=4 for t ∈[0,0.3]
Figure 48Figure 49
Figure 28: Zoomed-in view of the exact Barenblatt solution for m=5 for t ∈[0,0.3]
Department of Physics, American University of Beirut, Lebanon · Department of Mathematics, American University of Beirut, Lebanon · The authors would like to acknowledge
Technical University of Munich, Professorship of Data-driven Materials Modeling, School of Engineering and Design, Boltzmannstr. 15, 85748 Garching, Germany · Munich Data Science Institute (MDSI - Core member), Garching, Germany