A Powerful Tool for Optimal Control of Energy Systems in Sustainable Buildings: Distortion Power Bivector

In the field of building constructions, there is undeniably a growing need to optimize the energy systems which are a key target in new modern constructions and industrial buildings. In this sense, energy systems are being traced for the development of energy distribution networks that are increasingly smart, efficient, and sustainable. Modern generation and distribution energy systems, such as microgrids control systems, are being affected by the presence of linear and nonlinear loads, resulting a distorted voltage and current waveforms. Thus, it is stated that industrial and residential building heating and cooling loads behave essentially like sources of harmonics. This paper presents a new framework based on geometric algebra (GA) to the definition of a multivectorial distortion power concept, which is represented by a bivector that is geometrically interpreted to distinguish the rotated distortion and distortion power bivectors in these kinds of loads. Both bivectors, and their relations to the phase angles of distorted voltage are the main subject of this paper to interpret an optimal control of building energy. Numerical examples are used to illustrate of the suggested distortion power concept, as well as the information it provides for energy control in new buildings in a more sustainable way.


Introduction
Nowadays, the electric power system has become one of the fundamental installations in construction. A new architecture is not only sustainable by the control of its energy, but also by the optimization of the installation and design itself.
One of the most controversial issues in electrical engineering applications is the universal representation of the power equation of electrical systems in harmonic pollution situations. Moreover, the confusion extends to the concepts of reactive, not active and distortion powers. This is partly due to the proliferation of linear and non-linear loads connected to the circuits in the buildings. The ever-growing proliferation of power switching devices in modern industrial applications has increased the eventuality of unbalanced currents, unacceptable harmonic levels, and poor power factor in distribution systems. A clear example is seen in distributed generation systems, smart buildings or control systems, where many receivers are installed such as cycloconverters, speed drives, household appliances, battery power converters, power inverters and more. Thus, "modern home appliances are increasingly adopting power electronic frontends nowadays due to energy efficiency considerations. This trend has led to increased harmonic distortions in building power distribution systems and its supply transmission systems" [1]. Some works have been published to analyse this issue. For example, [2] investigates the current and voltage unbalance of nonlinear consumers in the residential and educational sectors. In [3], the objective is to present a systematic, and versatile technique to study the harmonic impact of residential load. Reference [4] presents a study of the use of active filters placed at different locations for harmonic mitigation methods in wind plants. Reference [5] proposed the harmonic compensation method on a residential distribution system and in [6], an advanced model is used to retrieve data from publications related to energy quality.
The result of using such a high number of non-linear loads in buildings is that the current waveform is distorted, causing excessive harmonic voltages to be generated. This situation feeds back and causes a progressive degradation to the power quality of the supply [7]. In [8] a new indicator designated called a power quality factor (PQF) is suggested to integrally reflect the power transfer quality of a general three phase network feeding non-linear loads. Modern energy generation and distribution systems are a great advance for today's society, since they allow better management and integration of energy with new sources such as renewable energy, wind energy, solar energy, nuclear energy etc. These systems, such as multi-energy micro grids (MEMGs) are composed by distributed generators with adequate placement for the system energy efficiency [9].
Also, the proximity of many of these buildings with similar industrial activities will contribute to the distortion of the electric power quality of feed supplying these constructions. These harmonics can cause serious problems in the power system of industrial architecture, for example excessive heat in industrial appliances, premature aging of electrical equipment, de-rating of equipment, fault of protection and lower power factor or inefficiencies in the transmission of energy. In different countries buildings are responsible for the 21-25% of total energy consumption and the amount of this energy used for heating and cooling systems is about 55% in the residential sector [10]. It is a situation that causes a progressive degradation to the power quality of the supply, [11] give a description of state of the art for the distributed power generation systems (DPGS) based on renewable energy; in [12] an extensive survey of loads is conducted in various residential buildings and [13] aimed to analyse the individual influences, which aggravate the power quality of the distribution grid. In this sense, other lines of research related to heating and cooling loads of industrial and residential buildings analyse the phase change materials as cold thermal energy storage media for district cooling [14].
These harmful and costly effects of harmonics have been discussed extensively and spurred stringent requirements by international institutions regarding the allowed levels of harmonics at the point of connection to the power supply [15], (IEEE Recommended Practice and Requirements for Harmonic Control in Electric Power Systems). On the other hand, as is well known, a phase displacement between corresponding voltages and currents [16] indicates both a low utilization of the generation and distribution equipment and increased line losses for the same power consumption level.
Significant research efforts have been focussed to the analysis of this area, especially definition and interpretation of reactive and distortion powers and the challenge of developing a power theory suitable for harmonic analysis has continued forever last century In sinusoidal situations, the mathematical tools used have been based on Steinmetz theory [17]. In non-sinusoidal and linear conditions, Budeanu [18] decomposes the apparent power in active, reactive and distortion components and Shepherd et al. [19] suggest a new concept of reactive power. Likewise, in [20] a reactive power was defined that permits the derivation of the value of passive linear devices to achieve a relative optimum power factor and in [21], Fryze published his power equation in time domain.
Other formulations developed in frequency domain [22][23][24][25][26], affect the search for equations that interpret certain physical phenomena or analyse the distortion component in non-sinusoidal regimes. Among them [25], provides a meticulous discussion of the distortion power concept and [26] based on the Fourier series, assumed that the distortion power may consist of active and reactive components. Unfortunately, the mentioned work [26], needs to know the load parameters to define these components. Moreover, it is not possible to generalize this approach in vector form to any load model, because the basic quantities, voltage and current, are not ordered within a suitable mathematical structure.

