Electromagnetics and optoelectronics