added option to compute the lyap resid