  Accurate and fast modeling of electric fields in layered structures have a
great scientific and practical value. Prevalent method for that is
transfer-matrix method. However, transfer matrix method is limited to infinite
plane wave calculations, which can become a limiting factor if a very narrow
resonances, e.g. long range surface plasmon polaritons, are present in the
structure. In this paper we extend the functionality of standard and nonlinear
transfer-matrix method to include beams with arbitrary profile and propose
applications for the method.
