Analysis of lossy waveguide circuits by the BI-RME method and a perturbation technique