**4. Optimal Design Problem Formulation**

The multi-objective optimal design model is evaluated in terms of economic and reliability criteria as presented in the objective functions defined below:

### *4.1. Economic Criteria: Total Life-Cycle Cost (TPC)*

The objective function of the economic criterion is formulated as a cost minimization problem of the net present value of the total life-cycle costs (TPC) of all system components alongside the implementation of the flexibility requirements under different system scenarios. The decision variable of the optimization problem is the capacity of the WT (*CWT*), PV (*CPV*) and ESS (*CESS*).

$$\text{minimize } TPC = \sum\_{z=1}^{Z} \left\{ CI\_z + \sum\_{n=1}^{n=N} \frac{\left( O \& M\_z + RP\_z - RV\_z \right)}{(1+r)^n} \right\} \times C\_z \tag{14}$$

where *z* indexes the *zth* component and *Cz* is the decision variables that represent the optimum component capacities of each of the system components (PV, ESS, and WT). The *TPC* components are the capital costs (*C Iz*), yearly operation and maintenance costs (*O*&*Mz*), replacement costs (*RPz*) and the salvage value *RVz*, *N* is the project lifetime, n is the time step in the project life, i.e., a year and *r* is the discount rate. The system components have a yearly operation and maintenances cost over the project lifetime.

### *4.2. Reliability Criteria: Loss of Power Supply Probability (LPSP)*

The second objective considers the loss of power supply probability as the system reliability criteria. *LPSP* reliability index measures and ascertains the quality and reliability performance of the power system design under the different scenarios considered in this study. *LPSP* is defined as the ratio of the sum of all energy deficits (*LPS*) to the total power demand. Thus, *LPSP* can be evaluated by using the following expression:

$$LPSP = \frac{\sum\_{t=1}^{T} LPS(t)}{\sum\_{t=1}^{T} L\_D(t)}\tag{15}$$

where

$$LPS(t) = L\_D(t) - \left[ WT\_p(t) + PV\_p(t) + \left( SOC(t-1) - SOC\_{min} \right) \times \beta\_\mathbb{\varepsilon} \right] \tag{16}$$

*LPSP* value ranges between zero and one; a value of 0 for *LPSP* implies that the load demand will always be met or satisfied, and this is the most desired and preferred performance. The following system *DRP* constraints are considered during the optimization procedure, alongside the other system component constraints that are mentioned at each design stage.

$$\begin{cases} PV\_p(t) + WT\_p(t) + ESS\_p^{ds}(t) - ESS\_p^{ch}(t) = L\_D(t); & \text{without DRP} \\ PV\_p(t) + WT\_p(t) + ESS\_p^{ds}(t) - ESS\_p^{ch}(t) = L\_D^{CPP}(t); & \text{with CPP DRP} \\ PV\_p(t) + WT\_p(t) + ESS\_p^{ds}(t) - ESS\_p^{ch}(t) = L\_D^{TADP}(t); & \text{with TADP DRP} \end{cases} \tag{17}$$

### *4.3. Overview of the Optimization Tool: Multi-Objective Particle Swarm Optimization*

PSO is a population-based approach for solving discrete and continuous optimizations problem that stemmed from and mimic the navigation behavior of swarms of bees, flocks of birds, and schools of fish. To obtain the optimal value of the objective function at each search, two different solution points are obtained which are called the local best, *Pbesti* = (*pi*1, *pi*2, ..., *pid*) and the global best, is *Pbestg* = *gbest* = (*pg*1, *pg*2, ..., *pgd*); and the positions of the particles for the next objective function evaluation is estimated as given below:

$$\begin{array}{l}V\_{id}^{t+1} = w \times v\_{id}^{k} + c\_1 \times rand\_1 \times (Pbest\_{id} - X\_{id})\\ + c\_2 \times rand\_2 \times (gbest\_d - X\_{id})\end{array} \tag{18}$$

$$X\_{id}^{k+1} = X\_{id}^k + V\_{id}^{k+1} \tag{19}$$

$$w = w\_{damp} \times \frac{iter\_{max} - iter}{iter\_{max}} + w\_i \tag{20}$$

