nansencenter / DAPPER

Data Assimilation with Python: a Package for Experimental Research
https://nansencenter.github.io/DAPPER
MIT License
348 stars 122 forks source link

Linear dynamic from `linear_model_setup()`, matrix power instead of multiplication. #10

Closed xhu4 closed 5 years ago

xhu4 commented 5 years ago

Currently the linear_model_setup defines the model and jacob method as

  def model(x,t,dt): return dt*(ModelMatrix@x)
  def jacob(x,t,dt): return dt*ModelMatrix

If I understand it correctly, shouldn't it be something like this?

  def model(x,t,dt): return np.linalg.matrix_power(ModelMatrix, dt) @ x
  def jacob(x,t,dt): return np.linalg.matrix_power(ModelMatrix, dt)
patnr commented 5 years ago

Yes, that would be better. There are complications:

This has been taken care of in this patch: https://github.com/nansencenter/DAPPER/commit/83ee9df6d657bbcdc39d73794eec15ab78a96b2b