Residual stresses in coating-based systems, part I: Mechanisms and analytical modeling