def Identified_Model(y, t, library, estimator) :
'''
Simulates the model from Sparse identification.
Inputs
------
library: library object used in the sparse identification
(e.g. poly_lib = PolynomialFeatures(degree=3) )
estimator: estimator object obtained from the sparse identification
Output
------
dy : numpy array object containing the derivatives evaluated using the
model identified from sparse regression.
'''
dy = np.zeros_like(y)
lib = library.fit_transform(y.reshape(1,-1))
Theta = block_diag(lib, lib, lib)
dy = Theta.dot(estimator.coef_)
return dy
评论列表
文章目录