Skip to content
New issue

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

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

Already on GitHub? # to your account

Harmonic Oscillator - Comparison of the analytical and numerical solution #38

Open
Hanna2003 opened this issue Jan 20, 2025 · 0 comments

Comments

@Hanna2003
Copy link

Hi,

I wanted to compare the eigenvalues obtained from 1D_harmonic_oscillator.py to the analytical solution to the 1D harmonic oscillator, which is given by $E_n = (n+0.5) \hbar \omega$, where $\omega=\sqrt{k/m}$. Therefore, I wrote the following code to calculate the relative deviation of the numerical solution from the analytical solution:

Image

However, the resulting relative deviation is unexpectedly high (factor 25 to 26):

Image

Is there a mistake in my code? Did I use the wrong units?

Thank you very much!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant