Casimir energy of frequency dependent interactions