  The calculation of the transfer matrix for a large non-periodic multilayered
system may become unstable in the presence of absorption. We discuss the origin
of this instability and we explore two methods to overcome it: the use of a
total matrix to solve for all the fields at all the interfaces simultaneously
and an expansion in the Bloch-like modes of a periodic artificially repeated
system. We apply both methods to obtain the reflectance spectra of multilayered
chirped structures composed of nanostructured porous silicon (PS). Both methods
yield reliable and numerically stable results. The former allows an analysis of
the field within all layers while the latter is much more efficient
computationally, allowing the design of novel structures and the optimization
of their parameters. We compare numerical and experimental results across a
wide spectral range from the infrared to the ultraviolet.
