BystrickyK / SINDy

Physically-informed model discovery of systems with nonlinear, rational terms using the SINDy-PI method. Contains functionality for spectral filtering/differentiation.
MIT License
8 stars 0 forks source link

Full single pendulum #5

Open BystrickyK opened 3 years ago

BystrickyK commented 3 years ago

In this model, u specifies the force on the cart. The equations dx3/dt and dx4/dt in this case are rational. Equations dx1/dt and dx2/dt are equal to x3 and x4 respectively. image The equations are then rewritten into an implicit form and each equation is identified separately.

I constructed the function library to contain the relevant functions from the implicit dynamics. Of course, in practice, the actual implicit dynamics would be unknown, I'm doing this merely for testing purposes. The correlation matrix of the full library: corrmat Note that while there are some perfect correlations, the full library is reduced for each equation identification. For example, if our goal was to identify the equation dx_3 / dt, we'd remove all the terms from the library that contain any other dx_i / dt. This way, the annoyance of poorly conditioned regression is partly omitted.

Solutions as implicit models for each equation dx_i / dt. The columns are the regressor parameters and the rows are the identified equations, with description of the LHS guess, the equation's fit to training data and the model's index: 1617359354_4896944_implicit_sols 1617359358_3707457_implicit_sols 1617359361_469719_implicit_sols 1617359368_793456_implicit_sols

Simulation of the identified model next to the analytical model used for training data generation. When constructing the full model from the identified equation, the equations with the best fits were picked: https://user-images.githubusercontent.com/55796835/113409524-c21b5e00-93b1-11eb-8a7f-8f266dc609fd.mp4

Decomposing the implicit equation for dx3 / dt into terms: dx_3_terms

Some of the terms have relatively very little energy. This might mean that some terms are dominant, and some are less pronounced or only pronounced in specific conditions - gathering testing data in those conditions would be beneficial for more accurate model. For example, if the forcing is too weak, the pendulum never gets to the upper position and therefore there's no information about the dynamics around the unstable singularity state-space point, which is very important in the actual dynamics.