Replies: 1 comment
-
There's a lot you could be doing wrong, I'd suggest starting with a lower degree polynomial order. Do you know know the governing equations for your data, and therefore why it should be easy? If so, try fitting SINDy with just the library terms you know should be present. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
i tried to apply SINDy to a rather easy problem, regarding this dataset
https://ftp.esat.kuleuven.be/pub/SISTA/data/mechanical/robot_arm.dat.gz
import pandas as pd
Load the dataset
dt = 0.01
data = pd.read_csv('robot_arm.dat', sep="\s+", header=None)
x_train = data.to_numpy()
x0_train = [x_train[0,0] , x_train[0,1]]
x0_train = [0 , 0]
t_train = np.arange(0, x_train.size/2*dt, dt)
t_train_span = (t_train[0], t_train[-1])
Fit the model
poly_order = 5
threshold = 0.05
model = ps.SINDy(
optimizer=ps.STLSQ(threshold=threshold),
feature_library=ps.PolynomialLibrary(degree=poly_order),
)
model.fit(x_train, t=dt)
model.print()
Result:
(x0)' = -0.551 x0^2 x1 + 0.461 x1^3 + 0.114 x0 x1^4 + -0.901 x1^5
(x1)' = -0.251 x0 + 4.968 x0^3 + 0.533 x0^2 x1 + -23.620 x0^5 + -1.947 x0^2 x1^3 + 0.418 x0 x1^4
even a first order model fits the data better. What am I doing wrong here
Beta Was this translation helpful? Give feedback.
All reactions