Enhancing inverse parameter identification in nonlinear dynamical systems using Physics-Informed Neural Networks (PINNs), thermodynamic passivity constraints, and bootstrap ensemble uncertainty quantification.
This repository presents a complete experimental pipeline for investigating stability, identifiability, and calibration behavior in PINN-based inverse modeling of the nonlinear pendulum.
- Inverse parameter recovery under sparse velocity observations (100 measurements)
- Passivity constraints enforcing physically consistent energy dissipation
- 25-model bootstrap ensembles for uncertainty quantification
- 20,000 training epochs per model
- Robustness grids and calibration analysis
- Fully reproducible experimental pipeline
- Does passivity regularization stabilize inverse parameter recovery?
- Can bootstrap ensembles provide calibrated uncertainty estimates in PINNs?
- How severe is damping parameter non-identifiability under sparse observations?
| Method | g error | L error | c error | Trajectory RMSE | Energy Drift |
|---|---|---|---|---|---|
| Standard PINN | 0.04% | 22.9% | 1032% | 0.327 | 0.00199 |
| Passivity PINN | 2.12% | 9.06% | 696% | 0.327 | 0.00058 |
| Ensemble (25) | 1.44% | 13.3% | 768% | 0.329 | 0.00061 |
- Passivity improves conservative parameters (g, L) by stabilizing estimates
- Damping estimation is catastrophically ill-posed (700β2100% errors) β a fundamental identifiability challenge under sparse observations
- Ensemble UQ is severely miscalibrated (8.7% coverage vs. 95% target)
- Bias dominates over variance β systematic errors are the primary failure mode
pinn_passivity_paper/
βββ src/ # Main source code
β βββ data/
β β βββ generator.py # Data generation (analytical + nonlinear solvers)
β β βββ utils.py # Time grids, noise, batching
β βββ baseline/
β β βββ linear_small_angle.py # Analytical solutions
β β βββ nonlinear_rk.py # RK4 and solve_ivp
β β βββ plots_baseline.py # Baseline plotting
β βββ models/
β β βββ pinn_inverse.py # PINN architecture with Fourier features
β β βββ losses.py # Physics, IC, passivity losses
β β βββ train_inverse.py # Training loop with TensorBoard
β β βββ dissipation_net.py # NN for nonparametric damping
β β βββ ensemble.py # Bootstrap ensemble implementation
β βββ analysis/
β β βββ metrics.py # RMSE, energy drift, coverage, ECE
β β βββ tables_figs.py # Figure/table generators
β βββ experiments/
β β βββ exp_baseline.py # Baseline experiments
β β βββ exp_inverse_single.py # Single PINN runs
β β βββ exp_inverse_ens.py # Ensemble experiments
β β βββ grids.py # Robustness study grids
β βββ configs/
β β βββ default.yaml # All hyperparameters
β β βββ config_loader.py # Config management
β βββ viz/
β βββ style.py # Publication-quality plotting
βββ scripts/
β βββ run_all.sh # Full pipeline orchestration
β βββ generate_final_study.py # Automated analysis report
βββ tests/
β βββ test_data.py
β βββ test_losses.py
β βββ test_models.py
β βββ test_metrics.py
βββ outputs/ # Generated results
β βββ baseline/
β βββ inverse_single/
β βββ ensemble/
β βββ summaries/
β βββ FINAL_STUDY.md
β βββ *.csv, *.png, *.json
βββ report/
β βββ COMPLETE_REPORT.tex # Full LaTeX report (~40 pages)
β βββ figures/
β βββ *.md
βββ requirements.txt
βββ pyproject.toml
βββ Makefile
βββ README.md
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txtRequired packages: torch, numpy, scipy, matplotlib, pandas, tqdm, tensorboard, pyyaml, pytest, ruff, black
bash scripts/run_all.sh --full
# Or step-by-step:
make setup
make test
make run-baseline
make run-inverse
make run-ensembletensorboard --logdir outputs/
cat outputs/FINAL_STUDY.md
open outputs/analysis/*.pngpython -m src.experiments.exp_baselinepython -m src.experiments.exp_inverse_single \
--n-epochs 20000 \
--n-sparse 100 \
--noise 0.01 \
--use-velocity-obs truepython -m src.experiments.exp_inverse_ens \
--n-models 25 \
--n-epochs 20000 \
--use-passivity truepython -m src.experiments.run_grid --fullEdit configs/default.yaml:
physics:
g: 9.81
L: 1.0
c: 0.05
time:
t_start: 0.0
t_end: 10.0
n_points_dense: 1000
n_points_sparse: 100
model:
hidden_dims: [32, 32, 32]
activation: tanh
n_fourier_features: 6
training:
n_epochs: 20000
lr: 0.001
optimizer: adam
loss_weights:
data: 1.0
velocity: 1.0
physics: 10.0
ic: 1.0
passivity: 1.0
ensemble:
n_models: 25
bootstrap: trueSeed: 1337 (fixed throughout). All experiments use fixed random seeds, deterministic algorithms, logged hyperparameters, and saved checkpoints.
export PYTHONHASHSEED=1337
bash scripts/run_all.sh --fullpytest # All tests
pytest tests/test_losses.py -v # Specific module
pytest --cov=src tests/ # With coveragecd report/
pdflatex COMPLETE_REPORT.tex
pdflatex COMPLETE_REPORT.texThe report contains 40+ pages of analysis, 20+ figures, 15+ result tables, and full mathematical derivations. Compatible with Overleaf.
- Raissi et al. (2019) β Physics-Informed Neural Networks, Journal of Computational Physics
- Karniadakis et al. (2021) β Physics-Informed Machine Learning, Nature Reviews Physics
- Wang et al. (2021) β Gradient Pathologies in PINNs, SIAM Journal on Scientific Computing
- Yang et al. (2021) β Bayesian PINNs, Journal of Computational Physics
This work was completed as part of MA-515 at IIT Ropar.
Authors: Pranav Singh Β· Prashant Singh Β· Nishit Soni Β· Jaskaran Singh Β· Ishwar Sanjay Β· Harshdeep
@techreport{singh2024pinn,
title={Enhancing PINN-Based Inverse Modeling of the Nonlinear Pendulum
Using Passivity Constraints and Ensemble UQ},
author={Singh, Pranav and Singh, Prashant and Soni, Nishit and
Singh, Jaskaran and Sanjay, Ishwar and Harshdeep},
institution={Indian Institute of Technology Ropar},
year={2024},
type={Course Project Report},
number={MA-515}
}Last Updated: November 2025