@@ -114,7 +114,7 @@ def ignore_specific_warnings():
114114x_dot_test_predicted = model .predict (x_test )
115115
116116# Compute derivatives with a finite difference method, for comparison
117- x_dot_test_computed = model .differentiate (x_test , t = dt )
117+ x_dot_test_computed = model .differentiation_method . _differentiate (x_test , t = dt )
118118
119119fig , axs = plt .subplots (x_test .shape [1 ], 1 , sharex = True , figsize = (7 , 9 ))
120120for i in range (x_test .shape [1 ]):
@@ -168,7 +168,7 @@ def f(x):
168168x_train_map [0 ] = 0.5
169169for i in range (1 , n_steps ):
170170 x_train_map [i ] = f (x_train_map [i - 1 ]) + eps * np .random .randn ()
171- model = ps .SINDy ( discrete_time = True )
171+ model = ps .DiscreteSINDy ( )
172172model .fit (x_train_map , t = 1 )
173173
174174model .print ()
@@ -782,7 +782,7 @@ def f(x):
782782x_dot_test_predicted = model .predict (x_test )
783783
784784# Compute derivatives with a finite difference method, for comparison
785- x_dot_test_computed = model .differentiate (x_test , t = dt )
785+ x_dot_test_computed = model .differentiation_method . _differentiate (x_test , t = dt )
786786
787787fig , axs = plt .subplots (x_test .shape [1 ], 1 , sharex = True , figsize = (7 , 9 ))
788788for i in range (x_test .shape [1 ]):
@@ -905,7 +905,7 @@ def u_fun(t):
905905x_dot_test_predicted = model .predict (x_test , u = u_test )
906906
907907# Compute derivatives with a finite difference method, for comparison
908- x_dot_test_computed = model .differentiate (x_test , t = dt )
908+ x_dot_test_computed = model .differentiation_method . _differentiate (x_test , t = dt )
909909
910910fig , axs = plt .subplots (x_test .shape [1 ], 1 , sharex = True , figsize = (7 , 9 ))
911911for i in range (x_test .shape [1 ]):
@@ -1105,7 +1105,7 @@ def u_fun(t):
11051105 num_parameters = 1 ,
11061106)
11071107opt = ps .STLSQ (threshold = 1e-1 , normalize_columns = False )
1108- model = ps .SINDy (feature_library = lib , optimizer = opt , discrete_time = True )
1108+ model = ps .DiscreteSINDy (feature_library = lib , optimizer = opt )
11091109model .fit (xs_train , u = rs_train , t = 1 , feature_names = ["x" , "r" ])
11101110model .print ()
11111111
0 commit comments