Foundations: Literature Review
In sinusoidal conditions, Steinmetz 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, Budeanu and Fryze 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: where P = ∑ n U n I n cos φ n , Q B = ∑ n U n I n sin φ 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: 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: The rms values of the currents fulfil the equality: and the scalar product of these currents is given by: If (4) is multiplied by u(t) 2 it is seen that: where Q r = 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], Montoya et al. have analysed power flows under n-sinusoidal conditions via GA a 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. For this 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. In this sense, the geometrical interpretation of the distortion power bivector is quite effective to clarify its nature from a mathematical and physical nature viewpoint and optimize energy flow in distributed generation, control systems or intelligent buildings.

Mathematical Preliminaries
Geometric algebra is a mathematical structure developed over the last 40 years based on Clifford Algebras. A Geometric algebra can be defined simply by specifying appropriate rules for multiplying vectors. Thus, let V n an n-dimensional linear space over the real numbers. The geometric product of vectors a ⊗ b if a, b ∈ V n , [28], can be decomposed into a symmetric inner product: and an antisymmetric outer product: Therefore, ab has the canonical decomposition: The inner product a · b is a scalar and the outer product a ∧ b is called bivector (or 2-vector). Geometrically, it represents a directed plane, in much the same way as a vector represents a directed line segment ( Figure 1). For this 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. In this sense, the geometrical interpretation of the distortion power bivector is quite effective to clarify its nature from a mathematical and physical nature viewpoint and optimize energy flow in distributed generation, control systems or intelligent buildings.

Mathematical Preliminaries
Geometric algebra is a mathematical structure developed over the last 40 years based on Clifford Algebras. A Geometric algebra can be defined simply by specifying appropriate rules for multiplying vectors. Thus, let an n-dimensional linear space over the real numbers. The geometric product of vectors ⊗ if , ∈ , [28], can be decomposed into a symmetric inner product: and an antisymmetric outer product: Therefore, has the canonical decomposition: The inner product ⋅ is a scalar and the outer product ∧ is called bivector (or 2-vector). Geometrically, it represents a directed plane, in much the same way as a vector represents a directed line segment ( Figure 1). We can regard ∧ as a directed area with a norm ‖ ∧ ‖ equal to the usual scalar area of each parallelogram in Figure 1, with the direction of the plane in which the parallelogram lies, and sense that can be assigned to the parallelogram in the plane. Then, just as a vector represents (or is represented by) a directed line segment and a bivector ∧ We can regard a ∧ b as a directed area with a norm a ∧ b equal to the usual scalar area of each parallelogram in Figure 1, with the direction of the plane in which the parallelogram lies, and sense that can be assigned to the parallelogram in the plane. Then, just as a vector a represents (or is represented by) a directed line segment and a bivector a ∧ b represents a directed plane segment, the trivector (3-vector) a ∧ b ∧ c represents a directed space segment (the parallelepiped with edges a, b, c).
However the electrical quantities voltage and current do not have an easy interpretation in classic Clifford algebra. For a clear representation of these waveforms, a new geometric algebra has been constructed-a generalization of the classic Clifford algebra [32] which we have termed "generalized complex geometric algebra" (GCGA) and denoted by {CG n , }. In this framework, C is the complex vector space, G n is the Clifford algebra or geometric algebra associated to the n-dimensional real space V n and: is the new generalized geometric product. A detailed description of this new structure (GCGA), of the geometric product " " and their properties, are given in references [32,33].

