Releases: dynamicslab/pysindy
Release list
Trapping SINDy
This release introduces the TrappingSINDy optimizer, which "enables the identification of models that, by construction, only produce bounded trajectories." To use TrappingSINDy you will need to install the cvxpy package.
It includes a new notebook where TrappingSINDy is applied to standard fluid dynamics problems.
Please see this paper for more details about the new method.
Starting with this release, PySINDy will begin requiring Python 3.7 or above.
Other updates
- Bug fix for
SINDy.simulatefor discrete systems with multiple control inputs
Constrained SR3
Major changes
This release introduces the ConstrainedSR3 optimizer. This is an enhanced version of the SR3 optimizer which allows one to specify linear equality constraints on the learned coefficients.
For example, if you know that the equations you are trying to learn look like
x' = a + by
y' = c - bx
(i.e. that the coefficient on y should be the negative of the coefficient on x), you could enforce that constraint using ConstrainedSR3.
Additionally, ConstrainedSR3 allows you to specify a different threshold parameter for each library function coefficient. This is an improvement on our other optimizers which all take a fixed regularization constant that is applied uniformly to all coefficients. You can use this feature to choose a higher threshold for, say, quadratic interaction terms like x*x or x*y than you do for linear terms, for example.
We also have added a notebook demonstrating these new features on a real world plasma dataset.
Other Updates
- Fix bug with extrapolating control inputs outside of original time domain with
SINDy.simulate - It is now possible to specify an initial guess for coefficients with the
STLSQandSR3optimizers - Added some fancy plots to the differentiation notebook
- Minor bug fixes
[Bug fix] Simulate with control inputs
This release fixes a minor issue causing SINDy.simulate to fail when vectors of control inputs are passed in (see #94).
Scikit-time objects
The main update in this release is the addition of two objects meant to conform to the API for Sckit-time: SINDyEstimator and SINDyModel. We also added a notebook showing how these two objects may be used.
We also made some other minor changes:
- Add support for vector arguments for control inputs to
SINDy.simulate(previously control inputs had to be callable) - Removed extraneous
n_jobsparameter from theSINDyclass - Added tests for SR3 trimming options
- Updated some docstrings
- Restructure examples/README content
- Minor formatting updates for the new version of black
Expanded derivative options
This release implements the SINDyDerivative class, which allows one to use differentiation methods from the derivative package. This will enable the application of SINDy to much noisier datasets.
Note that PySINDy now requires the derivative package.
derivative includes the following numerical differentiation techniques:
- Spectral derivatives (via the FFT)
- Spline-based derivatives
- Finite differences of arbitrary order
- Polynomial least-squares (Savitzky-Golay)
- Total variation regularized derivative (the method recommended in the original SINDy paper)
This release also contains some improvements to the documentation:
- Example using
SINDyDerivativein the Feature Overview notebook - A new notebook comparing all the differentiation options available in PySINDy
- An example showing how to optimize parameters of
derivativeobjects with cross-validation
Cross-validation
This release enables much easier cross-validation of SINDy models using Scikit-learn cross-validation tools. Major changes include:
t_defaultparameter added to theSINDyclass. This parameter specifies the default time step that should be used whenever thetargument of aSINDymethod is not used.- New notebook demonstrating cross-validation and other examples combining Scikit-learn and PySINDy objects.
More details can be found in #84.
Bug fix: Require Scikit-learn 0.23
PySINDy now requires Scikit-learn version 0.23 instead of 0.21. There are also some minor bug fixes included in this release related to checking when optimizers have been fit.
Bug fix: Make scoring consistent with sklearn
This release makes the SINDy.score function better conform to the call signature of metrics from sklearn.metrics. Resolves #80.
Bug fix: Make compatible with sklearn 0.21
Fixes a minor bug in the CustomLibrary class for earlier releases of Scikit-learn (e.g. 0.21). Scikit-learn version 0.23 (the latest version) does not have this issue.