## 1 Introduction
These EMSs, and others designs based on FLC [27], pursue a common main objective, which consists of smoothing the power profile exchanged from the MG to the utility network. However, the design of the FLC block involved within these EMSs requires the selection of several parameters such as the type and number of membership functions, rule base, and variation range of each variable. Therefore, a first approach to perform the parameter adjustment of an FLC controller that is part of the EMS of a residential grid-connected microgrid is developedin [28]. This approach performs an off-line parameter tuning of the FLC of an EMS using the real recorded data of RES production and load consumption in one year. However, the selection of the FLC parameters can be seen as an optimization problem that could be formulated in terms of a cost/objective function [29]. Fortunately, in addition to costly and time-consuming traditional optimization techniques, several metaheuristic nature-inspired algorithms have been proposed to solve optimization problems in a wide range of applications [30; 31; 32; 33]. Some examples of these nature-inspired algorithms that can be found in the literature are genetic algorithms [34], differential evolution (DE) [35], ant colony optimization [36], particle swarm optimization (PSO) [37], firefly algorithm [38], Cuckoo search (CS) [39], among others. In this regard, to improve the parameter adjustment procedure described in [28], a methodology based on the CS algorithm is presented in [40; 41]. This approach is applied to the EMS of a residential grid-connected electro-thermal microgrid, improving its performance in terms of smoothing (i.e., minimizing power peaks and fluctuations) the power profile exchanged with the utility network. Hence, to analyze the behavior of other nature-inspired algorithms, this paper evaluates a methodology for adjusting the FLC parameters of the EMS of a residential grid-connected electro-thermal microgrid through two metaheuristic nature-inspired algorithms, namely PSO and DE. Although there are many nature-inspired optimization algorithms, PSO, DE, and CS are the most classical examples of nature-inspired techniques that are based on different search strategies [42]. DE is a heuristic evolutionary optimization algorithm developed for solving real-valued numerical optimization problems [35]. It is a very effective global search algorithm with a simple mathematical structure. On the other hand, PSO is a stochastic and multi-agent parallel global-search technique [37], which, unlike DE, is based on the mathematical modeling of various collective behaviors of living creatures that display complex social conducts, allowing it to develop local solutions into global optimum solutions. Finally, the CS algorithm is a more recent alternative to PSO that models the obligate brood parasitism of some cuckoo species [39]. A global cost function, including all criteria used to evaluate the quality of the grid power profile, is formulated, which constitutes the optimization objective function. Results show that the evaluated nature-inspired algorithms present similar optimization performance. However, the CS algorithm offers some advantages related to the reduction of fluctuations and power peaks in the grid power profile. It is also important to mention that in terms of computing time, the PSO algorithm is faster than CS and DE algorithms. A comparison with an EMS strategy that uses an off-line parameter tuning for the FLC block [43] demonstrates that the CS, PSO, and DE algorithms get an acceptable response concerning the main objective pursued by the EMS (i.e., smoothing the power profile exchanged with the mains). The main contributions of this paper are listed below:  
1. A complete procedure for adjusting the parameters of an FLC block of the EMS of a residential grid connected electro-thermal microgrid using the PSO and DE algorithms. 2.