Smart load scheduling strategy utilising optimal charging of electric vehicles in power grids based on an optimisation algorithm

One of the main goals of any power grid is sustainability. The given study proposes a new method, which aims to reduce users’ anxiety especially at slow charging stations and improve the smart charging model to increase the benefits for the electric vehicles’ owners, which in turn will increase the grid stability. The issue under consideration is modelled as an optimisation problem to minimise the cost of charging. This approach levels the load effectively throughout the day by providing power to charge EVs’ batteries during the off-peak hours and drawing it from the EVs’ batteries during peak-demand hours of the day. In order to minimise the costs associated with EVs’ charging in the given optimisation problem, an improved version of an intelligent algorithm is developed. In order to evaluate the effectiveness of the proposed technique, it is implemented on several standard models with various loads, as well as compared with other optimisation methods. The superiority and efficiency of the proposed method are demonstrated, by analysing the obtained results and comparing them with the ones produced by the competitor techniques.


Introduction
The utilisation of electric vehicles (EVs) has become one of the most powerful tools to increase the eco-friendliness of the transportation sector globally. Thus, one of the most important research questions, related to their massive deployment, is how to ensure efficient charging and discharging of EVs in the conditions of the centralised power system. Previous studies on the topic consider only one-way energy transfer, i.e. from the power grid to the EVs' batteries [1]. Such an energy transfer method increases the operating costs of an EV negligibly. On the other hand, recent research implemented a two-way transmission of energy between EVs and the electrical grid. This technique is commonly referred to as a vehicle-to-grid (V2G) methodology. It assumes that the energy is exchanged between the grid and the EVs connected to it. During the off-peak hours, EV's battery is charged and during the peakload hours, the energy stored in the EVs is released into the network. In addition, other opportunities presented by the bidirectional V2G technique made it very popular among scientific and engineering communities. Fig. 1 [2] demonstrates a basic structure of the V2G methodology. Based on the object interacting with the EV, V2G methodology can be applied to vehicle-to-home, vehicle-to-vehicle and vehicle-to-building scenarios. In all of these cases, the EVs' batteries are used to provide energy to the grid. One of the important factors for dispersal loading, which needs to be carefully considered, in order to minimise the negative effects in the network at the peak time is the EV's planning.
In other words, charging of EVs should follow a certain strategy to obtain such benefits as peak shaving and valley filling [3]. In addition, one of the most important issues, which need to be addressed in order to increase the supply-side energy efficiency of the electric power grid and reduce consumers' concerns, is how to provide a quick way to charge EVs.
Thus, EVs' owners need a suitable plan for monitoring and management in order to contribute to and charge from the power grid [4]. Moreover, plugged-in EVs can be utilised to supply mutual power flow between the equipment and the EVs' batteries. Some of the auxiliary services, which can be provided by the EVs include frequency regulation, peak shaving, improved voltage profile and power quality [5]. The authors in [6] employed a demand-response management in order to solve the problems under consideration. The studies [7,8] defined a synchronised bidding strategy based on fuzzy logic for the ancillary services supplied with V2G operation. The authors in [9,10] described the impact of the EVs' deployment on the power systems in Northern Europe and their role in the considerable boost of investment in wind energy. The mathematical optimisation problem of the optimal charging schedule is formulated in [4]. Such an approach is considered to be one of the options to obtain a cost-effective methodology for charging and discharging program. An optimisation method aiming to minimise the total cost in accordance with the global optimal programming and distributed programming solutions is presented in [11].
The authors in [12] proposed a new optimal charging scheduling model for various types of EVs, which is based on the transport system information, i.e. road length, vehicle velocity and waiting time, and grid system data, i.e. load deviation and node voltage. The study presented in [13] demonstrates a novel practical plug in hybrid EVs charging scheduling program based on optimising customers charging cost through the generation capacity constraints and dynamic electricity price in various time slots of a day. The research conducted in [14] illustrates a distributed control model for coordinated charging of PEVs. In addition, it introduces an improved valley filling method for the smart charger, which is able to generate optimal charging profiles for PEVs. An alternative optimisation technique based on the drivers' demands, the road traffic speed, the number of vehicles at the charging station as well as charging network load is presented in [15]. Moreover, a robust optimisation method, which is based on the price uncertainty, is proposed in [16] to examine the scheduling process for EVs' aggregators. The studies presented in [17][18][19][20] review other aspects of EVs charging and scheduling.
The given research, on the contrary, utilises basic optimisation methodology, while charging and discharging scenarios are implemented using appropriate programs and are based on predicted values. In this model, regional power consumption as well as distributed loads at the regional level are considered for all types of users including industrial, residential and commercial. Precisely, each aggregator optimises the load of the corresponding area at the utility's distribution network based on the number of EVs connected to the chargers in that particular area.
Considering a relatively rapid growth of the EV's share in the global transportation sector, the topic of EVs' charging and all the aspects related to it become very critical for the international scientific and engineering community. The given study aims to achieve the following two objectives. First, develop a bidirectional fast charging station and design an optimal program for aggregators to maximise the profit of the EVs' owners as well as the electricity network's operators. Second, minimisation of the cost of charging for the aggregators and, in case, when fast charging scenario is considered. Moreover, the basic optimisation strategy is centralised in this paper, while the charging and discharging schedules prediction is accessible by the aggregator.
Thus, the contributions of this paper can be summarised as follows: (i) A new multi-objective algorithm, utilised to solve the proposed optimisation problem, is introduced. In this model, the cost of charging for the aggregators is minimised and the profit of the EVs' owners is maximised. (ii) A fully functional bidirectional fast charging station is developed.
(iii) To have better modelling of profit maximisation, an optimal program to maximise the benefits for the EV's owners and aggregators is designed. (iv) An improved version of particle swarm optimisation (PSO) algorithm is presented aiming to minimise the cost of charging under the considered models.
The problem description is provided in Section 2. The mathematical model of the proposed method is presented in Section 3. Numerical results and analysis are described in Section 4, while Section 5 concludes the overall work.

