Skip to content

Diffusion 1D – unknown coefficient

Example
Source DeepXDE example
Problem Inverse (DeepXDE inverse example)
Dimension 1D (x, t)
Regime Time-dependent
Geometry Interval
Outputs u
Settings Default, Tuned

Governing equations

Mathematical form (from the benchmark records):

\[\frac{\partial u}{\partial t} = C\frac{\partial^2 u}{\partial x^2} - e^{-t}\left(\sin(\pi x) - \pi^2\sin(\pi x)\right), \qquad x \in [-1, 1],\ t \in [0, 1]\]

As typed in PINNStudio's Equations page (each expression is a residual, set to zero):

du_t - C*du_xx + exp(-t)*(sin(pi*x) - pi**2*sin(pi*x))

Domain

  • Interval: \(x \in [-1, 1]\)
  • Time interval: \(t \in [0, 1]\)

Initial conditions

Output Initial value How it is imposed (Settings: Default)
u sin(pi*x) loss term

Boundary conditions

Type Where Output Value Details
Dirichlet BC True (the whole boundary) u 0 —

Unknowns and measured data (Inverse)

Trainable parameter Initial value True value
C 2 1

Measured data (Inverse page, measured-data files):

Settings

Settings: Default — DeepXDE's own settings

  • Network: FNN, hidden layers 3 × 32, inputs (x, t), 1 output; activation tanh, initializer Glorot uniform
  • Points: 40 domain, 20 boundary, 10 initial, 10,000 test
  • Loss weights: 1,1,1 (equations, then boundary-condition rows, then initial conditions)
Phase Optimizer Iterations Learning rate Decay
1 Adam 50,000 0.001 none
Settings: Tuned

The Training Log reports: Tuned settings: 3× the iterations of every training phase. The change is applied to the example's own settings.

  • Network: FNN, hidden layers 3 × 32, inputs (x, t), 1 output; activation tanh, initializer Glorot uniform
  • Points: 40 domain, 20 boundary, 10 initial, 10,000 test
  • Loss weights: 1,1,1 (equations, then boundary-condition rows, then initial conditions)
Phase Optimizer Iterations Learning rate Decay
1 Adam 150,000 0.001 none

Results

The configuration selected in PINNStudio's benchmark study, run on one RTX 4090. Forward: relative L₂ error of each output at the last reference time. Inverse: each parameter's relative error and, per seed, the largest of them (worst parameter error).

Inverse problem

Settings: Tuned — 3× iterations. Values: one run, seed 2026.

Parameter True value Recovered Relative error
C 1 1.00004 0.004 %

Worst parameter error: 0.004 %.

Inverse result: PINN, reference and error
Inverse, Tuned settings: PINN, reference and error.
Inverse result: parameter convergence
Inverse, Tuned settings: parameter convergence.

Full benchmark record: every setting tried, the per-seed values and all figures are in the benchmark records on GitHub.

Loading it in PINNStudio

  • Inverse: toolbar Examples: › Inverse › under the ── 1D ── heading, Diffusion 1D – unknown coefficient › Default or Tuned, then Solve.

Loading an example fills in every setting; anything you change before Solve is listed in the Training Log. Your save folder, GPU, random-seed and plot-style settings are kept.

Reference solution

  • Exact solution, Error Analysis › reference from formula: u = sin(pi*x)*exp(-t)

Notes

  • Unknown diffusion coefficient C (true value 1), measured u at t = 1. DeepXDE's script passes the exact solution sin(pi x) exp(-t) as the boundary value; it is 0 at x = -1 and 1.

Definition and records

How the benchmark values were measured and checked: Reproducibility.

← Back to the example gallery