Skip to content

Diffusion 1D – hard IC and BCs

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

Governing equations

Mathematical form (from the benchmark records):

\[\frac{\partial u}{\partial t} = \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 - 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) not used as a loss term

Boundary conditions

No boundary-condition rows: the boundary values are imposed exactly through the network's output transform (see Methods below), or the problem has no boundary terms.

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, 0 boundary, 0 initial, 10,000 test
  • Loss weights: 1 (equations, then boundary-condition rows, then initial conditions)
  • Methods: output transform t*(1 - x**2)*u + sin(pi*x) (reference)
Phase Optimizer Iterations Learning rate Decay
1 Adam 10,000 0.001 none

No separate Tuned preset: the Tuned item is greyed out for this example (its Default settings are PINNStudio's best).

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).

Forward problem

Settings: Default — the example's own settings (not in the tuning sweep); the example has no separate Tuned preset for this mode. Values: one run, seed 2026.

Output Relative L₂
u 2.8 × 10⁻³
Forward result: PINN, reference and error
Forward, Default settings: PINN, reference and error.

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

Loading it in PINNStudio

  • Forward: toolbar Examples: › Forward › under the ── 1D ── heading, Diffusion 1D – hard IC and BCs › Default, 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)

Definition and records

How the benchmark values were measured and checked: Reproducibility.

← Back to the example gallery