Geometric Phasor Representation of Periodic Voltage and Current Waveforms
We start by considering periodic voltage and current waveforms of an arbitrary singlephase system. Both signals can be considered elements of the vector space with inner and outer product. Suppose a non-sinusoidal voltage u(t) = √ 2 ∑ p∈L∪ N U p sin pωt + α p where p is the harmonic order of u(t) and a current i(t) = √ 2 ∑ q∈N∪M I q sin qωt + β q where q is the harmonic order of i(t). It is assumed that a group of voltage harmonics N exist that have corresponding current harmonics of the same frequencies, that components L of the supply voltage exist without corresponding currents, and that components M of current exist without corresponding voltages. In linear operation, β q = α q − φ q , φ q is the harmonic impedance phase angle and L = {ϕ} , M = {ϕ}. The capital U p and I q represent rms values of u p (t) and i q (t). In the {CG n , } structure spanned by an orthonormal basis {σ 1, σ 2 , σ 3 , . . . σ n }, the associated p-th harmonic voltage and q-th harmonic current can be represented by the geometric-phasors: where U p = U p , I q = I q . Then: In particular, on linear operation the Equation (14) is given by I = ∑ q∈N I q e j(α q −φ q ) σ q geometric -phasor, where I q harmonic current can be decomposed as follows: The subscripts " " and "⊥" indicates "in phase" and "in quadrature" respectively. The I * q conjugate harmonic current is given by: where ( * ) is the standard "conjugate complex"operation.

Power Multivector
Consider an arbitrary nonlinear single-phase system supplied by the voltage u(t). The resulting current has an instantaneous value given by i(t). The instantaneous voltage and current signals have been defined in the section above.
In order to represent the concept of power multivector in GCGA, we introduce a new rule for multiplying geometric-phasors (complex-vectors). This rule is the new geometric product (10), where [32] is an application over complex planes and "⊗" is the standard geometric product. Apparent power can thus be expressed as a multivector S in {CG n }, generated by " " of the voltage and conjugate current geometric phasors: and which obeys the usual conservation law [33]. From Equation (17), one easily defines that power multivector is given by: which consist of a complex-scalar part Ω • = P + j Q and a complex-bivector part Ω ∧ = ∆.
In Equation (18), " " is the new "generalized complex geometric product" [32]. The components P, Q, ∆ in Equation (18), can be represented as: The generic term D pq (18) is a bivector named distortion power term and it is related with the generic term ∆ pq named rotated distortion power term: The ∆ pq terms in Equations (18) and (21), can be collected into four groups and written in a short notation related with the sets L, N and M as: Consequently, the complex-bivector part, Equation (21), named rotated distortion power, is given by: Thus, in the cross products (21), each ∆ pq term represents the interaction of voltage and current harmonics, with different frequencies. This term is associated to D pq linear and/or D pq nonlinear distortion power bivector term. More exactly, in linear operation the generic ∆ pq term represents to a D pq term (distortion power bivector) associated to a rotation defined by α p − α q angle. In non-linear operation D pq term (distortion power bivector) is associated to a rotation α p − α q and/or α p angle.
The new quantity, rotated distortion power proposed in Equation (21), have three basic attributes: magnitude, direction and sense. In the numerous situations direction and sense are not required; then the magnitude ∆ = D was established to manage a concrete problem. However, there are situations where direction and sense are necessary, as those that depend on the origin and nature of distortion. In these cases, the distortion power bivector ∆ is the appropriate quantity to solve the problem, since it incorporates in a succinct expression all required information. The convenience of one or the other is dictated by the necessities of the situation. In this sense, ∆ = D is a consequence of ∆ and both, magnitude and bivector are complementary.
It is seen from Equation (27), that due to the independence of the basis σ 1...n , the following equality is true:

