Skip to content

Conversation

@pavelkomarov
Copy link
Collaborator

The analysis is in.


# If odd, make N even, and pad x
L = len(x)
if L % 2 != 0:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adding an entry stuff isn't necessary, because you can just zero the Nyquist term in your k array if N is even, and you'll have no Nyquist term if N is odd. I form k as I do in spectral-derivatives now.

L = len(x)
if L % 2 != 0:
N = L + 1
x = np.hstack((x, x[-1] + dt*(x[-1]-x[-1])))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this x[-1] + dt*(x[-1]-x[-1]) = x[-1]. It was probably meant to be x[-1] + dt*(x[-1]-x[-2]).

@pavelkomarov pavelkomarov merged commit 4b36391 into master Jul 18, 2025
1 check passed
@pavelkomarov pavelkomarov deleted the chebyshev branch July 18, 2025 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant