Numerical Simulation of Nonlinear Schrödinger Equation in One and Two Dimensions