The wave–corpuscle duality of microscopic particles depicted by nonlinear Schrödinger equation