
A Method of Lines Approach for the NLSE and GPE with Python
The nonlinear Schrödinger and Gross–Pitaevskii equations govern some of the most precisely verified phenomena in physics: soliton propagation in optical fibres, matter-wave dynamics in Bose–Einstein condensates, modulational instability of nonlinear wavetrains, and the formation of rogue waves on the deep ocean. Both equations are completely integrable, and their solution manifold is rich — bright and dark solitons, breathers, cnoidal waves, and rational rogue-wave hierarchies.
This book constructs a rigorous computational atlas of those solutions. Fourteen chapters, each anchored to a closed-form exact solution, apply the Method of Lines: space is reduced to a high-order spectral operator, and the resulting differential system is integrated adaptively to pointwise accuracy of 10⁻¹⁰ or better. Conservation of the L² norm, momentum, and Hamiltonian energy is monitored as an independent diagnostic at every step. A closing chapter maps the limits of the pipeline and charts extensions toward non-integrable perturbations, stochastic forcing, and higher-dimensional collapse.
Dr. Þráinn Eiríksson is an applied mathematician who works where integrable systems meet high-accuracy scientific computing — on the numerical treatment of nonlinear wave equations in optics, cold-atom physics, and the study of rogue waves.

