Dear Pysindy developers:
I hope to use Pysindy to discover the continuity equation of a compressible fluid ρ_t + (ρ v)_x = 0 from the time and spatial-dependent data ρ(x,t) and v(x,t).
Since the time derivative only acts on ρ_t, I tried to use SINDyCP to input v(x,t) as the control variables. However, it is not clear to me how to do so. I hope to input ρ(x,t) and v(x,t) as two-dimensional arrays with x and t grids so I can use the finite difference method to compute the derivative terms.
(rho_feature)' = -0.001 v_para rho_feature + 0.630 v_para_1 rho_feature_1
(v_para)' = -0.011 v_para rho_feature + 39.841 v_para_1 rho_feature_1 + -210639.142 v_para_1 rho_featurerho_feature_1 + 210248.267 v_parav_para_1 rho_feature_1
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
Cell In[3], line 170
167 model = ps.SINDy(feature_library=lib, optimizer=opt, feature_names=["rho_feature","v_para"])
169 model.fit(rho, u=v, x_dot=rhot)
--> 170 model.print()
File [/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pysindy/pysindy.py:538](http://localhost:8888/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pysindy/pysindy.py#line=537), in SINDy.print(self, lhs, precision)
536 elif lhs is None:
537 if not sindy_pi_flag or not isinstance(self.optimizer, SINDyPI):
--> 538 names = "(" + feature_names[i] + ")"
539 print(names + "' = " + eqn)
540 else:
IndexError: list index out of range
I find it confusing. Especially, it outputs the fitted equation for both "rho_feature" and "v_para", but I only want to fit "rho_feature".
As I am new to PySINDy, I would appreciate it if you could explain to me a bit about how to treat such PDE-finding cases where your control parameters [in this case v(x,t)] have the same space-time grid as the data [in this case rho(x,t)]. Thank you!
Dear Pysindy developers: I hope to use Pysindy to discover the continuity equation of a compressible fluid
ρ_t + (ρ v)_x = 0
from the time and spatial-dependent dataρ(x,t)
andv(x,t)
.Since the time derivative only acts on
ρ_t
, I tried to use SINDyCP to inputv(x,t)
as the control variables. However, it is not clear to me how to do so. I hope to inputρ(x,t)
andv(x,t)
as two-dimensional arrays withx
andt
grids so I can use the finite difference method to compute the derivative terms.Here is what I tried:
When I run this, I get following output:
I find it confusing. Especially, it outputs the fitted equation for both
"rho_feature"
and"v_para"
, but I only want to fit"rho_feature"
.As I am new to PySINDy, I would appreciate it if you could explain to me a bit about how to treat such PDE-finding cases where your control parameters [in this case
v(x,t)
] have the same space-time grid as the data [in this caserho(x,t)
]. Thank you!