Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fourier transform and 2nd derivative matrix corrections #232

Merged
merged 8 commits into from
May 5, 2023

Conversation

michaelcdevin
Copy link
Collaborator

@michaelcdevin michaelcdevin commented May 4, 2023

Description

This corrects two mathematical issues in the code:

  1. The core.td_to_fd function no longer multiplies the DC and Nyquist frequency by two, since these frequencies would not have Hermitian symmetry and therefore should not by doubled when converting from a double-sided to a single-sided spectrum
  2. A second derivative matrix, core.derivative2_mat, has been added to correctly enable acceleration calculations from position. With Remove sine component of 2-point wave #191, the final velocity term is (correctly) zero, so performing derivative_mat @ velocity returns zero for the final acceleration term as well, though this should usually be nonzero. An explicit second derivative matrix allows for this term to be captured via derivative2_mat @ position instead of using derivative_mat twice on the position vector.

Type of PR

  • Bug fix
  • New feature
  • Documentation
  • Other: (specify)

Checklist for PR

@michaelcdevin michaelcdevin marked this pull request as ready for review May 4, 2023 17:55
Copy link
Member

@cmichelenstrofer cmichelenstrofer left a comment

Choose a reason for hiding this comment

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

Didn't read all the tests but core and pto.py look good!

@michaelcdevin michaelcdevin merged commit 2bff24e into sandialabs:main May 5, 2023
@cmichelenstrofer
Copy link
Member

cmichelenstrofer commented May 5, 2023

@michaelcdevin we still need to figure out why the PI controller still has arbitrary last frequency.

@michaelcdevin
Copy link
Collaborator Author

Agreed, I'm looking into this a bit now. Let's address that in #225

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.

2 participants