Second-order ODE¶
| Example | |
|---|---|
| Source | DeepXDE example |
| Problem | Forward and Inverse (the Inverse mode is PINNStudio's addition) |
| Dimension | ODE (t) |
| Regime | Time-dependent |
| Geometry | — (t only) |
| Outputs | u |
| Settings | Default, Tuned |
Governing equations¶
Mathematical form (from the benchmark records):
As typed in PINNStudio's Equations page (each expression is a residual, set to zero):
As typed in PINNStudio's Equations page (Inverse mode) (each expression is a residual, set to zero):
Domain¶
- Time interval: \(t \in [0, 0.25]\)
Initial conditions¶
| Output | Initial value | How it is imposed (Settings: Default) |
|---|---|---|
u |
-1 |
loss term |
Boundary conditions¶
| Type | Where | Output | Value | Details |
|---|---|---|---|---|
| Operator BC (advanced) | initial time | — | du_t - 2 |
applied at the initial time |
Unknowns and measured data (Inverse)¶
| Trainable parameter | Initial value | True value |
|---|---|---|
a |
5 | 10 |
b |
4.5 | 9 |
Measured data (Inverse page, measured-data files):
reference_data/deepxde/ode2_inverse/u_obs.txt→ outputu, weight 100
Settings¶
Forward mode¶
Settings: Default — DeepXDE's own settings
- Network: FNN, hidden layers 3 × 50, inputs (t), 1 output; activation tanh, initializer Glorot uniform
- Points: 16 domain, 2 boundary, 500 test
- Loss weights:
0.01,1,1(equations, then boundary-condition rows, then initial conditions)
| 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).
Inverse mode¶
Settings: Default — DeepXDE's settings with PINNStudio's Inverse-mode changes (see Notes)
- Network: FNN, hidden layers 3 × 50, inputs (t), 1 output; activation tanh, initializer Glorot uniform
- Points: 16 domain, 2 boundary, 500 test
- Loss weights:
0.01,1,1(equations, then boundary-condition rows, then initial conditions)
| Phase | Optimizer | Iterations | Learning rate | Decay |
|---|---|---|---|---|
| 1 | Adam | 10,000 | 0.001 | none |
| 2 | L-BFGS | 15,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 example's own settings.
- Network: FNN, hidden layers 4 × 100, inputs (t), 1 output; activation tanh, initializer Glorot uniform
- Points: 16 domain, 2 boundary, 500 test
- Loss weights:
0.01,1,1(equations, then boundary-condition rows, then initial conditions)
| Phase | Optimizer | Iterations | Learning rate | Decay |
|---|---|---|---|---|
| 1 | Adam | 10,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: 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 | 6.9 × 10⁻⁴ |
Inverse problem¶
Settings: Tuned — Larger network (2× width, one more layer). Values: one run, seed 2026.
| Parameter | True value | Recovered | Relative error |
|---|---|---|---|
| a | 10 | 10.0003 | 0.003 % |
| b | 9 | 8.99262 | 0.082 % |
Worst parameter error: 0.082 %.
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 ── ODE ── heading, Second-order ODE › Default, then Solve.
- Inverse: toolbar Examples: › Inverse › under the ── ODE ── heading, Second-order ODE › 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 = 50/81 + t*5/9 - 2*exp(t) + 31/81*exp(9*t)
Notes¶
- u(0) = -1 is the initial condition; u'(0) = 2 is an Operator BC 'du_t - 2' at the initial time.
- Inverse mode (PINNStudio's addition): the coefficients a (10 in the forward equation; initial guess 5) and b (9; initial guess 4.5) of u'' - a u' + b u = 5t are learned from u at 30 times (reference_data/deepxde/ode2_inverse). An L-BFGS phase follows Adam.
Definition and records¶
- Definition:
EXAMPLESentry "Second-order ODE" inpinnstudio/core/deepxde_examples.py- Inverse mode (PINNStudio's addition):
ADDED_INVERSE["Second-order ODE"], same file - Settings: Tuned: entry "Second-order ODE" in
pinnstudio/resources/tuned_settings.json
- Inverse mode (PINNStudio's addition):
- Equations: Governing equations on this page
- Reference data: the exact-solution formula under Reference solution (no data files)
- Measured data (Inverse):
reference_data/deepxde/ode2_inverse/, written bytools/make_deepxde_reference_data.py - Benchmark records:
benchmarks/problems/second-order-ode.md, its entry in the examples overview, the benchmark collection - Tuning-study configurations (records of the tuning study; open one with Problem › Open Saved Problem...; not presets of the Examples list):
Second-order ODE (tuned).pinn.json,Second-order ODE, inverse mode (tuned).pinn.json - DeepXDE example: ode_2nd.py (documentation)
- Cite: Lu et al. 2021 (DeepXDE)
How the benchmark values were measured and checked: Reproducibility.