*4.3. ECO Mode*

For the vehicles in ECO mode, the manager decides to charge them preferably when a PV surplus occurs or at periods of lower demand, therefore bringing savings for the user and benefits to the grid. From factors (Section 3) related to this mode and using the optimization technique known as dynamic programming [22], the cost function is formulated as:

$$J\_E = E\_{\rm soc}(t\_f) + \sum\_{t\_m=t\_0}^{t\_f} R\_{\rm pcc} \tag{22}$$

where *Rpcc* is related to the factor presented in (7). The dispatched power (*P*<sup>∗</sup> *<sup>E</sup>*,*EVE* ) of Equation (7) is the one that causes the minimum cost *JE* among all possible power sets (*Pevpossible*), and it results in the optimal SOC trajectory. The definition of the optimal power (*P*∗ *<sup>E</sup>*,*EVE* ) is then given by:

$$P\_{E\_\*EV\_E}^\* \leftarrow f\_E(P\_{E\_\*EV\_E}^\*) \lessapprox f\_E(P\_{\varepsilon\upsilon\_{parallel}}).\tag{23}$$

In a demand limitation case, the index of the charging power is calculated from:

$$\overline{f}\_{\mathbb{E}}(t\_m) = \frac{P\_{lim} - P\_{n \text{rt}}(t\_m) - P\_{lI}(t\_m) - P\_{\mathbb{F}}(t\_m)}{\sum P\_{nom, EV\_E}(t\_m)}\tag{24}$$

Herein, *PU* and *PF* are the profiles already determined in (19) and (21). Furthermore, like ULTRA and FAST modes, if the microgrid demand has reached the demand limitation, then all vehicles in this mode become idle, due to *PE* being set to zero. The resultant charging power for the ECO mode vehicles is specified by:

$$P\_{E,EV\_E} = \begin{cases} P\_{E,EV\_E}^\* & \text{if } P\_{net}(t\_m) + P\_{ll}(t\_m) + P\_F(t\_m) + P\_E(t\_m) \leqslant P\_{lim} \\ \overline{P}\_E(t\_m), & \text{otherwise,} \end{cases} \tag{25}$$

wherein *PE*(*tm*) = *f <sup>E</sup>*(*tm*)*P*<sup>∗</sup> *<sup>E</sup>*,*EVE* (*tm*).
