## 1 Introduction
#### Foundations: Literature Review  
In sinusoidal conditions, [PERSON] established his theory of power, which with slight modifications remains in force to-day. However, it is essential to know the electrical energy balances in any microgrid to be able to make the right decisions for its control and optimization. In these conditions, the apparent power is defined by \(S=P+jQ\), where P is the active power, \(Q\) is the reactive power and \(j\) is the imaginary unit. In non-sinusoidal conditions, [PERSON] and [PERSON] formulated the first power equations for n-sinusoidal operation between 1920 and 1930. The first author [18], addressed the question in the frequency domain. He defined the distortion power as:  
\[D_{B}^{2}={S_{B}}^{2}-\left(P^{2}+Q_{B}^{2}\right) \tag{1}\]  
where \(P=\sum\limits_{n}{U_{n}I_{n}\cos\phi_{n}}\), \(Q_{B}=\sum\limits_{n}{U_{n}I_{n}\sin\phi_{n}}\) and \(S_{B}\) are the active, reactive and apparent powers, respectively. The second author [21], developed the current decomposition into active (\(i_{a}\)), and reactive (\(i_{r}\)) currents in the time domain. The active current is given by:  
\[i_{a}=\frac{P}{\left\|{u(t)}\right\|^{2}}u(t)=G_{e}u(t) \tag{2}\]  
where \(G_{e}\) is associated to an equivalent conductance of the arbitrary linear load. The residual part of the total current, is named reactive or non-active current:  
\[i_{r}=i-i_{a} \tag{3}\]  
The rms values of the currents fulfil the equality:  
\[\|i_{r}\|^{2}=\|i\|^{2}-\|i_{a}\|^{2} \tag{4}\]  
and the scalar product of these currents is given by:  
\[\langle i_{a},i_{r}\rangle=\frac{1}{T}\int_{0}^{T}{i_{a}i_{r}dt}=\frac{1}{T} \int_{0}^{T}{i_{a}(i-i_{a})dt}=0 \tag{5}\]  
If (4) is multiplied by \(\|u(t)\|^{2}\) it is seen that:  
\[{Q_{r}}^{2}=S^{2}-P^{2} \tag{6}\]  
where \(Q_{r}\
eq Q_{B}\), \(P\), \(S\), are the nonactive, active and apparent powers, respectively. Motivated by these theories, numerous valuable works have appeared as mentioned above, but not all of them consider the multivectorial character of apparent power components. In this context, in reference [27] the authors use geometric algebra to define a multivector power based on decomposition of the instantaneous current into the active and reactive components. It should be noted that this approach does not distinguish between reactive and distortion power from a mathematical viewpoint. They state that the scalar part of the apparent power represents the average power (active power). Furthermore, the bivectorial part of the apparent power contains power components involving like-frequency and cross-frequency products which are not suitable for reactive and/or distortion compensator design. Moreover, a serious limitation of this theory is based on the difficulty to consider voltage phase angles. This restriction will probably lead to erroneous results. In particular [28] is an important and original contribution to the power analysis in non-sinusoidal networks. This theory was extended by the author for linear circuits in n-sinusoidal conditions [29]. In [30], [PERSON] et al. have analysed power flows under n-sinusoidal conditions via GA as new advance in power theory. The large number of papers published on the physical and/or mathematical nature of distortion power and their applications, suggest that work in this field is not finished. Forthis reason, in this paper a complete solution to the power theory analysis and particularly the distortion power concept for single-phase periodic n-sinusoidal linear and nonlinear operation and its relation to the optimization of energy control is presented. This power concept is based on a new frequency-domain approach, which uses geometric algebra [31; 32; 33; 34], to define and calculate any component of the distortion power as a bivector from a generalized complex geometric algebra (GCGA). Thus, the distortion power bivector incorporates in a single equation all required information (magnitude, direction, and sense) where the experimental phenomena are implicit.