dynamicslab / pysindy

A package for the sparse identification of nonlinear dynamical systems from data
https://pysindy.readthedocs.io/en/latest/
Other
1.42k stars 310 forks source link

Issue of precision in model.print() command and plotting of time series graph in SINDy-PI algorithm #350

Closed anur2203 closed 1 year ago

anur2203 commented 1 year ago

I am using SINDy-PI algorithm on my model. When I am using default value of precision in model.print it gives correct equation but when I am setting precision=4 or 5 then it gives many irrelvent terms( a very large equation). How I can deal with it? How can I plot the time series graph with implicit equations?

Jacob-Stevens-Haas commented 1 year ago
  1. To clarify, SINDy is finding a lot of small terms of the order 1e-4?

  2. SINDy.simulate()

anur2203 commented 1 year ago

Can I omit the terms of order >= 1e-4 in SINDy-PI ?

znicolaou commented 1 year ago

@anur2203 , yes, you need to do a hyperparameter scan to find the appropriate hyperparameters for your fit. Look at the example notebooks and read the many papers on SINDy, but for the STLSQ case, for example, just increase threshold until it omits the terms you want to exclude.