Skip to content
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

Computation error when having negative eigenvalues #115

Closed
xlrobotics opened this issue Dec 27, 2019 · 1 comment
Closed

Computation error when having negative eigenvalues #115

xlrobotics opened this issue Dec 27, 2019 · 1 comment

Comments

@xlrobotics
Copy link

There's a numerical issue at line 90-91 of the file dmdc.py (there are several other places having the same issue), such that when self.eigs are negative, np.log() will return nan.

omega = old_div(np.log(self.eigs), self.original_time['dt'])
eigs = np.exp(omega * self.dmd_time['dt'])

Mathematically these two lines can be merged together to avoid having negative value inside the logarithm.

I solved this by changing to
eigs = np.power(self.eigs, old_div(self.dmd_time['dt'], self.original_time['dt']))

Please let me know if there are better solutions, thanks!

@xlrobotics xlrobotics changed the title Computation error when having negative eigenvalues of the Computation error when having negative eigenvalues Dec 27, 2019
@mtezzele
Copy link
Contributor

Hi @xlrobotics, sorry for the late reply. Now this issue should be fixed with your solution, at least for dmdc (see #118). Thanks for letting us know the problem!

@ndem0 ndem0 closed this as completed Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants