dynamicslab / pysindy

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

Cart pendulum ODE docstring? #242

Open Jacob-Stevens-Haas opened 2 years ago

Jacob-Stevens-Haas commented 2 years ago

The odes module doesn't have any docstrings. In particular, I was trying to use pendulum_on_cart, but I'm not sure what the coordinates of x are supposed to represent. I would guess that x is [angular posit of pendulum, linear posit of cart, angular velocity of pendulum, linear velocity of cart], M is the mass of the cart, m the mass of the pendulum weight, L is length, and F is friction coefficient (g=9.81 is obv, ofc). I got different equations when I tried to calculate the equations of motion, so I'm not sure if I made a mistake in math or if I misinterpreted the variables.

@akaptano, looks like you added these lines, but the ODE isn't used in any of the example notebooks. Do you know what it's supposed to mean?

akaptano commented 2 years ago

Yeah, this is a good idea in general to add some docstrings. That ODE in particular was added because it is what Kardy uses to showcase SINDy-PI. Unfortunately there are some typos in Kardy's derivation I think (and maybe also in mine), so you need to make sure the equations are right. If you post your derived equations here we can compare. What you said about the x variable is correct.

akaptano commented 2 years ago

On this note, I have an undergraduate working with the dysts database (https://github.com/williamgilpin/dysts) which would be a really nice database to integrate better with PySINDy for users that want to mess around with system identification and hyper parameter scanning. Would be good to brainstorm best way to do this.