Skip to content

Commit 0f260f2

Browse files
nmankmtezzele
authored andcommitted
changed create_system_without_B in test_dmdc to generate time lags greater than 1
1 parent f007cf8 commit 0f260f2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tests/test_dmdc.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@ def create_system_with_B():
1212
return {"snapshots": snapshots, "u": u, "B": B}
1313

1414

15-
def create_system_without_B():
15+
def create_system_without_B(lag = 1):
1616
n = 5 # dimension snapshots
1717
m = 15 # number snapshots
1818
A = scipy.linalg.helmert(n, True)
1919
B = np.random.rand(n, n) - 0.5
20-
x0 = np.array([0.25] * n)
21-
u = np.random.rand(n, m - 1) - 0.5
22-
snapshots = [x0]
23-
for i in range(m - 1):
20+
snapshots = []
21+
for i in range(lag):
22+
snapshots.append(np.array([0.25] * n))
23+
u = np.random.rand(n, m - lag) - 0.5
24+
for i in range(m - lag):
2425
snapshots.append(A.dot(snapshots[i]) + B.dot(u[:, i]))
2526
snapshots = np.array(snapshots).T
2627
return {"snapshots": snapshots, "u": u, "B": B, "A": A}

0 commit comments

Comments
 (0)