*2.3. Diesel Generator*

In this study, a diesel generator was used to provide backup supply to the MG when the grid fails. It comprised a diesel engine, a synchronous machine, and for regulating the machine's speed and frequency, an excitation system-driven speed governor. The modelling of the three different parts of the diesel generator was adopted from [41]. The dynamics of each diesel generator components can be given by (5) and (8).

The governor control system transfer function:

$$H\_c = \frac{K\_1(T\_3s + 1)}{(T\_1T\_2s^2 + T\_1s + 1)}\tag{5}$$

where, *H<sup>c</sup>* is the transfer functions of governor control system, *K*<sup>1</sup> is the transfer function constants, and *T*<sup>1</sup> to *T*<sup>3</sup> are the time constants.

Actuator Transfer function:

$$H\_d = \frac{(T\_{4}s + 1)}{s(T\_{5}s + 1)(T\_{6}s + 1)}\tag{6}$$

where *H<sup>a</sup>* is the transfer functions actuator, and *T*<sup>4</sup> to *T*<sup>6</sup> are the time constants.

Diesel engine transfer function:

$$H\_{\text{eng}} = e^{-T\_{Ds}} \tag{7}$$

where governor control system transfer functions is *Heng* is and *T<sup>D</sup>* is the time constant. Excitation system transfer function:

$$H\_{\varepsilon} = \frac{1}{\left(T\_{\varepsilon}s + K\_{\varepsilon}\right)}\tag{8}$$

where transfer function constant is *K<sup>e</sup>* , exciter transfer function is *H<sup>e</sup>* and time constant is *T<sup>e</sup>* .
