-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for mrDMD division by zero error during reconstruction #122
Comments
Dear @rfmiotto, thank you for the effort! We'll check the Merge Request as soon as possible. Regarding your dubts:
|
Dear @ndem0, Thank you for clarifying. But can I say that the mrDMD cannot handle predictions? (the The solution that I propose in this PR is to limit the maximum level such that the bins at the topmost level are composed of at least 4 snapshots.
Also, I ensured that the minimum admissible step was 1, since slice step cannot be zero: The reason for doing that is because (and please, correct me if I am wrong): In the original code (I mean before this proposed commit), as we go to higher resolution levels the This approach solves for the zero slice step in To my understanding, the
Please, let me know if you agree with that or if my conclusions are wrong. Thank you and best regards, |
Dear,
I am using PyDMD package to analyze the data from my research in fluid dynamics. Particularly, with the multi-resolution DMD (mrDMD), I was obtaining a zero-division error when doing the reconstruction of the flow field. This issue was reported by other users (see #81 , for example)
Debugging
I noticed that the problem was coming from the exception of the
fit
method. That is, in the current implementation, if the number of resolution levels (used-defined parameter) is large, thefit
method would return an error. In order to fix this problem, a try-except approach was used, and the eigenvalues, DMD modes, etc. were set as zero if the exception was raised. These null values were causing the problem in the reconstruction.I solved this problem by proposing a small refactor in the
fit
method and I would like to make a pull request with the solution.Moreover, I noticed that at the end of the
fit
method, thedmd_time
andoriginal_time
dictionaries were being overwritten. It seemed to me that this is because the mrDMD cannot handle predictions yet (as mentioned in #63). So thedmd_time
was forced to be equal to theoriginal_time
.Finally, a MemoryError exception was added for when reconstructing the solutions built from large matrices and with many resolution levels.
Possible future contributions
In my research, I am interested in isolating a given physical phenomenon that occurs at a specific time interval. Since the dynamics have different spatiotemporal scales, the mrDMD came in handy. I had to implement more stuff in the MrDMD class in order to extract the modes related to the isolated temporal phenomenon. I believe that it might help other users and so, I will be pleased to include this contribution to the main source. Unit tests of these new methods will also come along.
Please, let me know what do you think of it.
Best regards,
Renato Miotto
The text was updated successfully, but these errors were encountered: