Skip to content

Helmholtz 2D – square with hole

Example
Source DeepXDE example
Problem Forward
Dimension 2D (x, y)
Regime Steady
Geometry Rectangle − Disk
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 = 2\pi\]

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 = 1, k0 = 2*pi*n, R = 1/4

Domain

  • Custom geometry (Geometry › Custom): Rectangle (x_min = -0.5, x_max = 0.5, y_min = -0.5, y_max = 0.5), minus Disk (cx = 0, cy = 0, r = 0.25)

Boundary conditions

Type Where Output Value Details
Neumann BC np.isclose(x**2 + y**2, R**2) u -(k0*cos(k0*x)*sin(k0*y)*x + k0*sin(k0*x)*cos(k0*y)*y)/R —
Dirichlet BC left or right or bottom or top u sin(k0*x)*sin(k0*y) —

Settings

Settings: Default — DeepXDE's own settings

  • Network: FNN, hidden layers 3 × 350, inputs (x, y), 1 output; activation sin, initializer Glorot uniform
  • Points: 225 domain, 240 boundary, 900 test
  • Loss weights: 1,10,100 (equations, then boundary-condition rows)
Phase Optimizer Iterations Learning rate Decay
1 Adam 5,000 0.001 none
Settings: Tuned

The Training Log reports: Tuned settings: an L-BFGS phase after Adam. The change is applied to the example's own settings.

  • Network: FNN, hidden layers 3 × 350, inputs (x, y), 1 output; activation sin, initializer Glorot uniform
  • Points: 225 domain, 240 boundary, 900 test
  • Loss weights: 1,10,100 (equations, then boundary-condition rows)
Phase Optimizer Iterations Learning rate Decay
1 Adam 5,000 0.001 none
2 L-BFGS 15,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: Tuned — L-BFGS phase added. 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.

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 – square with hole › 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(k0*x)*sin(k0*y)

Definition and records

How the benchmark values were measured and checked: Reproducibility.

← Back to the example gallery