Adjoint analysis of a multi-layer slab