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

Formula and code for energy spectrum is wrong #84

Open
rshayduk opened this issue May 25, 2021 · 2 comments
Open

Formula and code for energy spectrum is wrong #84

rshayduk opened this issue May 25, 2021 · 2 comments
Labels

Comments

@rshayduk
Copy link

rshayduk commented May 25, 2021

should be replaced by E_i=(Ai^2+Bi^2)Wi^2mi, in which mi=Xi_tMXi, in which Xi is the ith eigenvector, and M is the mass matrix and _t stands for the transpose. In other words, Xi_tMXi is matrix notation of the scalar product of the two vectors, Xi and MXi, i.e. Xi.MXi.

@dschick
Copy link
Owner

dschick commented May 26, 2021

thanks @rshayduk for pointing this out

you are referring to this line of code
E[i, :] = 0.5 * (A[i, :].T**2 + B[i, :].T**2) * omega**2 * masses * np.sum(Xi**2, 0).T
so the correct form would be:
E[i, :] = (A[i, :].T**2 + B[i, :].T**2) * omega**2 * Xi.T*masses*Xi

@rshayduk
Copy link
Author

rshayduk commented Jun 14, 2021

I am not sure I understand. Is Xi the i-th eigenvector or a matrix?

@dschick dschick added the bug label Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants