Model-Structured Neural Networks for Dynamics Learning of Physical Systems: A Compositional Modeling Approach with nnodely
Authors:
- Giovanni SciallaGSGiovanni Scialla
- Francesco BaroniFBFrancesco Baroni
- Giovanni Maria Francesco La ScalaGSGiovanni Maria Francesco La Scala
- Davide De MartiniDMDavide De Martini
- Gioele DefrancescoGDGioele Defrancesco
- Mojtaba SharifzadehMSMojtaba Sharifzadeh
- Alice PlebeAPAlice Plebe
- Mattia PiccininiMPMattia Piccinini
- Gastone Pietro Rosati PapiniGPGastone Pietro Rosati Papini
Preprint
- 19 October 2026
- preprint
- Published by Elsevier in SSRN Electronic Journal
Abstract
Accurate and interpretable models of physical-system dynamics are fundamental to simulation, prediction, and control. First-principles models provide physical consistency and interpretability but often rely on simplifying assumptions, whereas purely data-driven neural networks offer greater expressive power at the expense of data efficiency. This paper introduces Model-Structured Neural Networks (MSNNs), a methodology for learning physical-system dynamics by embedding physics priors directly into neural architectures. Rather than enforcing physics through loss-function constraints, MSNNs encode prior knowledge through Neural Compositional Modules (NCMs), modular building blocks representing physically meaningful dynamic effects. We formalize a compositional framework in which NCMs are combined through algebraic operations and equipped with physics-encoded input-output transformations, operating-regime-dependent activations, residual components, and temporal memory, enabling the representation of complex dynamics while preserving interpretability and modularity. A further contribution is nnodely a new open-source library providing an end-to-end workflow for MSNN definition, training, validation, inference, and export. The methodology is evaluated on four simulated and real-world engineering case studies involving single and double inverted pendula, friction learning for a Unitree Z1 manipulator, and lateral vehicle dynamics learned from public Ferrari 250 LM telemetry. Across these applications, MSNNs preserve physically interpretable structure while achieving competitive or superior predictive accuracy relative to black-box neural networks and purely model-based approaches. Experiments with progressively reduced training sets and recurrent rollouts further demonstrate improved data efficiency and robust long-horizon prediction. The software, data-generation scripts, and case-study implementations are openly available in the https://github.com/tonegas/nnodely and https://github.com/tonegas/nnodely-applications repositories.Keywords
This publication has 31 references indexed in Scilit:
- Robust data-driven dynamic model discovery of industrial robots with spatial manipulation capability using simple trajectoryNonlinear Dynamics, 2024
- Sliding-mode control of a soft robot based on data-driven sparse identificationControl Engineering Practice, 2023
- Collaborative robot dynamics with physical human–robot interaction and parameter identification with PINNMechanism and Machine Theory, 2023
- Learning and extrapolation of robotic skills using task-parameterized equation learner networksRobotics and Autonomous Systems, 2022
- Physics-guided neural network and GPU-accelerated nonlinear model predictive control for quadcopterNeural Computing and Applications, 2022
- Scientific Machine Learning Through Physics–Informed Neural Networks: Where we are and What’s NextJournal of Scientific Computing, 2022
- Physics-informed machine learningNature Reviews Physics, 2021
- SciPy 1.0: fundamental algorithms for scientific computing in PythonNature Methods, 2020
- Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equationsJournal of Computational Physics, 2019
- Vehicle Dynamics2018