Distortion Power Bivector: Admittance Matrix Representation
When the load impedance is linear, the only current harmonics that will flow must correspond to the supply voltage harmonics. Thus, in linear operation, the harmonic indexes of voltage and current, p, q ∈ N can define the quantities: whereŶ is called the n-frequency admittance matrix, G p is the p-th conductance and B p is the p-th susceptance. The multivectorial Ohm's law is now given by: where: that coincide with Equations (15) and (16), respectively. In this case, S multivector may be written in the form: Now it is seen from Equations (A2) and (34) that: and the following magnitude expressions of the active and active rotated distortion power components are obtained: where from Appendix A, Equation (A4): On the other hand, from Equations (A5) and (34) can be obtained that: Similarly, another two magnitude expressions for reactive and reactive rotated distortion powers are obtained: where from Appendix A, Equation (A7): Combination of Equations (36)-(40) gives the apparent power multivector: S = U I * = U I * + j U I * ⊥ = (P + jQ)σ 0 + ∑ p < q p, q ∈ N e j(α p −α q ) ( D pq,Act + j D pq,Re act ) = P + j Q + ∆ Note that the magnitudes of Equations (36)-(41) agree with the ones defined by a linear operation in [23,27]. These magnitudes are not simply calculated from algebraic operations, but rather they are a result of the multivectorial analysis. It should be noted that the introduction of a multivector representation became possible by employing the GCGA. In general, it can be said that today's accepted approaches cannot explain the results obtained here.

Geometric Interpretation of Distortion Power Bivectors
In the (CG n , ) algebraic structure, the bivectorial part Ω ∧ of Equations (18) and (21), can be represented as a linear combination of basis bivectors, each encoding a distinct independent pq-plane involving cross-frequency products (p = q) in n-dimensional space.
Thus, Figure 2 shows the geometric interpretation into generic pq-planes of ∆ pq rotated distortion power and the corresponding D pq distortion power term when p, q ∈ N, q = p and/or p ∈ L, q ∈ N. Therefore, it is seen that Figure 3 shows, into generic pq-planes, the geometric interpretation of ∆ pq rotated distortion power and the corresponding D pq distortion power term when p ∈ L ∪ N, q ∈ M. It can be seen from Figures 2 and 3, that the geometric interpretation of Equation (21) is based on the association of complex planes (C) to each multivectorial element of Clifford basis G n .
Similarly, in Figure 3: It is certain that the value (magnitude), = , of the distortion power does not provide information to the waveform distortion, but each distortion power bivector term, has a direct dependence of the harmonic voltage phase angles. Notice that the choice Similarly, in Figure 3: It is certain that the value (magnitude), = , of the distortion power does not provide information to the waveform distortion, but each distortion power bivector term, has a direct dependence of the harmonic voltage phase angles. Notice that the choice  Figure 2 that:

Note in
Im ∆ pq = Im e j(α p −α q ) D pq = ∆ pq,Re act (45) Similarly, in Figure 3: Im ∆ pq = Im e jα p D pq = ∆ pq,Re act (47) It is certain that the value (magnitude), ∆ = D , of the distortion power does not provide information to the waveform distortion, but each ∆ pq distortion power bivector term, has a direct dependence of the harmonic voltage phase angles. Notice that the choice of equal or zero-phased geometric-phasors for the voltage frequency components, α p = α q or α p = α q = 0, simplifies the Equations (18), (21) and (44)-(47) very much. Then, in this case, these equations are now given by: Im ∆ pq = Im D pq = ∆ pq,Re act (51) Note in Equation (46) that now " " becomes "⊗" that is the classic geometric product defined in Equation (9).

Numerical Examples
To demonstrate the validity of the concepts stated in the above section and their application to energy control in industrial architecture, two numerical examples are illustrated. Both represents a hypothetical residential and commercial load in a single energy microgrids (SEMG) with harmonic voltage source behaviour (Figure 4).
Note in Equation (46) that now "⊙" becomes "⊗" that is the classic geometric product defined in Equation (9).

Numerical Examples
To demonstrate the validity of the concepts stated in the above section and their application to energy control in industrial architecture, two numerical examples are illustrated. Both represents a hypothetical residential and commercial load in a single energy microgrids (SEMG) with harmonic voltage source behaviour (Figure 4).

Example 1
Let a periodic n-sinusoidal voltage with instantaneous value given by Figure 5), be applied to the hypothetical residential load. Note that α 1 = α 2 = 0. The resulting current ( Figure 5) has an instantaneous value: is PF =0.54 Table 1 and Figure 6, illustrate the simulation and geometric representation results.   The corresponding geometric phasors are respectively: From Equation (18), the apparent power multivector may be written as: where P 1 = 5215.4, Q 1 = 7494, ∆ 1 = 2915.82, S 1 = 9584.3 and power factor is PF 1 = 0.54 Table 1 and Figure 6, illustrate the simulation and geometric representation results. p = 1, q = 2 p = 1, q = 3 p = 2, q = 3  Table 1 and Figure 6, illustrate the simulation and geometric representation results.

