Generalized dynamic average modeling of line-commutated converter systems in transient simulation programs