Enviar rexistro por email: A Study on an Out-of-Step Detection Algorithm Using the Time Variation of Complex Power: Part I, Mathematical Modeling