Analysis and Numerical Solution of Generalized Lyapunov Equations