Problem description
The proposed optimisation method is based on a smart charging methodology, which aims to minimise the total cost of charging for the EVs' owners by assuming that they participate in V2G Scenario. During the peak-load hours, the EVs' batteries are used to supply energy to other users and when the demand is low, they draw energy from the grid for charging.
Apart from providing backup energy storage for the grid, the advantages of this approach include decreasing the power drawn from the grid during the day, peak load shaving and improving the load profile [21]. The basic structure of the proposed V2G approach is depicted in Fig. 2. It should be highlighted that under the given scenario the power from the grid is transferred to the EVs only at times when the network's power is minimal. The mentioned model can mathematically be presented as follows: min (P grid 2 ) In (1), network power and daily power demand profile of a region are represented by P grid and P loadprofile , respectively. The power required for EVs charging is defined by P charging . In addition, P loadprofile and P charging are the known variables in the optimisation process, where P charging represents the total power of the grid. Hence, peak power consumption and its variability during the day are minimised. In order to evaluate the performance of the proposed method, two models sharing a common goal of minimising the cost of EVs charging are simulated in this study. The first model comprises a series of industrial, commercial and residential loads, which are considered to be a general regional load. The developed optimisation program for EVs' charging is applied to it. In addition, in the second model, charging program of each individual area is optimised based on the load profile of that particular area. For example, when the residential power demand is targeted, the smart charging program is applied for EVs in the residential area. The optimisation technique adopted for this study is based on an intelligent algorithm, which is introduced in the following section. It minimises the total load of the network whilst maintaining the state of charge (SOC) required for EVs' owners.
The target functions and constraints can be formulated as follows.
Optimisation of the regional load is handled by considering the power demand from a number of residential, industrial and commercial areas through the Smart Sharing program. In the given model, the daily load profile's curve is considered. It aggregates the total power demand's magnitudes for residential, industrial and commercial areas during a 24-h period.
If the time intervals are considerably small, the problem will become more complicated. Therefore, the load profile is recorded for every hour and the time interval t is then considered to be 1 h. The total amount of power requested by the number of residential, industrial as well as commercial units is denoted as P t and expressed as Considering (2), the amount of power demand by the residential, industrial and commercial areas at an interval of t are represented by P t residential , P t industrial and P t commercial , respectively. The target function can be defined as per (3) and transformed into (4)

