Modeling of Inhomogeneous and Lossy Waveguide Components by the Segmentation Technique Combined With the Calculation of Green's Function by Ewald's Method