I implemented the Shooting Method to numerically solve the 1D stationary Schroedinger Equation for the infinite potential pot with walls located at 0 and 1. Now I want my numerical solution for the wavefunction psi(x) to be normalized. This means that the integral from 0 to 1 of the probability of residence density rho(x)= |psi(x)|^2 has to equal 1, since there is a 100 percent chance to find the particle within the interval 0 to 1. So I have the normalization condition int(0,1) rho(x) dx = 1. I tried to implement a normalization function using the numeric integration simpson rule, but it doesn't work appropriately for higher energy states. Has anyone got an idea how to improve?
So I have psi(x) and x as numpy arrays.
def normalize_psi(psi, x):
int_psi = scipy.integrate.simps(psi,x)
return psi/int_psi
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…