Limitations
The proposed algorithm assumes that lower I i c, min and upper I i c, max restrictions of the charging current i in the interval t for each EV are defined by (5). Moreover, the number of charging and discharging procedures for the ith EV in the time interval t is defined as C i,t . It should be also highlighted that the lower charging current's boundary is represented as a negative value, while the upper charging current's boundary is given as a positive value: SOC of every ith EV should be updated for every time increment t. SOC of every EV battery for the current time interval and for the preceding time interval are represented as S i,t and S i,t−1 , respectively. The battery capacity of the ith EV is denoted as b i . Moreover, the charging and discharging current of each EV's battery at the previous interval (t − 1) is denoted as I i, t − 1 c and defined as SOC (S i,t ) of the ith EV's battery at every interval t is limited within certain bounds to extend the battery life. Lower and upper SOC restrictions for each EV i in the interval t are defined by (7). The lower level of SOC is represented by S min and the upper level of SOC is represented by S max . In other words, it means that none of the EVs' battery is allowed to be discharged below S min state and charged above the S max state: In addition, the EVs' owners can request the system to maintain a certain SOC at a certain time. In this case, the SOC range is determined during the times when the EV is discharging. This is done in order to meet the energy demand of the grid. For example, if the owner wants to keep SOC of the EV at a lower level of 45% by 16:00, then it is listed in the proposed optimisation model. The desired SOC at a desired time intermission t desired is represented by S i, t desired and defined according to Using the equality limitation shown in (8), the number of charging and discharging procedures for the ith EV in the time interval t is defined as C i,t . If C i,t is greater than zero, the term denotes a charging state, otherwise it indicates a discharging state for the ith EV's battery. The voltage at the DC-DC converter is represented by V DC : In addition, the lower and the upper charging and discharging power restrictions for the ith vehicle in the interval t are defined by (10). It should be clarified that the lower boundary of the discharging power for EV's battery, represented by C min , is a negative number, while the upper charging power's boundary, represented by C max , is a positive number [22][23][24]: The utility power (P), in turn, is limited within the bounds formulated in (11) to prevent battery from degradation. The lower boundary of the utility power is set at zero and the upper boundary is determined as a positive number, which is equal to the sum of the power demand and the maximum discharging or charging power of EVs' batteries connected to the grid in the given region: Thus, considering the boundaries and the conditions presented above, one can establish a mathematical representation of a general optimisation problem as: The given problem can also be represented as a case of area load control for the residential load scheduling as follows: Analogously, for the industrial load scheduling the optimisation problem is presented as In addition, commercial load scheduling optimisation problem is formulated as 3 Optimisation algorithm

