**Appendix B**

To ensure that a physically sensible optimum is obtained, the initial search space must be generated properly. The procedure below shows how ISLA generates the initial search space, but this does not guarantee a global optimum value as with nonlinear optimization problems. Nonetheless, the results generated by ISLA for energy-only microgrid systems were consistent with those from HOMER Pro®.

The sizes of solar PV, diesel, and the desalination unit are rated based on their maximum power [kW] or flowrate [m3/h] generation, thus, the optimum value must be based on the peak demand. A crude approximation of the peak electrical demand *Ppk* is calculated as shown in Equation (A10). The constant 10 kW/(m3/h) was arbitrarily chosen such that it is near the electrical energy intensities EIel of the desalination units in this study.

$$P\_{pk} = \max\left\{ P\_{ld}(t) + \frac{10\text{ kW}}{\text{m}^3/\text{h}} \dot{V}\_{ld}(t) \right\},\tag{A10}$$

The initial search spaces of solar PV {*SPV*}0, diesel {*Sds*}0, and the desalination unit {*Sde*}<sup>0</sup> are shown in Equations (A11)–(A13). Constants are multiplied to *Ppk* due to the possibility of the optimum size deviating from the crudely approximated peak demand. The diesel generator has a small associated constant because its optimum size must be near the peak demand. Smaller sizes may be technically infeasible, while larger sizes will incur high capital cost. Solar PV has a larger associated constant because it has power peaks during the day that are much larger than the peak demand.

$$\{S\_{PV}\}\_0 = \begin{bmatrix} \ 0 \ \ \ \ \ \ \ \end{bmatrix} \tag{A11}$$

$$
\langle \mathbb{S}\_{ds} \rangle\_0 = \left[ \begin{array}{cc} 0, & \text{3P}\_{pk} \end{array} \right]\_{\prime} \tag{A12}
$$

$$\{S\_{d\varepsilon}\}\_0 = \left[ \begin{array}{cc} 0, & \frac{2P\_{pk}}{\mathbb{E}\mathbb{I}\_{\rm el}} \end{array} \right], \tag{A13}$$

The Li-ion BESS and water storage undergo daily cycles of influx and efflux; thus, it is unlikely to have a Li-ion BESS or water storage that drains in less than a day. Their search spaces are therefore based on daily consumption. A crude approximation of the daily power consumption *Edy* is given by Equation (A14). Compared to Equation (A10), a smaller constant of 5 kW/(m3/h) was chosen because the average daily power consumption is less sensitive to sharp peaks in the actual demand profile.

$$E\_{dy} = \frac{1}{365} \left[ \sum\_{i=0}^{8759} P\_{ld}(t) \Delta t + \frac{5 \text{ kW}}{\text{m}^3/\text{h}} \cdot \sum\_{i=0}^{8759} \dot{V}\_{ld}(t) \Delta t \right] . \tag{A14}$$

The initial search spaces of Li-ion BESS {*SLi*}<sup>0</sup> and water storage {*Stank*}<sup>0</sup> are shown in Equations (A15) and (A16). Constants are multiplied to *Edy* due to the possibility of the optimum size deviating from the crudely approximated daily energy consumption. These constants are smaller, however, because caution against sharp peaks in the actual demand profile is unnecessary.

$$\{S\_{Li}\}\_0 = \begin{bmatrix} & 0, & 2E\_{dy} \end{bmatrix} \tag{A15}$$

$$\{S\_{tank}\}\_0 = \begin{bmatrix} 0 \ \ \ \ \ \frac{2E\_{d\mathbf{y}}}{\mathbb{E}\mathbb{I}\_{\text{el}}} \ \end{bmatrix} \tag{A16}$$
