How maziarraissi/pinns works
1. This repository is a set of reference implementations for Physics-Informed Neural Networks (PINNs), focused on solving and discovering PDEs from data. It is organized as a collection of independent example programs rather than a single shared application.
2. The top-level split is between main/ and appendix/. main/ contains the primary paper examples, while appendix/ contains additional Burgers equation experiments and supporting result artifacts. Each subfolder is a self-contained experiment with its own script, data, and outputs.
3. The core execution unit is one Python script per experiment, such as AC.py, KdV.py, Schrodinger.py, NavierStokes.py, and the Burgers variants. These scripts are the entry points that load data, define the PINN model, train it, and generate plots/results for a specific PDE problem.
4. The examples are organized by problem class:
- continuous-time inference,
- continuous-time identification,
- discrete-time inference,
- discrete-time identification.
This is the main architectural boundary in the repo, and it reflects two algorithmic families: learning PDE solutions versus discovering PDE structure from data.
5. The data layer is entirely file-based. Input datasets are stored as MATLAB .mat files under main/Data/ and appendix/Data/, including AC.mat, KS.mat, KdV.mat, NLS.mat, cylinder_nektar_*.mat, and burgers_shock.mat. The scripts consume these files directly; there is no database or service layer.
6. Utilities/ contains shared support code used across experiments. The main reusable code visible here is plotting.py, which likely standardizes figure generation and visualization. The IRK_weights/ directory holds many precomputed Butcher table files used by the discrete-time/integrator-based examples.
7. The IRK_weights assets are a notable architectural component for the discrete-time methods. They provide numerical integration coefficients for implicit Runge-Kutta schemes, which means the discrete-time experiments depend on pre-generated solver weights rather than computing them at runtime.
8. Output artifacts are checked in alongside the code. Each experiment folder has a figures/ directory with generated .eps and .pdf plots, and some have tables/ directories with .csv error summaries. This makes the repo both a codebase and a reproducible result archive.
9. The main/continuous_time_identification (Navier-Stokes) example is the only one that clearly targets a higher-dimensional fluid dynamics case, using cylinder wake/vorticity datasets. It appears to be a representative benchmark for inverse PDE discovery in a more complex physical domain than the 1D examples.
10. The appendix Burgers cases mirror the main experiments but are split into separate identification and inference variants. This duplication suggests the repository emphasizes comparing algorithm families on the same PDE and preserving the exact outputs for each configuration.
11. docs/ is a small static documentation site, with Jekyll-style configuration and layout files plus index.md. It is not part of the runtime pipeline for experiments, but it serves as a presentation layer for the project and likely hosts the published project page.
12. Overall data flow: .mat dataset → per-experiment Python script → trained PINN / inferred PDE coefficients → generated figures and CSV error tables. Shared utilities and IRK weights support the experiment scripts, while docs and stored outputs package the results for publication and review.
Main entry points: plotting.py Plotting · main/Data Main data · appendix/Data Appendix data · IRK_weights IRK weights
Components 15
Shared support
Reusable utilities, numerical integration weights, and source datasets shared by the example scripts.
- Main data · MATLAB training and evaluation datasets for the main experiments.
main/Data - Appendix data · Appendix Burgers dataset consumed directly by the Burgers experiments.
appendix/Data - Plotting · Reusable figure-generation support used by the experiment scripts.
Utilities/plotting.py - IRK weights · Precomputed Butcher tables and time-step weights used by discrete-time PINN variants.
Utilities/IRK_weights
Main examples
Primary paper experiments split by continuous/discrete time and inference/identification.
- Main examples · Primary PINN benchmark set for the paper; organized into four PDE example scripts.
- AC.py · Allen-Cahn discrete-time inference experiment; loads AC data, trains the PINN, and writes figures.
main/discrete_time_inference (AC)/AC.py - Schrodinger.py · Schrödinger/NLS continuous-time inference experiment and plot generator.
main/continuous_time_inference (Schrodinger)/Schrodinger.py - KdV.py · KdV discrete-time identification experiment for learning PDE structure from data.
main/discrete_time_identification (KdV)/KdV.py - NavierStokes.py · Navier-Stokes inverse PDE example using cylinder wake/vorticity data.
main/continuous_time_identification (Navier-Stokes)/NavierStokes.py
Appendix examples
Additional Burgers equation experiments with mirrored inference and identification variants.
- Appendix Burgers · Appendix-only Burgers experiments, duplicated across time/discovery variants.
- Burgers CT inf. · Appendix Burgers continuous-time inference variant.
appendix/continuous_time_inference (Burgers)/Burgers.py - Burgers CT id. · Appendix Burgers continuous-time identification variant.
appendix/continuous_time_identification (Burgers)/Burgers.py - Burgers DT inf. · Appendix Burgers discrete-time inference variant.
appendix/discrete_time_inference (Burgers)/Burgers.py - Burgers DT id. · Appendix Burgers discrete-time identification variant.
appendix/discrete_time_identification (Burgers)/Burgers.py
Docs
Static project documentation and presentation layer.
- Docs site · Small Jekyll-style documentation site for the project page and overview.
docs
Connections 30
- Main examples → AC.py: contains · Main example family includes the Allen-Cahn discrete-time inference script.
- Main examples → Schrodinger.py: contains · Main example family includes the Schrödinger continuous-time inference script.
- Main examples → KdV.py: contains · Main example family includes the KdV discrete-time identification script.
- Main examples → NavierStokes.py: contains · Main example family includes the Navier-Stokes continuous-time identification script.
- Appendix Burgers → Burgers CT inf.: contains · Appendix family includes the Burgers continuous-time inference script.
- Appendix Burgers → Burgers CT id.: contains · Appendix family includes the Burgers continuous-time identification script.
- Appendix Burgers → Burgers DT inf.: contains · Appendix family includes the Burgers discrete-time inference script.
- Appendix Burgers → Burgers DT id.: contains · Appendix family includes the Burgers discrete-time identification script.
- Main data → AC.py: feeds · AC dataset is loaded directly by the Allen-Cahn experiment.
- Main data → Schrodinger.py: feeds · NLS dataset is loaded directly by the Schrödinger experiment.
- Main data → KdV.py: feeds · KdV dataset is loaded directly by the KdV experiment.
- Main data → NavierStokes.py: feeds · Cylinder wake and vorticity datasets feed the Navier-Stokes experiment.
- Appendix data → Burgers CT inf.: feeds · Burgers shock data feeds the appendix inference variant.
- Appendix data → Burgers CT id.: feeds · Burgers shock data feeds the appendix identification variant.
- Appendix data → Burgers DT inf.: feeds · Burgers shock data feeds the appendix discrete-time inference variant.
- Appendix data → Burgers DT id.: feeds · Burgers shock data feeds the appendix discrete-time identification variant.
- Plotting → AC.py: supports · Shared plotting helpers standardize experiment figures.
- Plotting → Schrodinger.py: supports · Shared plotting helpers standardize experiment figures.
- Plotting → KdV.py: supports · Shared plotting helpers standardize experiment figures.
- Plotting → NavierStokes.py: supports · Shared plotting helpers standardize experiment figures.
- Plotting → Burgers CT inf.: supports · Shared plotting helpers standardize experiment figures.
- Plotting → Burgers CT id.: supports · Shared plotting helpers standardize experiment figures.
- Plotting → Burgers DT inf.: supports · Shared plotting helpers standardize experiment figures.
- Plotting → Burgers DT id.: supports · Shared plotting helpers standardize experiment figures.
- IRK weights → AC.py: supports · Discrete-time Allen-Cahn uses precomputed IRK weights.
- IRK weights → KdV.py: supports · Discrete-time KdV uses precomputed IRK weights.
- IRK weights → Burgers DT inf.: supports · Discrete-time Burgers inference uses precomputed IRK weights.
- IRK weights → Burgers DT id.: supports · Discrete-time Burgers identification uses precomputed IRK weights.
- Docs site → Main examples: documents · Static docs describe the main example suite and paper context.
- Docs site → Appendix Burgers: documents · Static docs describe the appendix experiments and project overview.