I started with the heat equation because I could compare the network with a solution I already knew, then wanted to see how far the same setup could stretch.
Engineering case study · Scientific ML · 2026
Physics-Informed Neural Network
A reusable PyTorch PINN framework generalized beyond the original 1D heat-equation example to multiple PDEs, dimensions, boundary conditions, sampling strategies, neural architectures, loss weighting, and training methods.
Central idea
What this system investigates.
Scientific machine learning becomes useful when the learned model is constrained by governing physics and its assumptions remain inspectable.
Problem
Why this system exists.
The original project began as a transparent 1D heat-equation PINN. The next engineering problem was making the implementation reusable without copying the training loop for every new equation, while keeping domains, PDE residuals, boundary conditions, sampling, architectures, weighting, and optimization independently inspectable.
System architecture
How the system is organized.
- Define domain and constraints
- Implement PDE residual
- Sample collocation / boundary points
- Select neural representation
- Construct weighted physics loss
- Train and diagnose
- Validate against reference
Implementation
Methods and engineering choices.
The generalized framework separates Domain, PDE, boundary conditions, sampling, neural representations, loss weighting, causal transient weighting, and GeneralTrainer components. New equations provide a residual implementation while reusing the surrounding infrastructure; the repository currently demonstrates 1D heat, 2D Poisson, and 1D Burgers problems alongside the original baseline and application-oriented examples.
Results and evidence
What the current record demonstrates.
- Generalized architecture supports arbitrary spatial dimensions with optional time dimensions.
- Dirichlet, Neumann, and periodic boundary-condition abstractions are separated from the PDE definition.
- Uniform, Latin Hypercube, Sobol, and residual-based adaptive sampling are available.
- Standard MLP, hard Dirichlet ansatz, Fourier features, fixed/gradient-norm/self-adaptive weighting, and causal weighting are implemented.
- Three generalized PDE problems are included: 1D heat, 2D Poisson, and nonlinear 1D Burgers.
- Recorded representative single-seed results include 9.96e-5 relative L2 for the hard-constraint Poisson configuration and 0.0052 max initial-condition error for the causal-weighted + L-BFGS Burgers configuration.
- Automated tests and CI cover the package across Python 3.10–3.12.
Verification
Checks performed and their scope.
- Automated tests and CI cover the package across Python 3.10–3.12.
- Representative cases retain reference comparisons and recorded error measurements.
Limitations
What this work does not yet establish.
- Recorded measurements are single-configuration project results, not general PINN performance claims.
- The current framework is not an aerospace solver or safety-critical numerical method.
- Higher-dimensional aerospace validation requires stronger numerical baselines.
Engineering decisions
Decisions that define the model boundary.
- Kept the original heat-equation baseline intact as a transparent learning and validation reference while building the generalized framework alongside it.
- Separated the PDE residual from the trainer so the same optimization infrastructure can be reused across equations.
- Added multiple sampling, boundary, network, and weighting strategies as interchangeable components rather than embedding them in individual examples.
- Documented representative measurements as project-specific single-seed results rather than presenting them as general claims about PINNs.
- Explicitly bounded the project as a research/engineering framework rather than a validated industrial or safety-critical solver.
A note from the build
What stayed with me.
Adding physics to the loss does not guarantee an easy training run. Sampling, boundary conditions and loss weighting can change the behavior just as much as the network itself.
I learned to keep training loss, reference error and numerical assumptions in view together; one good-looking number cannot tell the whole story.
Next step
What I would investigate next.
Add matched multi-seed ablations, stronger error reporting, benchmark selected cases against classical numerical solvers, investigate training stability and weighting strategies, and extend toward higher-dimensional aerospace and fluid-mechanics problems with higher-fidelity references.
Source and related work