Review
One of the optimisation algorithms mostly applicable for the scenario under consideration is PSO technique, which is inspired by the behaviour of the birds flocking or fish schooling and proposed by Dr Eberhart and Dr Kennedy in 1995 [25]. PSO is directly utilised for standard optimisation problems and is also employed to modify optimisation-based applications. Comparing with the stochastic approaches, the given optimisation algorithm allows discontinuities to be controlled. Moreover, the swarm of seeking agents is able to explore the entire field of solutions instead of concentrating on one potential solution at once, which in turn increases the speed of optimisation. Due to the high parallelisability characteristics of PSO, its accuracy and efficiency are high, while on the other hand, the calculation process is relatively simple [26]. Considering (19) the ith particle position's vector x at the (k + 1)th iteration stage can be found as follows: The updated speed vector of the ith particle for the kth step is defined as v k + 1 i , while Δt represents the time increment. In addition, the speed vector for every particle can be formulated as Here, the speed vector for the kth iteration is defined by v k i , r 1 and r 2 show random vectors whose sizes are selected from the interval [0, 1]. Moreover, p k i and p k g up to the kth iteration define the best position and the global best position, respectively. In addition, c 1 and c 2 are called 'trust' variables, while w is defined as inertia weight.
In the given work, an improved version of PSO is employed to obtain an optimal solution for the posed problem. The proposed algorithm improves the computational efficiency by utilising the particle classification model, which removes the redundant constraint violation assessments by optimisation development. The rules for feasible particle initialisation as well as choosing the related parameters are presented in the following sections. Fig. 3 depicts a model of the PSO optimisation algorithm for the three successive iterations. One can notice that particles start from the point P 1 and subsequently reach the point P 4 . The speed vectors for every iteration and their orientation in space are represented by the solid and dashed lines, respectively. Performance of the PSO algorithm is, generally, dependent on the three factors, namely P best , G best and primary velocity. The second point of the second iteration (i.e. P 2 ) in Fig. 3 represents the location with deteriorating objective function's value. It is then compared with the P best by locating the feasible space depicted in Fig. 3a as well as infeasible space indicated in Fig. 3b. Considering  Fig. 3, it can be observed that the direction of the particles' motion at the second and the third iterations is similar to each other. Thus, the algorithm functions as follows. Since at the second iteration the objective value degrades, P best is deactivated, and after moving to the third point P 3 it is substituted with a new value and the objective function's value is checked again. The given study proposes a new mechanism, which implies dividing particles into two parts p 1 k + 1 and p 2 k + 1 at each iteration. As shown in Fig. 4, the proposed algorithm can be divided into four main stages. For the steps from k to k + 1, all possible objective function's values are represented. In addition, p 1 k + 1 , p 2 k + 1 and p 3 k + 1 demonstrate the novel positions in the feasible, infeasible as well as the possible spaces, respectively. The new position in the impossible searching space based on the target value, which is better than the present P best , is defined by p 4 k + 1

Improved PSO
. Based on the PSO algorithm's principles of operation, the optimisation process should be done using p 3 k + 1 and p 4 k + 1 before updating P best . The particle of an objective function is the main criterion.
Therefore, since the best particles are selected according to the objective function's values, the computational intensity of the optimisation process can be reduced. In order to investigate the proposed algorithm's efficiency in comparison with the conventional PSO, a new parameter R is defined: The total number of iterations is presented by T max , while n i denotes the number of particles. In addition, N p represents the total population of particles. Using the classic PSO, this equation is updated. The possible particles are created in accordance with to the following steps: • The particle in the total space is randomly generated.
• The conflicting point of P, which is called by OP is assessed according to the equation below Here, the maximum and minimum range of the design variables is defined by x upper and x lower , respectively. In addition, x P denotes the generated design in the first stage. If the point belongs to the possible space, then the conflicting point will have a higher probability of residing in the possible space comparing to the particles, which are produced randomly. Opposite violation of the points is calculated initially, including the initial opposition points, as well as their targets. Given the target value of particles, the best particle is selected in the possible space. If one of the particles is in the feasible space, the feasible particles would be retained and returned to step 1. The loop will be repeated until the number of the selected particles becomes equal to the population of the predefined particles in PSO.
In addition, the free values of parameters (c 1 , c 2 and w) are selected based on the literature works in [27][28][29]. The term w for a linear time-dependent estimation and the quadratic time-dependent rule is calculated as follows: (24) In these equations, the number of present iterations is shown by t, w max is chosen to be equal to 0.9 and w min is equal to 0.4.

