Nonlinear Schrödinger equation solver.