Skip to content

Commit 3538bc3

Browse files
committed
Differentiation with complex
1 parent 748f494 commit 3538bc3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pydmd/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def differentiate(X, dt):
233233
raise ValueError("Please ensure that input data is a 1D or 2D array.")
234234
if X.ndim == 1:
235235
X = X[None]
236-
X_prime = np.empty(X.shape)
236+
X_prime = np.empty(X.shape, dtype="complex")
237237
X_prime[:, 1:-1] = (X[:, 2:] - X[:, :-2]) / (2 * dt)
238238
X_prime[:, 0] = (-3 * X[:, 0] + 4 * X[:, 1] - X[:, 2]) / (2 * dt)
239239
X_prime[:, -1] = (3 * X[:, -1] - 4 * X[:, -2] + X[:, -3]) / (2 * dt)

0 commit comments

Comments
 (0)