Numerical results and analysis
In order to minimise the cost of charging for both EV owners and utilities, smart programming is implemented on EVs that participated in V2G program. Various scenarios are considered to prove the superiority of the proposed method.
Scenario 1: Control of the regional load. Scenario 2: Programming of the residential load. Scenario 3: Programming of the industrial load. Scenario 4: Control of the commercial load. Scenario 1. Control of the regional load: In this scenario, the first target is to supply peak load shaving and load levelling to control the regional load. Hence, by the proposed approach, the total utility load profile is improved.  In addition, numerous users will be considered as a load profile over a period of 1 day. The achieved load profile of the region is depicted in Fig. 5.
In this scenario, EVs participating in the V2G scheme are considered as an available energy source in the area. Precisely, a fleet of 26 EVs is used to optimise the cost. A total of 16 EVs is connected to the grid in the residential and industrial areas, while the remaining 10 EVs are connected in the commercial area. In order to evaluate the performance of the proposed method in case of the EVs' charging a 24-h period in the 1-h steps is considered. In addition, based on the latest protocols and standards in the field of EV charging, the data required for EVs and charging utilities is collected. Based on the number of available EVs in the area their overall capacity can be defined as low, average and high. Moreover, in order to apply the proposed optimisation algorithm, much higher capacity is assumed as a collective number of all EVs' batteries in one area. For example, consider the case when EVs' batteries, which are available in the commercial, residential and industrial areas, have the same capacity. At midnight time (24:00), due to the low power demand, the initial value of EVs' SOC is equal to some 80%. This effectively means that in order to increase the speed of charging when EVs arrive home, they are assumed to charge with the upper charging current. Considering the fastest charging process in the lowest time interval, the SOC value is expected to be in a range of 20-80%. Between 24:00 and 07:00, the battery charging process from 80 to 100% is performed in a slow mode.
The SOC is regulated for EVs in each area according to the type of the region and the application as well as based on the different time intervals. Precisely, the SOC of EVs located in the residential area at 16:00 is set at a minimum value of 55%. In addition, the SOC of EVs parked in the commercial area at 18:00 is set at a minimum value of 60%, while the SOC of EVs plugged to the grid in the industrial area at 17:00 is set at a minimum value of 60%. Based on the time when EVs' owners arrive home or go out to perform routine tasks, the time of implementation process is selected. In this scenario, the process of charging is assumed to be fast. Hence, in order to enable quick charging for all EVs, 80% SOC is scheduled to be achieved at midnight. Later, the charging slows down to top the battery to the upper allowed SOC range under the given scenario. It should be highlighted that the upper level of the allowed SOC for all EVs in this scenario is equal to 90% or 0.90. It should be also noted that the battery health is presumed for all of the cases considered in the given study. Otherwise, the minimum allowed SOC for all EVs is selected to be 20% or 0.2 for achieving the same aims. According to CHAdeMO standards, the maximum current rate for the EVs' charging is equal to 125 A. On the other hand, the minimum charging and discharging current rate for EVs is equal to −125 A. In order to express the results in a comprehensive and concise manner, the power and the current at the charging state are defined to be greater than zero. On the contrary, the power and the current at the discharging state are less than zero. Moreover, the aim of the proposed method is to provide the fastest possible charging to the EVs, while the charging voltage's value is presumed to be 500 V in accordance with the fast charging protocols. Table 1 summarises the assumed and selected parameters for the scenario under optimisation.
The optimisation of the regional load control under this scenario is conducted using the proposed algorithm. Figs. 6-9 depict the results obtained from the regional load control optimisation.
From Fig. 6 one can observe that SOC for all of the regions is in the optimal range and proportional to the values defined by the users. In addition, it can be seen that EVs are charging to the upper  SOC, when the utility power is available during the off-peak load hours. According to Figs. 7 and 8, it can be concluded that EVs in all regions are charging with the highest allowed charging current and charging power when the power is available during the offpeak time.
Finally, considering the results presented in Fig. 9 it can be observed that this method satisfies the expectations of the regional load control optimisation model expressed in Section 3. Precisely, during the off-peak time, i.e. 19:00-07:00, EVs are charged in order to supply the daily power demand. On the other hand, during the high-demand hours, i.e. from 9:00 to 19:00, EVs are capable of providing power services with improved power profiles. From the obtained results, it can be also concluded that using the proposed optimisation method, the power profile has been significantly improved during the peak hours. Precisely, Fig. 9 demonstrates that the power during the peak times decreased by 1.5 MW from 13 to 11.5 MW. The optimised average power value is equal to some 7.33 MW, while the standard deviation is equal to about 3.56 MW, which is smaller compared to the standard deviation of 3.973 MW before the optimisation. Scenario 2. Programming residential load: The second scenario implies that the main target is to find the fastest way to charge EVs in the residential area. In order to maintain coherence and comparability, the values of the parameters used in the previous scenario are also used in this section and listed in Table 2. The results of implementing the proposed method in the residential areas taking into account the values presented in Table 2 are plotted in Figs. 10-13.
The SOC of the EVs in the residential area is plotted in Fig. 10. As it can be noted the desired aims are met. During the peakdemand time, the energy stored in the EVs batteries is used to improve the power profile of the grid. On the other hand, during the low-demand time, EVs' batteries are charged and help to reduce the utility's load.
Charging current and power for EVs in the residential area are plotted in Figs. 11 and 12, respectively. During the peak hours, the   amount of discharged and injected power to the utility is maximised. On the other hand, at the low-power-consumption time, the power from the utilities is injected into the EVs located in the residential area. Finally, by analysing the results presented in Fig. 13, it can be observed that the proposed method satisfied the aims of the residential load control optimisation. Precisely, during the off-peak hours, i.e. 19:00-01:00, the EVs are charged from the grid to supply the power demand during the day. Based on the obtained results, it can be concluded that using the proposed optimisation method, the power profile has been significantly improved during the peak hours. Fig. 13 shows that the power during the peak times decreased by 500 kW from 6 to 5.5 MW. The average power is equal to some 3.1 MW after the optimisation. The standard deviation, in turn, amounts in 1.18 MW, which is less than the standard deviation before the optimisation, i.e. 1.28 MW.
Scenario 3. Programming industrial load: The main goal of the third scenario is to find the best way to charge EVs in the industrial area. In order to maintain the coherence and comparability, the values of the parameters used in the previous two scenarios are used and complemented in the given section. The variables and constants utilised for the third scenario are listed in Table 3. However, some of the parameters vary as per the requirements of the present scenario.
The values of SOC for industrial load control using EVs are plotted in Fig. 14. As can be seen, the desired aims and goals are achieved. During the peak-demand time, the energy stored in the EVs' batteries is used to manage the power of the utilities. On the other hand, during the low-demand time, EVs' batteries are charged and help to reduce utility's load.
Charging current and power of the EVs in the industrial area are plotted in Figs. 15 and 16, respectively. One can observe that the amount of discharged and injected power to the utility is the highest during the peak hours, which in the given case correspond to two periods, namely 08:00-12:00 and 13:00-16:00. On the other hand, during the low-power-consumption time, the power from the utilities is injected into the EVs parked in the industrial area.
Finally, by investigating the obtained results depicted in Fig. 17, it can be observed that this method satisfied the expectations of the industrial load control optimisation and the grid's power profile was significantly improved during the peak hours. In addition,   The average power is equal to some 1.4 MW after the optimisation is performed, while the standard deviation is equal to some 1.42 MW, as compared to the standard deviation of 1.25 MW before the optimisation. Scenario 4. Programming commercial load: According to this scenario, the optimal charging program for EVs in the commercial area is modelled using the parameters and values listed in Table 4.
The main target of the fourth scenario is to find the best way to minimise utility's power demand throughout the peak-load hours by injecting power from the EVs' batteries and by keeping the desired SOC at the defined intervals.
The results obtained from the implementation of the proposed optimisation algorithm with the aim of optimal charging programming are shown in Figs. 18 and 19.
The overall power profile retrieved from the optimised system is plotted in Fig. 20. During the peak hours, i.e. set as 08:00-12:00 and 09:00-19:00 for the given scenario, the amount of the discharged power and the power injected into the utility is the highest. On the other hand, during the low-power-demand time, the power from the utilities is redirected to the EVs connected to the chargers in the industrial area. Fig. 20 shows that the power during peak times is decreased by 500 kW, from 4.9 to 4.4 MW. The average power and the standard deviation after the optimisation are equal to 2.4 and 1.64 MW, respectively, while the standard deviation before the optimisation is some 1.89 MW.

