Ambiguity in growth_rates, eigenvalues, and toy data for Tutorial #2
klapo opened this issue · comments
The objective
It appears like the eigenvalues from the exact DMD (and related quantities like frequency and growth_rate) are not what I would expect intuitively. Further, solutions for the eigenvalues from the optDMD and BOP-DMD strongly disagree with those from the exact DMD. This can be cleanly shown using tutorial 2. So my questions are:
- Am I misunderstanding the interpretation of the dmd growth rate, frequency, and eigenvalues?
- How can we resolve the apparent difference in definition for the eigenvalues between the optDMD/BOP-DMD and the base DMD class?
- Would it be acceptable for me to create a pull request with an update to Tutorial 2 that makes use of the more explicit form of the temporal dynamics (of course assuming I did not go off the rails)?
Already tried tests
Tutorial 2 uses the below toy data:
data = [2/np.cosh(x1grid)/np.cosh(x2grid)*(1.2j**-t) for t in time]
Specifically, the time component is
Due to the particulars in how python handles the order of operations with imaginary numbers, the time component ends up with a real, negative exponent -- the time dynamics decay with time instead of being pure oscillations.
This result can be seen using the example code and figure. Note, I include an explicit form of the time component that matches the actual time dynamics. The explicit form makes the temporal dynamics simpler to understand (at least for my non-applied math self):
t = np.arange(0, 20, 0.4)
plt.plot(t, ((1.2) * 1j**-t).real, label='(1.2) * 1j**-t')
plt.plot(t, ((1.2j)**-t).real, label='1.2j**-t', lw=2, color='k')
plt.plot(t, (np.exp(-1j * np.pi * t / 2 - 0.115 * np.pi / 2 * t)).real, label='np.exp(-1j * np.pi * t / 2 - 0.115 * np.pi / 2 * t)', ls='-.')
plt.legend()
Based on this result, I would expect an eigenvalue of
Some other details:
- The value returned by
dmd.growth_rate
is positive and not negative as one would expect for a decaying system. - The value returned by
dmd.frequency
is not 0.25. - The BOP-DMD does not include the
original_time
ordmd_time
attributes, so it fails on these methods. But, the intuitively consistent results can be extracted from the above plot of eigenvalues.
Am I missing some necessary transformation to make the DMD, BOP-DMD/optDMD, and my intuitive understanding of the system consistent with each other?