Exemple #1
0
    def test_plot_operator(self):
        operator = DMDOperator(svd_rank=2,
                               exact=True,
                               forward_backward=False,
                               rescale_mode=None)

        X = sample_data[:, :-1]
        Y = sample_data[:, 1:]
        X, Y = compute_tlsq(X, Y, 0)

        operator.compute_operator(X, Y)
        operator.plot_operator()
        plt.close()
Exemple #2
0
    def test_call(self):
        operator = DMDOperator(svd_rank=2,
                               exact=True,
                               forward_backward=False,
                               rescale_mode=None)

        X = sample_data[:, :-1]
        Y = sample_data[:, 1:]
        X, Y = compute_tlsq(X, Y, 0)

        operator.compute_operator(X, Y)

        expected = np.array(
            [-0.47643628 + 0.87835227j, -0.47270971 + 0.88160808j])

        np.testing.assert_almost_equal(operator(np.ones(2)),
                                       expected,
                                       decimal=6)