New answers tagged

3

Test your code. "I don't know if my linear algebra routines work or not" is a problem you can solve easily. It is easy to check if you have computed the correct eigenvalues or not; just check that $VDV^{-1}=H$, or if you don't fancy the inversion $HV=VD$. If you are not sure that your individual pieces work, you are walking in the dark. Possibly a hot take: ...


1

Your whole code is not understandable to me. Try this alternative components: int grid(int i, double a, double h) { return a+i*h; } int index(int i, int j, int N) { return i*N+j; } //potential function. returns the integral over the grid square indexed by i double V(int i, double x0, double hx, int j, double y0, double hy) { double xi=grid(i,...


Top 50 recent answers are included