The variational theory of complex rays for the calculation of medium‐frequency vibrations