Analysis of optimisation cost
The given study investigates the influence of the implementation of the proposed optimisation technique on the power system under various EV charging scenarios. In addition, it aims to examine the amount of power supply using the proposed method and at the same time evaluate the associated reduction of the costs for the utilities and EVs' owners. The foundation of the given section is based on the power tariff, which is defined for commercial and industrial areas. The numerical values for the paid costs are based on the data obtained from Nordkraft and provided for the area of Nordkraft Nett AS (Narvik Municipality and the Wall of the Municipality of Evenes) [30]. The difference in the power profile and the obtained data is negligible. In order to find the reduction in costs, load profiles for commercial and industrial areas using the optimisation method and without it are retrieved and compared. It should be also highlighted that industrial and commercial users pay a considerable amount per kW for power compensation in addition to the regular energy costs [30]. One of the best solutions to solve the set problem is to charge EVs' batteries during the low-demand time and supply power to the grid from the EVs' batteries during the peak-demand time. This, in turn, will minimise the power profile and consequently the power tariffs. Thus, it creates simultaneous profits for utilities and EVs' owners. Power tariffs do not apply to residential areas at the moment, but according to the latest methods adopted by the distribution companies, power tariffs for residential areas will be introduced in the nearest future. Table 5 presents a comparison of the power consumption and costs of charging for the commercial and industrial areas before and after applying the proposed optimisation algorithm. This analysis is done during peak-power-demand time.
As can be seen from Table 5, the proposed method increases the accuracy of the power scheduling and as a result, minimises the cost of charging for the users.
In addition, it should be specifically emphasised that as a result of reducing the power peak, not only the costs for the users are affected, but also the investments required from the utilities' side are minimised. In other words, the proposed optimisation algorithm decreases the infrastructural costs for the grid operators and distributors, which do not plan to upgrade the existing equipment to accommodate new EVs' loads. On the other hand, owners of the EVs and utilities tend to pay more for supplying power demand on the electric grid instead of saving money. In this work, a novel fast charging method for EVs is implemented. In addition, the smart programming for EVs, with the aim of minimising the charging costs for electric utilities and EVs' owners, is presented. The proposed approach is implemented in accordance with the user's desire to charge and discharge EVs. In other words, the priority is given to the desires of EVs owners, that is when the owners tend to charge their vehicles, the aggregator is not allowed to receive energy from EVs' batteries. Other advantages of the proposed method include peak load shaving and load profile improvement. This is achieved by supplying the active power from the EVs' batteries and the reactive power from the network's side converter to the utility. In addition, in order to minimise the charging costs, an improved version of the intelligent algorithm is proposed. The proposed optimisation technique is examined using four case studies. The main aims are reducing power utility and power demand. In smart programming, when the grid power demand is maximised, active power is provided from the EVs in order to supply power utilities for peak power shaving. The proposed method achieves the main objectives based on the set constraints for EVs' owners and utilities. By reviewing the results, the advantages of the proposed method, including reduction of charging cost and fast charging can be observed for the EVs' owners. Finally, the users will have to pay less due to the lower peak power, which saves money in the system.