-
Notifications
You must be signed in to change notification settings - Fork 359
Description
I am trying to add a y and yM2 to the polynomial library. y is equal to y0 + epsilont, where epsilon and y0 are fixed and defined. However when i do this, it fits two seperate y's to the model. How do I fix this to have only one y in the candidate function library.
M = np.stack((m1, m2), axis=-1)
poly_library = ps.PolynomialLibrary(degree=3)
y_functions = [
lambda t: y0 + epsilon * t,
lambda x, t: x[1] * (y0 + epsilon * t),
]
y_function_names = [
lambda t: 'y',
lambda x, t: 'y M2',
]
y_library = ps.CustomLibrary(
library_functions=y_functions,
function_names=y_function_names
)
combined_library = y_library
differentiation_method = ps.FiniteDifference(order=2)
optimizer = ps.STLSQ(threshold=0.01)
model = ps.SINDy(
differentiation_method=differentiation_method,
feature_library=combined_library,
optimizer=optimizer,
feature_names=["M1", "M2"],
)
model.fit(M, t=t)
model.print()