# A Simple Multi-Parameter Method for Efficient Charging Scheduling of Electric Vehicles
## 2 Materials and Methods
### EVs' Charging Scheduling Method
#### 2.2.2 Objective Function and Constraints
The constraints described above are formulated in Equations (9)-(13):  
* Battery lifetime constraint \[\text{change\_sign}\left(\text{P}\left(\text{i},\text{t}\right)\right)\leq 3,\ \text{t}_{\text{ Arr}}(\text{i})\leq\text{t}<\text{t}_{\text{Dep}}(\text{i}),\ \forall\,\text{i}\in\text{EV}_{\text{CS}}\] (9)
* Stored energy constraints \[\sum_{\text{t=t}_{\text{arr}}}^{\text{t}}\left(\text{pf}\cdot\text{c}(\text{t}) -\frac{\text{d}(\text{t})}{\text{pf}}\right)\cdot\text{P}(\text{i},\text{t}) \cdot\Delta\text{t}+\text{E}_{\text{Arr}}(\text{i})\geq\text{Emin}(\text{i}), \ \text{t}_{\text{arr}}(\text{i})\leq\text{t}<\text{t}_{\text{Dep}}(\text{i}),\ \forall\,\text{i}\in\text{EV}_{\text{CS}}\] (10) \[\sum_{\text{t=t}_{\text{arr}}}^{\text{t}}\left(\text{pf}\cdot\text{c}(\text{t}) -\frac{\text{d}(\text{t})}{\text{pf}}\right)\cdot\text{P}(\text{i},\text{t}) \cdot\Delta\text{t}+\text{E}_{\text{Arr}}(\text{i})\leq\text{Emax}(\text{i}), \ \text{t}_{\text{Arr}}(\text{i})\leq\text{t}<\text{t}_{\text{Dep}}(\text{i}),\ \forall\,\text{i}\in\text{EV}_{\text{CS}}\] (11)
* Charging power constraints \[-\text{P}_{\text{limit}}^{\text{Charger}}(\text{i},\text{t})\leq\text{P}(\text{ i},\text{t})\leq\text{P}_{\text{limit}}^{\text{Charger}}(\text{i},\text{t}),\ \text{t}_{\text{arr}}(\text{i})\leq\text{t}<\text{t}_{\text{Dep}}(\text{i}),\ \forall\,\text{i}\in\text{EV}_{\text{CS}}\] (12)
* State of charging target constraint \[\sum_{\text{t=t}_{\text{arr}}}^{\text{t}_{\text{Dep}}-1}\left(\text{pf}\cdot \text{c}(\text{t})-\frac{\text{d}(\text{t})}{\text{pf}}\right)\cdot\text{P}( \text{i},\text{t})\cdot\Delta\text{t}+\text{E}_{\text{Arr}}(\text{i})=\text{ SoCt}(\text{i})\cdot\frac{\text{E}_{\text{max}}(\text{i})}{100},\ \forall\,\text{i}\in\text{EV}_{\text{CS}}\] (13)  
where E\({}_{\text{Arr}}\)(i) is the energy stored in the battery of the \(i\)th EV when it is plugged into the charger, E\({}_{\text{max}(\text{min})}\)(i) is the upper (lower) limit of the energy stored in the battery of the \(i\)th EV, t\({}_{\text{Arr}}\)(i) is the time slot that the \(i\)th EV is plugged into the charger, t\({}_{\text{Dep}}\)(i) is the time slot that the \(i\)th EV is unplugged from the charger, P\({}_{\text{limit}}^{\text{Charger}}\)(i,t) is the power limit that is applied to the charger of the \(i\)th PEV at the \(t\)th time slot considering the nominal power of the PL transformer and SoC\({}_{\text{Dep}}\)(i) is the SoC of the \(i\)th EV when it is unplugged. The change_sign function defined in Equation (9) counts how many times the EV charging power, P, changes sign; hence, the times the EV battery charges and discharges. The greater the value of the change_sign function is, the more flexible the charging schedule and the bigger the reduction of the resulting charging cost are. However, the battery lifetime is reduced in this case. This is a parameter that can be defined by the EV driver taking into consideration these facts and personal preferences. In this study, we decided that the value of the change_sign function that mutually addresses the above-mentioned targets is three. Figure 4: The configuration of the examined PL electrical system. The objective function used in the proposed method represents the charging cost of the \(i\)th EV. It is defined in Equation (14):  
\[\mathrm{C_{EV}(i)=min(\sum_{t=t_{Air}}^{t_{Dep}-1}P(i,t)\cdot\Delta t\cdot EP(t)), \quad\forall\,i\,\in\,EV_{CS}} \tag{14}\]  
where EP(t) is the electricity price at the \(t\)th time slot. Taking into consideration all the constraints described above and the objective function for each EV, it can be concluded that the proposed charging scheduling method aims to minimize the charging cost of EVs, exploit V2G services and at the same time adhere to the technical and operation constraints of the PL and the EVs. The PSO algorithm was used to solve the optimization problem described above.