# maziarraissi/pinns architecture

> Architecture diagram of the GitHub repository maziarraissi/pinns, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/maziarraissi/pinns
- Repository: https://github.com/maziarraissi/pinns

## Overview

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: [`Utilities/plotting.py`](https://github.com/maziarraissi/pinns/blob/master/Utilities/plotting.py) (Plotting), [`main/Data`](https://github.com/maziarraissi/pinns/tree/master/main/Data) (Main data), [`appendix/Data`](https://github.com/maziarraissi/pinns/tree/master/appendix/Data) (Appendix data), [`Utilities/IRK_weights`](https://github.com/maziarraissi/pinns/tree/master/Utilities/IRK_weights) (IRK weights)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shared["Shared support"]
  node_main_data[("Main data<br/>mat datasets")]
  node_appendix_data[("Appendix data<br/>mat datasets")]
  node_plotting["Plotting<br/>shared utility<br/>[plotting.py]"]
  node_irk_weights["IRK weights<br/>numerical assets"]
end

subgraph group_main["Main examples"]
  node_main_examples["Main examples<br/>experiment suite"]
  node_ac_inference["AC.py<br/>discrete-time inference<br/>[AC.py]"]
  node_schrodinger_inference["Schrodinger.py<br/>continuous-time inference<br/>[Schrodinger.py]"]
  node_kdv_identification["KdV.py<br/>discrete-time identification<br/>[KdV.py]"]
  node_navierstokes_identification["NavierStokes.py<br/>continuous-time identification<br/>[NavierStokes.py]"]
end

subgraph group_appendix["Appendix examples"]
  node_appendix_examples["Appendix Burgers<br/>experiment suite"]
  node_burgers_ct_inference["Burgers CT inf.<br/>continuous-time inference<br/>[Burgers.py]"]
  node_burgers_ct_identification["Burgers CT id.<br/>continuous-time identification<br/>[Burgers.py]"]
  node_burgers_dt_inference["Burgers DT inf.<br/>discrete-time inference<br/>[Burgers.py]"]
  node_burgers_dt_identification["Burgers DT id.<br/>discrete-time identification<br/>[Burgers.py]"]
end

subgraph group_docs["Docs"]
  node_docs_site["Docs site<br/>static docs"]
end

node_main_examples -->|"contains"| node_ac_inference
node_main_examples -->|"contains"| node_schrodinger_inference
node_main_examples -->|"contains"| node_kdv_identification
node_main_examples -->|"contains"| node_navierstokes_identification
node_appendix_examples -->|"contains"| node_burgers_ct_inference
node_appendix_examples -->|"contains"| node_burgers_ct_identification
node_appendix_examples -->|"contains"| node_burgers_dt_inference
node_appendix_examples -->|"contains"| node_burgers_dt_identification
node_main_data -->|"feeds"| node_ac_inference
node_main_data -->|"feeds"| node_schrodinger_inference
node_main_data -->|"feeds"| node_kdv_identification
node_main_data -->|"feeds"| node_navierstokes_identification
node_appendix_data -->|"feeds"| node_burgers_ct_inference
node_appendix_data -->|"feeds"| node_burgers_ct_identification
node_appendix_data -->|"feeds"| node_burgers_dt_inference
node_appendix_data -->|"feeds"| node_burgers_dt_identification
node_plotting -->|"supports"| node_ac_inference
node_plotting -->|"supports"| node_schrodinger_inference
node_plotting -->|"supports"| node_kdv_identification
node_plotting -->|"supports"| node_navierstokes_identification
node_plotting -->|"supports"| node_burgers_ct_inference
node_plotting -->|"supports"| node_burgers_ct_identification
node_plotting -->|"supports"| node_burgers_dt_inference
node_plotting -->|"supports"| node_burgers_dt_identification
node_irk_weights -->|"supports"| node_ac_inference
node_irk_weights -->|"supports"| node_kdv_identification
node_irk_weights -->|"supports"| node_burgers_dt_inference
node_irk_weights -->|"supports"| node_burgers_dt_identification
node_docs_site -->|"documents"| node_main_examples
node_docs_site -->|"documents"| node_appendix_examples

click node_main_data "https://github.com/maziarraissi/pinns/tree/master/main/Data"
click node_appendix_data "https://github.com/maziarraissi/pinns/tree/master/appendix/Data"
click node_plotting "https://github.com/maziarraissi/pinns/blob/master/Utilities/plotting.py"
click node_irk_weights "https://github.com/maziarraissi/pinns/tree/master/Utilities/IRK_weights"
click node_ac_inference "https://github.com/maziarraissi/pinns/blob/master/main/discrete_time_inference (AC)/AC.py"
click node_schrodinger_inference "https://github.com/maziarraissi/pinns/blob/master/main/continuous_time_inference (Schrodinger)/Schrodinger.py"
click node_kdv_identification "https://github.com/maziarraissi/pinns/blob/master/main/discrete_time_identification (KdV)/KdV.py"
click node_navierstokes_identification "https://github.com/maziarraissi/pinns/blob/master/main/continuous_time_identification (Navier-Stokes)/NavierStokes.py"
click node_burgers_ct_inference "https://github.com/maziarraissi/pinns/blob/master/appendix/continuous_time_inference (Burgers)/Burgers.py"
click node_burgers_ct_identification "https://github.com/maziarraissi/pinns/blob/master/appendix/continuous_time_identification (Burgers)/Burgers.py"
click node_burgers_dt_inference "https://github.com/maziarraissi/pinns/blob/master/appendix/discrete_time_inference (Burgers)/Burgers.py"
click node_burgers_dt_identification "https://github.com/maziarraissi/pinns/blob/master/appendix/discrete_time_identification (Burgers)/Burgers.py"
click node_docs_site "https://github.com/maziarraissi/pinns/tree/master/docs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main_data,node_appendix_data,node_plotting,node_irk_weights toneBlue
class node_main_examples,node_ac_inference,node_schrodinger_inference,node_kdv_identification,node_navierstokes_identification toneAmber
class node_appendix_examples,node_burgers_ct_inference,node_burgers_ct_identification,node_burgers_dt_inference,node_burgers_dt_identification toneMint
class node_docs_site toneRose
```

## Components

### Shared support

Reusable utilities, numerical integration weights, and source datasets shared by the example scripts.

- [Main data](https://github.com/maziarraissi/pinns/tree/master/main/Data): mat datasets · MATLAB training and evaluation datasets for the main experiments. · `main/Data`
- [Appendix data](https://github.com/maziarraissi/pinns/tree/master/appendix/Data): mat datasets · Appendix Burgers dataset consumed directly by the Burgers experiments. · `appendix/Data`
- [Plotting](https://github.com/maziarraissi/pinns/blob/master/Utilities/plotting.py): shared utility · Reusable figure-generation support used by the experiment scripts. · `Utilities/plotting.py`
- [IRK weights](https://github.com/maziarraissi/pinns/tree/master/Utilities/IRK_weights): numerical assets · 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**: experiment suite · Primary PINN benchmark set for the paper; organized into four PDE example scripts.
- [AC.py](https://github.com/maziarraissi/pinns/blob/HEAD/main/discrete_time_inference%20(AC)/AC.py): discrete-time inference · Allen-Cahn discrete-time inference experiment; loads AC data, trains the PINN, and writes figures. · `main/discrete_time_inference (AC)/AC.py`
- [Schrodinger.py](https://github.com/maziarraissi/pinns/blob/HEAD/main/continuous_time_inference%20(Schrodinger)/Schrodinger.py): continuous-time inference · Schrödinger/NLS continuous-time inference experiment and plot generator. · `main/continuous_time_inference (Schrodinger)/Schrodinger.py`
- [KdV.py](https://github.com/maziarraissi/pinns/blob/HEAD/main/discrete_time_identification%20(KdV)/KdV.py): discrete-time identification · KdV discrete-time identification experiment for learning PDE structure from data. · `main/discrete_time_identification (KdV)/KdV.py`
- [NavierStokes.py](https://github.com/maziarraissi/pinns/blob/HEAD/main/continuous_time_identification%20(Navier-Stokes)/NavierStokes.py): continuous-time identification · 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**: experiment suite · Appendix-only Burgers experiments, duplicated across time/discovery variants.
- [Burgers CT inf.](https://github.com/maziarraissi/pinns/blob/HEAD/appendix/continuous_time_inference%20(Burgers)/Burgers.py): continuous-time inference · Appendix Burgers continuous-time inference variant. · `appendix/continuous_time_inference (Burgers)/Burgers.py`
- [Burgers CT id.](https://github.com/maziarraissi/pinns/blob/HEAD/appendix/continuous_time_identification%20(Burgers)/Burgers.py): continuous-time identification · Appendix Burgers continuous-time identification variant. · `appendix/continuous_time_identification (Burgers)/Burgers.py`
- [Burgers DT inf.](https://github.com/maziarraissi/pinns/blob/HEAD/appendix/discrete_time_inference%20(Burgers)/Burgers.py): discrete-time inference · Appendix Burgers discrete-time inference variant. · `appendix/discrete_time_inference (Burgers)/Burgers.py`
- [Burgers DT id.](https://github.com/maziarraissi/pinns/blob/HEAD/appendix/discrete_time_identification%20(Burgers)/Burgers.py): discrete-time identification · Appendix Burgers discrete-time identification variant. · `appendix/discrete_time_identification (Burgers)/Burgers.py`

### Docs

Static project documentation and presentation layer.

- [Docs site](https://github.com/maziarraissi/pinns/tree/master/docs): static docs · Small Jekyll-style documentation site for the project page and overview. · `docs`

## Connections

- 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.
