We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cee0025 commit cdd8788Copy full SHA for cdd8788
tests/test_bopdmd.py
@@ -641,3 +641,22 @@ def test_getter_errors():
641
642
with raises(ValueError):
643
_ = bopdmd.amplitudes_std
644
+
645
646
+def test_fit_econ():
647
+ """
648
+ Test that the fit_econ method gives the same results as the fit method.
649
650
+ svd_rank = 2
651
+ bopdmd = BOPDMD(svd_rank=svd_rank, use_proj=True)
652
+ bopdmd.fit(Z, t)
653
654
+ U, s, V = np.linalg.svd(Z)
655
+ U = U[:, :svd_rank]
656
+ s = s[:svd_rank]
657
+ V = V[:svd_rank, :]
658
+ bopdmd_econ = BOPDMD(svd_rank=svd_rank, use_proj=True, proj_basis=U)
659
+ bopdmd_econ.fit_econ(s, V, t)
660
661
+ np.testing.assert_allclose(bopdmd_econ.eigs, bopdmd.eigs)
662
+ np.testing.assert_allclose(bopdmd_econ.modes, bopdmd.modes)
0 commit comments