Skip to content

PINN Toolbox 1.0.0

Choose a tag to compare

@JanStudnicka JanStudnicka released this 06 Aug 10:26
· 6 commits to master since this release

The first public release of the PINN Toolbox — a MATLAB namespace package (+PINN)
for solving forward and inverse PDE/ODE problems with Physics-Informed Neural
Networks, built on Deep Learning Toolbox automatic differentiation
(dlarray / dlnetwork / dlgradient / dlfeval).

What's in it

Core. Three value classes form the pipeline:

  • PINN.core.NeuralNetwork — network wrapper with optional random Fourier features,
    a gated modified-MLP architecture (Wang et al. 2021) and a sin activation.
  • PINN.core.LossFunction — combined data + physics loss from your own PDE residual
    handle, with optional adaptive grad-norm weighting and a divergence cap.
  • PINN.core.Optimizer — Adam and L-BFGS training loops (forward and inverse) with
    dlaccelerate graph caching on by default, learning-rate schedules, early stopping,
    in-loop residual-adaptive resampling, and a non-finite-loss guard that rolls back
    and stops cleanly.

Utilities for collocation sampling (including complex geometries by rejection
sampling), hard boundary constraints, higher-order derivatives, a gradient-balance
diagnostic, and a name-value builder for the training inputs.

Examples. 19 narrated Live Scripts, one concept each, every one validated against
an analytic / pdepe / ode45 reference and reporting its relative L2 error. Czech
in examples/, with a full English mirror in examples/en/ and a guided tour in
both languages. They cover the basics, inverse problems from real sensor data, and
deliberate failure-mode studies with measured remedies — convection with curriculum
training (82.1 % → 9.93 %), stiff Helmholtz with adaptive weights and hard BCs
(34.7 % → 0.62 %), spectral bias with Fourier features (520.8 % → 5.23 %), and a
stiff reaction where the loss is near zero but the answer is 96 % wrong until
seq2seq time-marching fixes it (→ 0.12 %).

Interactive app. PINN.tools.launchTrainerApp — pick a preset or type your own
equation and data, configure the network, loss and optimizer, train, and export a
runnable script. Bilingual UI (Czech / English).

Optional companions. A Simscape Multibody digital twin that generates the pendulum
sensor data, and a trained PINN deployed as a Simulink block acting as a soft sensor.
Their generated artifacts are committed, so the core examples need only the Deep
Learning Toolbox.

Tests and tooling. 139 unit tests, including sentinels that verify numerical
equivalence with and without dlaccelerate caching, plus fast example-path smoke
tests. CI runs the suite on both supported releases.

Requirements

  • MATLAB R2025a or newer — verified in CI on R2025a and R2026a, CPU only.
  • Deep Learning Toolbox (required).
  • Simulink, Simscape and Simscape Multibody only for the optional companion examples.
    The committed .slx models were saved in R2026a; on an older release regenerate them
    with the build_*.m scripts.

Install

From the repository (recommended — the examples resolve their data paths through
the MATLAB project):

% git clone https://github.com/JanStudnicka/pinn-toolbox.git
openProject("PINNToolbox.prj")
open examples/en/tutorial.m      % guided tour, English

As a toolbox: download PINNToolbox.mltbx below and double-click it, or run
matlab.addons.toolbox.installToolbox("PINNToolbox.mltbx").

Documentation

  • doc/Tuning_Guide.md — symptom → diagnosis → fix, grounded in this repo's own
    measurements (Czech mirror: doc/Pruvodce_ladenim.md).
  • doc/PINN_Architecture.md — architecture and a residual cookbook.
  • Papers/README.md — the six publications the toolbox is built on.
  • .claude/skills/pinn-toolbox/ — a usage skill for AI coding agents.

MIT licensed.