Skip to content

Allen-Cahn 1D – Wight & Zhao

Example
Source PINNStudio template
Problem Forward and Inverse
Dimension 1D (x, t)
Regime Time-dependent
Geometry Interval
Outputs u
Settings Default, Tuned
Animated plots of the inferred parameters gamma_1 and gamma_2 against the training iteration
Animation from the repository's figures (`assets/Images/1D-AllenCahn/`): this example in Inverse mode, the two coefficients gamma_1 and gamma_2 during training, with their true values as dashed lines.

Governing equations

Mathematical form (from the benchmark records):

\[\frac{\partial u}{\partial t} = \gamma_1\frac{\partial^2 u}{\partial x^2} - \gamma_2 u^3 + \gamma_2 u, \qquad x \in [-1, 1],\ t \in [0, 1]\]

Where \(\gamma_1 = 0.0001\) and \(\gamma_2 = 5\).

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

du_t - 0.0001*du_xx + 5*u**3 - 5*u

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

du_t - gamma_1*du_xx + gamma_2*u**3 - gamma_2*u

Domain

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

Initial conditions

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

Boundary conditions

Type Where Output Value Details
Periodic BC left u — axis x, derivative order 0

Unknowns and measured data (Inverse)

Trainable parameter Initial value True value
gamma_1 1 0.0001
gamma_2 1 5

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

From the benchmark records: same template, switched to Inverse, jointly recovering both \(\gamma_1\) (diffusion) and \(\gamma_2\) (reaction) as unknown parameters.

Settings

Forward mode

Settings: Default — the paper's method (Wight & Zhao 2021)

  • Network: FNN, hidden layers 4 × 128, inputs (x, t), 1 output; activation tanh, initializer Glorot uniform
  • Points: 2,000 domain, 200 boundary, 200 initial, 1,000 test
  • Loss weights: 1.0,1.0,100.0 (equations, then boundary-condition rows, then initial conditions)
  • Methods: residual-based adaptive refinement (RAR, 6 rounds of 200 points)
Phase Optimizer Iterations Learning rate Decay
1 Adam 20,000 0.001 none
2 L-BFGS 10,000 — none
Settings: Tuned

The Training Log reports: Tuned settings: a larger network (hidden layers twice as wide, one more layer). The change is applied to the template's own settings (not the paper's method that Default loads).

Phase Optimizer Iterations Learning rate Decay
1 Adam 20,000 0.001 none
2 L-BFGS 10,000 — none

Inverse mode

Settings: Default — the template's own settings

Phase Optimizer Iterations Learning rate Decay
1 Adam 20,000 0.001 none
2 L-BFGS 10,000 — 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: Tuned — Larger network (2× width, one more layer). Values: median over seeds 2026, 1, 2.

Output Relative L₂
u 7.0 × 10⁻⁴
Forward result: PINN, reference and error
Forward, Tuned settings: PINN, reference and error.

Inverse problem

Settings: Default — the example's own settings (no change did better); the example has no separate Tuned preset for this mode. Values: median over seeds 2026, 1, 2.

Parameter True value Recovered Relative error
gamma_1 0.0001 9.9233e-05 0.77 %
gamma_2 5 4.99768 0.046 %

Worst parameter error: 0.77 % (the median over the seeds of each seed's largest error).

Inverse result: PINN, reference and error
Inverse, Default settings: PINN, reference and error.
Inverse result: parameter convergence
Inverse, Default 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

  • Forward: toolbar Examples: › Forward › under the ── 1D ── heading, Allen-Cahn 1D – Wight & Zhao › Default or Tuned, then Solve.
  • Inverse: toolbar Examples: › Inverse › under the ── 1D ── heading, Allen-Cahn 1D – Wight & Zhao › 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

Notes

  • The time-adaptive version of this template is not listed in the Examples list; it still loads by its name from saved problems (HIDDEN_TEMPLATES in example_catalog.py).

Definition and records

How the benchmark values were measured and checked: Reproducibility.

← Back to the example gallery