Text this: Variational principles and the numerical solution of scattering problems