Example 2
Let a periodic n-sinusoidal voltage (Figure 7) with instantaneous value given by: be applied to a hypothetical commercial building. The resulting current (Figure 7) has an instantaneous value: Energies 2021, 14, 2177 12 of 17
These two examples cannot be distinguished respect of the distortion power magnitudes of well-established distortion power approaches. One can show that in each example all the corresponding rotated distortion and distortion power magnitudes are the same: and: Accordingly, it is coherent to assume that any differentiation between both buildings must be based on the information of distortion power bivector. Only this concept can distinguish one from the other, to energy building control because it considers, voltage phase angles, magnitude, direction, and sense as can be seen in geometric representation Figure  6 and Figure 8.

Conclusions
In this paper, a new bivectorial concept has been presented to be applied in control energy systems for sustainable constructions to the distortion power under periodic nsinusoidal linear/nonlinear operation. Clifford theory turned out to be a suitable mathematical framework to introduce this new representation of distortion power bivector. It is Accordingly, it is coherent to assume that any differentiation between both buildings must be based on the information of distortion power bivector. Only this concept can distinguish one from the other, to energy building control because it considers, voltage phase angles, magnitude, direction, and sense as can be seen in geometric representation Figures 6 and 8.

Conclusions
In this paper, a new bivectorial concept has been presented to be applied in control energy systems for sustainable constructions to the distortion power under periodic n-sinusoidal linear/nonlinear operation. Clifford theory turned out to be a suitable mathematical framework to introduce this new representation of distortion power bivector. It is derived in terms of geometric phasors from a multivectorial analysis of the apparent power (18) and not only as formal cross product of the rms values of voltages and currents. Moreover, the new power components are geometrically interpreted to distinguish the rotated distortion and distortion power bivectors. This geometric interpretation permits a vectorial direct sum of all the components into complex planes, (C), defined for each multivectorial element of Clifford basis (G n ). In classical approaches this goal is not possible, and any definition of distortion power is only a secondary result of this work. Both bivectors, rotated distortion and distortion power concepts and their relation to the optimization of energy control in building heating and cooling loads are the main subject of this paper.
The potentiality of the power distortion bivector concept compared to any distortion power definition is important. Thus, analysing the results in Tables 1 and 2, the main findings of this investigation may be summarized as follows: • Rotated distortion power bivector ∆ incorporates in a single expression, Equation (21), and three attributes, namely magnitude, direction, and sense.

•
In linear and nonlinear operation, if the voltage phase angles are the same or zero, rotated distortion power ∆ coincides with distortion power bivector D ( Figure 6).

•
In a general case, rotated distortion power multivector depends of the harmonic voltage phase angles (Figure 8). • For all cases, it can be seen that ∆ = D . • Rotated distortion power ∆ is an entirely mathematical and fictitious component and nonphysical quantity.
In general, the multivectorial apparent power concept and the bivector distortion power concept (magnitude, direction and sense) are fundamental for a correct identification of harmonic source locations, power factor improvement, power quality indexes, dependency of the voltage phase angles and their physical interpretation, etc.
Their application to electronic loads in today's microgrid allows one to control the energy of the load in vector form, considering its real and imaginary components when the phase angles present in the voltage harmonics differ from zero. In our case, residential building heating and cooling loads can inject higher harmonic currents than those comparable in industrial loads. Consequently, the harmonic spectra of these two types of loads are quite different where the 3rd harmonic is highly noticeable for residential feeders.
The suggested representation can provide a new language for the design of compensator systems, optimization algorithms or power quality indexes, that will help the design of more efficient energy networks in buildings and sustainable architecture. In this sense, the study of new applications is open it could be a task that deserves further research.
Author Contributions: Both authors have contributed equally to this work. Both authors wrote, reviewed and commented on the manuscript. Both authors have read and approved the final manuscript.

Funding:
The authors received no specific funding for this work.

Institutional Review Board Statement: Not applicable.
Informed Consent Statement: Not applicable.

Conflicts of Interest:
The authors declare no conflict of interest.

A. Nonlinear group of bivectorial components
Let: I = ∑ q∈N∪ M I q e j(α q −φ q ) σ q q∈N + I q e jβ q q∈M (A10) Be a geometric-phasor, where I q is the q-th harmonic current. The total nonlinear group of bivectorial components are given by: where: