Relaxational approach to solving the Schrödinger equation