A functional framework for electromagnetics under realistic assumptions