*iter* is the iteration count, *itermax* is the total iterations. *wi*, *wf* are the minimum and maximum range of the inertia weight. The multi-objective PSO approach adopted in this work is described [54]. The repository particles guides the search within the *efficient, non-inferior* and *admissible* pareto front by sorting out the non-dominated solutions. The exploratory capacity of the algorithm is strengthened by a special mutation operator just like in NSGA II algorithm as explained below. If *f*(*x*) consists of *n* objective functions each with *m* decision variables, then the multi-objective problem can be defined as finding the vector *x*<sup>∗</sup> = [*x*<sup>∗</sup> 1, *x*<sup>∗</sup> 2, ..., *x*<sup>∗</sup> *m*] *T* which minimizes *f*(*x*) as shown:

$$\text{minimize } \vec{f}(\vec{x}) = [f\_1(\vec{x}), f\_2(\vec{x}), \dots, f\_n(\vec{x})] \text{ for } \vec{x}^\* \in \mathfrak{c} \tag{21}$$

$$
\vec{g}(\vec{x}) \le 0 \tag{22}
$$

$$
\vec{h}(\vec{x}) = 0\tag{23}
$$

*g* and*h* are sets of inequality and equality constraints, respectively. A point *x*<sup>∗</sup> ∈ *χ* is pareto optimal if for every *x* ∈ *χ* and *I* = 1, 2, ..., *k* either:

$$\forall i \in I(f\_i(\vec{x}) = f\_i(\vec{x}^\*)) \tag{24}$$

or at least there is one *i* ∈ *I* such that

$$f\_i(\vec{x}) > f\_i(\vec{x}^\*) \,\tag{25}$$

### **5. Research Case Study and Simulation Parameters**

The proposed energy system planning and managemen<sup>t</sup> approach are investigated on an undeserved Marsabit county isolated microgrid in Kenya, which is currently served by conventional diesel-based generators. The goal of this work is to investigate the best flexibility managemen<sup>t</sup> incorporated hybrid VRE energy supply combination that will completely replace the existing diesel generators considering the cost and reliability criteria that are described above. The hourly meteorological data of the locality (2.3369◦ N, 37.9904◦ E) was obtained from online sources [55,56] for 2015 to 2018. The meteorological data set consists of wind speed, wind direction, air pressure, relative humidity, solar irradiance, and the temperature variables. The economic and technical parameters were obtained from [57] through desk research and consultation with energy sector employees and policymakers in the region. Table 1 shows the details of simulation parameters and Table 2 shows the considered self and cross-price elasticity of demand, which is adopted from [52] modified to fit the Kenyan case. The price elasticity of demand entails self and cross-elasticity; the self-elasticity defines the sensitivity of demand with respect to price within the same pricing interval while cross-elasticity (*PEφ*(*<sup>i</sup>*,*j*)) define the load demand sensitivity of the (*i*th) pricing period in response to the electricity price variation in the (*j*th) pricing period. The cross-elasticity of demand is given by [50];


**Table 1.** Technical, Cost & lifetime parameters of the system components.

**Table 2.** DRP self and cross-price elasticities of demand [49,50,52].


The Kenyan tariff structure of 2018 was obtained from [58,59]. The current electricity rate of 15.80 US Cents per kWh for ordinary domestic consumers was considered to be the flat rate *Epr std*. For this work, the CPP DRP pricing scheme was considered to be 20.00 US Cents per kWh for peak period from 7:00 p.m. to 10:00 p.m. while the rest of the day adopted a flat pricing of 15.80 US Cents per kWh. TADP DRP implemented a time-ahead hourly variable pricing scheme with a maximum and minimum electricity price of 20.00 US Cents per kWh and 10.00 US cents per kWh, respectively.

PHES has no geographical limitations [60] and have been found to be a viable ESS technology option for both large and small-scale energy managemen<sup>t</sup> applications. Its prospects in terms of cost-effectiveness and flexibility provision has also been verified in [48], thus, it has been determined to be one of the most suitable ESS options for application in isolated places such as the Kenyan microgrid case under study. PHES stores electricity as sensible heat in thermally insulated and closed-looped thermal storage systems which ensures that the system is isolated; hence, based on the design aspects outlined in [47], there is a guarantee that the model is feasible for deployment for our case study. The analysis of a proposed commercial PHES design with a maximum capacity of 16 MWh as detailed in [45,61] has been adopted as the benchmark for many studies in the literature; thus, the system technical and economic specifications are used in our work for the Kenyan microgrid under study.
