## 1 Introduction
[PERSON] [19] presented an equivalent circuit that represented the inefficiency of the zero-sequence current which also becomes a compensator of said current when the sign is changed to that of the reactances. Like the previous studies, it is also only valid for balanced systems. In 2015, [PERSON] and [PERSON] [20] extended their previous work for three-wire systems [21; 22] to four-wire systems. They showed that the unbalanced power in four-wire systems is due to a negative-sequence current and a zero-sequence current. To compensate for these currents, it was necessary to use at least two compensators. This conclusion was also reached earlier by [PERSON] and [PERSON] [19] and in the current study. Finally, in 2018, [PERSON] et al. [23] developed a mathematical model that they call the balanced capacitive compensator (BCC). The algorithm eliminated the positive reactive power, as well as the negative-sequence and zero-sequence currents. They used single-phase capacitor banks. To implement the mathematical model, the nature and values of the loads need to be known and several computer programs are necessary. However, as in all previous papers, it is only valid for systems with balanced voltages. From the analysis of the methods mentioned above it was observed that they have limitations. This is mainly because they are designed to work with balanced voltages. In addition, they consider that the imbalances of the voltages are due to the load of the analyzed system and not to the characteristicsof the network itself. These types of limitations are resolved in the compensation proposal presented in this work. That is, it is valid for unbalanced voltages and independent of the values and characteristics of the load. The present work shows the development of a compensating circuit for the zero-sequence current (ZSCC) that consumes the load in a three-phase four-wire system with unbalanced voltages and unbalanced currents. This compensator, together with the compensating circuits of the negative-sequence currents (NSCC) and the positive-sequence reactive component (SVC) for three-wire networks, developed by [PERSON] and colleagues [14], constitute a procedure of total compensation for the inefficient currents. Therefore, the present study is a continuation of said work, and gives a solution to the interactions between the sequence currents caused by each compensator in four-wire electrical systems. The compensating circuits are connected in parallel to the load in the bus, so that the network in the bus only provides a positive-sequence active currents system. The current flowing through the neutral wire is zero. This procedure provides maximum efficiency downstream of the bus (i.e., the unit for the power factor). Thus, a procedure of total optimization of an electrical system is presented, which, given the characteristics of passive compensators, makes it effective when the loads are stationary or of low variability over time. The described procedure allows adaptability to hybrid compensation systems, thus increasing their versatility. In addition, it provides great robustness and low cost compared to active or hybrid systems. This entails great benefits, since the network will always provide a balanced system of positive-sequence currents in the bus, even if the load is single-phase. No current will flow through the neutral wire, and the losses in the network will be minimal. To determine the values of the reactances that make up the compensation circuits, it is enough to know the line-to-neutral voltages and the line currents in the bus, not the characteristics and the way of connecting the load. It is also not necessary to know the state of the network upstream of the bus, since the compensators adapt to the voltage and current values obtained in the bus at all times. The remainder of this article is structured as follows. In Section 2, the expressions of the powers to be used in this paper are established.