Skip to content

Helmholtz 2D – Dirichlet

Example
Source DeepXDE example
Problem Forward and Inverse (the Inverse mode is PINNStudio's addition)
Dimension 2D (x, y)
Regime Steady
Geometry Rectangle
Outputs u
Settings Default, Tuned

Governing equations

Mathematical form (from the benchmark records):

\[-\nabla^2 u - k_0^2 u = k_0^2\sin(k_0 x)\sin(k_0 y), \qquad k_0 = 4\pi,\ (x, y) \in [0, 1]^2\]

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

-du_xx - du_yy - k0**2*u - k0**2*sin(k0*x)*sin(k0*y)

Constants: n = 2, k0 = 2*pi*n

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

-du_xx - du_yy - k0**2*u - (4*pi)**2*sin(4*pi*x)*sin(4*pi*y)

Domain

  • Rectangle: \(x \in [0, 1]\), \(y \in [0, 1]\)

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.

Unknowns and measured data (Inverse)

Trainable parameter Initial value True value
k0 10 12.5664

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

Settings

Forward mode

Settings: Default — DeepXDE's own settings

  • Network: FNN, hidden layers 3 × 150, inputs (x, y), 1 output; activation sin, initializer Glorot uniform
  • Points: 400 domain, 80 boundary, 3,600 test
  • Loss weights: 1 (equations, then boundary-condition rows)
  • Methods: output transform x*(1 - x)*y*(1 - y)*u (reference)
Phase Optimizer Iterations Learning rate Decay
1 Adam 5,000 0.001 none

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

Inverse mode

Settings: Default — DeepXDE's settings with PINNStudio's Inverse-mode changes (see Notes)

  • Network: FNN, hidden layers 3 × 150, inputs (x, y), 1 output; activation sin, initializer Glorot uniform
  • Points: 400 domain, 80 boundary, 3,600 test
  • Loss weights: 1 (equations, then boundary-condition rows)
  • Methods: output transform x*(1 - x)*y*(1 - y)*u (reference)
Phase Optimizer Iterations Learning rate Decay
1 Adam 5,000 0.001 none
2 L-BFGS 15,000 — none
Settings: Tuned

The Training Log reports: Tuned settings: 10× the data weight, 3× the L-BFGS iterations and a larger network. The change is applied to the example's own settings.

  • Network: FNN, hidden layers 4 × 300, inputs (x, y), 1 output; activation sin, initializer Glorot uniform
  • Points: 400 domain, 80 boundary, 3,600 test
  • Loss weights: 1 (equations, then boundary-condition rows)
  • Methods: output transform x*(1 - x)*y*(1 - y)*u (reference)
Phase Optimizer Iterations Learning rate Decay
1 Adam 5,000 0.001 none
2 L-BFGS 45,000 — 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).

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: median over seeds 2026, 1, 2.

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

Inverse problem

Settings: Tuned — 10× data weight, 3× L-BFGS and the larger network. Values: median over seeds 2026, 1, 2.

Parameter True value Recovered Relative error
k₀ 12.5664 12.5664 0.00023 %

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

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

  • Forward: toolbar Examples: › Forward › under the ── 2D ── heading, Helmholtz 2D – Dirichlet › Default, then Solve.
  • Inverse: toolbar Examples: › Inverse › under the ── 2D ── heading, Helmholtz 2D – Dirichlet › 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

  • Forward mode: exact solution, Error Analysis › reference from formula: u = sin(k0*x)*sin(k0*y)
  • Inverse mode: exact solution, Error Analysis › reference from formula: u = sin(4*pi*x)*sin(4*pi*y)

Notes

  • Boundary conditions imposed exactly through the output transform (DeepXDE's default hard_constraint=True).
  • Inverse mode (PINNStudio's addition): the wavenumber k0 (4 pi; initial guess 10) is learned from u measured on a 31 x 31 grid (reference_data/deepxde/helmholtz_inverse). The source keeps the true wavenumber (it is the known load), so k0 is unknown only in the k0² u term. An L-BFGS phase follows Adam.

Definition and records

How the benchmark values were measured and checked: Reproducibility.

← Back to the example gallery