Photoionization by a variational approach: A simple application to the hydrogen atom