This repository contains the Python code to reproduce the results of the paper Continuous-time system identification with neural networks by Marco Forgione and Dario Piga.
The following fitting methods for neural dynamical models are implemented and tested
- Full simulation error minimization
- Truncated simulation error minimization
- Soft-constrained integration
- One-step prediction error minimization
- torchid: PyTorch implementation several neural dynamical models
- examples: examples of neural dynamical models identification
- common: definition of metrics R-square, RMSE, fit index
Three examples are presented:
- RLC: A nonlinear series RLC circuit. Simulated dataset generated by our python code
- CTS: Cascaded Tanks System. Experimental dataset from http://www.nonlinearbenchmark.org
- EMPS: Electro-Mechanical Positioning System. Experimental dataset from http://www.nonlinearbenchmark.org
For the RLC example, the main scripts are:
RLC_fit_full
: identification with full simulation error minimizationRLC_fit_truncated.py
: identification with truncated simulation error minimizationRLC_fit_soft.py
: identification with soft-constrained integrationRLC_fit_1step
: identification with one-step prediction error minimizationRLC_eval_sim.py
: evaluation of the identified models in simulationRLC_OE_comparison.m
: linear Output Error identification in Matlab (oe
method)RLC_subspace_comparison.m
: linear subspace identification in Matlab (n4sid
method)
Similar scripts are provided for the other examples.
Simulations were performed on a Python 3.7 conda environment with
- numpy
- scipy
- matplotlib
- pandas
- sympy
- pytorch (version 1.4.0)
- numba
- nodepy
- tensorboard
These dependencies may be installed through the commands:
conda install numpy numba scipy sympy pandas matplotlib ipython
conda install pytorch torchvision cpuonly -c pytorch
pip install tensorboard nodepy
If you find this project useful, we encourage you to
- Star this repository ⭐
- Cite the paper
@article{forgione2021a,
title={Continuous-time system identification
with neural networks: Model structures and fitting criteria},
author={Forgione, M. and Piga, D.},
journal={European Journal of Control},
volume={59},
pages={69--81},
year={2021},
publisher={Elsevier}
}