Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can we add derivative with respect to time in feature library ? #136

Closed
AhmadSaeed2601 opened this issue Dec 2, 2021 · 5 comments
Closed

Comments

@AhmadSaeed2601
Copy link

AhmadSaeed2601 commented Dec 2, 2021

How can we add derivative with respect to time in feature library ?

lets say if we have three state variables x,y,z then how to add x_dot in feature library ..
i am struggling with this one .. please let me know if there is any solution

@akaptano
Copy link
Collaborator

akaptano commented Dec 2, 2021

Hi Ahmad, if x_dot is in the feature library then you are solving for a system of implicit ODEs that looks like
x_dot = f(x, x_dot), which the normal SINDy method is not appropriate for. Fortunately, we have implemented the SINDy-PI library (and associated optimizer) in the upcoming PySINDy release, which does address these types of systems (https://royalsocietypublishing.org/doi/pdf/10.1098/rspa.2020.0279). The new release will be out within a week or so, and I'll let you know when that happens. The new Example 9 Jupyter notebook will show how you can use the SINDy-PI functionality.

@AhmadSaeed2601
Copy link
Author

AhmadSaeed2601 commented Dec 3, 2021 via email

@akaptano
Copy link
Collaborator

akaptano commented Dec 3, 2021

You may also find this recent video very illuminating https://www.youtube.com/watch?v=sP8JXF9_wAs

I'm happy to answer any questions you have about using the new SINDy-PI functionality once the new release is out (there will likely be some bugs to iron out!)

@akaptano
Copy link
Collaborator

akaptano commented Dec 4, 2021

Ahmad, I should have mentioned there is a second way that you can already do this, although it is kind of a hack. Before making a SINDy model you can differentiate [x, y, z] and put all the variables together [x, y, z, x_dot, y_dot, z_dot] and use this as your data. Then if you are using a polynomial library or something, polynomials in x_dot, y_dot, and z_dot will also be generated. The downside is that SINDy will also try to fit models to x_dot, y_dot, and z_dot, but you can ignore these.

@akaptano
Copy link
Collaborator

akaptano commented Dec 5, 2021

SINDy-PI is now implemented in the new release v1.5, so closing this for now. Feel free to reopen this if you have any issues.

@akaptano akaptano closed this as completed Dec 5, 2021
jpcurbelo pushed a commit to jpcurbelo/pysindy_fork that referenced this issue May 9, 2024
automatic PyPI upload, bugfixes, doc updates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants