A Study on Coordinated Optimization of Electric Vehicle Charging and Charging Pile Selection

: This paper was intended to explore the mutual inﬂuences between electric vehicle (EV) charging and charging facility planning, to establish a two-stage model for optimizing the EVs’ charging and charging piles’ selection. In the ﬁrst stage, the distribution pattern of the demands for EV charging, and various EVs were effectively grouped, in order to reduce the amount of computation for solving the second stage model. The goal of the second stage was to minimize the annual investment and electricity purchasing costs on the charging piles, and the coordinated optimization was carried out for EV charging and charging pile selection. The CPLEX and IP_SOLVE packages were used in MATLAB (R2014a/64 bits) to solve the established optimization model. The simulation results showed that, compared with the scheme for selecting the charging pile under the typical charging pattern (TCP), the total cost of the charging pile could be reduced by 6.32% with a scheme under the optimized charging pattern (OCP), thereby promoting the coordinated development of both the EVs and charging facilities.


Introduction
In an era of worldwide shortage of oil resources, increased environmental pollution, and global warming [1][2][3], widespread adoption of electric vehicles (EV) is the direction and goal of our society in the pursuit of sustainable development of the automotive industry [4]. However, as the market penetration increases, uncoordinated charging of EVs will bring a variety of undesirable consequences to the power grid, charging facilities, and end users. For the power grid, such consequences include an "extra peak" of load on the grid, reduced voltage at some nodes in the grid, and increased network loss of the grid [5][6][7]. For charging facilities, such impacts are manifested in the reduced utilization and increased operating costs [8]. For end users, such consequences mean the increased charging costs and duration [9].
To reduce or eliminate these negative impacts, it will be necessary to effectively control the EV charging. Mehta et al. [10] proposed an optimal charging method that aimed at maximizing the number of EVs plugged in. The method not only increased the operating cost of the charging piles, but also cut down the peak load of power grid, while suppressing transformer overload. Wei et al. [11] proposed an EV optimal charging method that could improve the operating income of charging facilities. Xia et al. [12] introduced the concept of the distribution network's power supply capability and proposed an EV optimal charging method that could reduce the charging costs for the users and the impacts on the power grid. Zhao et al. [13] comprehensively investigated the photovoltaic output and EV stoppage features, and an optimal charging method was proposed to coordinate the EVs and photovoltaic output under the time-of-use price. Through segmentally optimizing the charging power of EVs, it managed to stabilize the load fluctuation of the power grid, lower the users' charging costs, and maximize the consumption of new energy. Therefore, the EV optimal charging method could effectively deal with the problem of uncoordinated charging. In addition, it is important to denote different objectives for charging management and coordination. Ugirumumera et al. [14] developed a methodology to manage EV charging via sizing energy systems in place. Kontou et al. [15] compared charging management that minimized drivers' charging costs to management that minimized environmental externalities. Weis et al. [16] quantified benefits of controlled charging to reduce capacity expansion and operational costs. Yang et al. [17] proposed a framework for sizing and locating taxi charging stations considering congestion effects.
Meanwhile, adequate construction of charging facilities is essential for the rapid development of EVs. However, the construction of charging facilities unfailingly depends on the support of proper planning [18]. At present, studies on the planning of charging facilities mainly focus on the selection of installation site and optimal capacity. Chen et al. [19] proposed a multi-target model that took carbon emissions into account for selecting the site and capacity of EV charging stations, and the validity of the model was verified through examples. Shu et al. [20] investigated the operating characteristics of EVs and built a model for selecting the optimal site and capacity of charging stations, in an attempt to enhance the refined planning of charging stations. Based on an extended planning model of the distribution network, Jia et al. [21] investigated EV charging load, as well as the site and capacity selection of distributed energy storage, and a multi-stage joint planning model was established. The references mentioned above contributed to solving the site and capacity selection of charging piles. However, the selection of charging pile, which is another key topic in the planning of charging facilities, is often overlooked.
The purpose of charging pile selection is to properly configure the number of charging piles of each model, to optimize resource allocation to a greater extent. For this reason, studies on charging pile selection would boost the rapid development of EVs. At present, there is little research on the selection of charging piles. Meeting the demand of EV charging, based on the typical charging pattern, Tao et al. [22] proposed a method for calculating the configuration ratio of dispersed charging facilities and EVs. Wu et al. [23] investigated various types of charging piles and carried out a study on the selection of charging piles under the typical charging pattern. Based on the typical charging pattern, Huang et al. [24] proposed a planning scheme for charging piles in the workplace. While meeting the demands for EV charging, the scheme could minimize the investment costs on the charging piles, including purchase, installation, and operation and maintenance costs. The above references mainly investigated the types of charging facilities from the perspective of the maximum output power of the charging piles.
In summary, the existing studies on EV charging optimization and charging facility planning are relatively separated. In terms of EV charging optimization, researches tend to assume that when the charging facilities are given and the demands for EV charging are met, effective control of the EV charging process, such as the initial charging time and staged charging power [13], can reduce the charging costs for the users and the impacts on the power grid. In terms of charging facility planning, based on the given charging method, while meeting the demands for EV charging, researchers tend to minimize the investment cost on the charging facilities [24], without considering the impacts on EV charging.
In fact, EV charging and charging facility planning affect each other. On the one hand, EV charging method is constrained by the planning scheme of charging facilities. For instance, the type of charging piles will affect the effective charging of EVs [8]. In addition, the maximum output power of the charging piles will limit the adjustable range of the charging power. On the other hand, charging facility planning is also affected by EV charging method. For instance, the number of charging pile configured in the serial charging mode is significantly smaller than that in the parallel charging mode [25]. Therefore, this paper intends to explore the mutual influences between EV charging and charging facility planning, to establish a two-stage model for optimizing the EV's charging and charging pile's selection. In the first stage, the distribution pattern of the demands for EV charging, and various EVs were effectively grouped, in order to reduce the amount of computation for solving the second stage model. The goal of the second stage was to minimize the annual investment and electricity purchasing costs on the charging piles, and the coordinated optimization was carried out for EV charging and charging pile selection. The rest of the paper was organized as follows: a two-stage optimization model was built in Section 2. In Section 3, we solved the model with using CPLEX and IP_SOLVE packages. In Section 4, the selection of EV charging pile at a workplace parking lot was investigated under two charging strategies, and the results were analysed from the simulations. Finally, Section 5 concluded this paper.

Two-Stage Optimization Model
In general, EVs include private cars, buses, taxis and official vehicles. Private cars are mainly used for work and entertainment, and the charging sites are mainly distributed in workplace parking lots, residential parking lots as well as mall and supermarket parking lots. Because the work time is relatively fixed, EV charging is easy to control at a specific workplace. Therefore, this paper mainly investigated a coordinated optimization of EV charging and charging pile selection in the workplace. By now, there have been a wide variety of EVs and charging piles, and the charging scenarios are also diversified. To simplify modeling, the following assumptions were made: (1) The battery pack of private EVs in the current mainstream configuration (with a maximum mileage of about 150 km) [22] is taken as the subject for selecting and configuring the charging piles. (2) All charging piles are equipped with single chargers, which are classified by their maximum output power [24]. (3) The charging stations are located in the workplace, where the users' commute time is fixed, and thus EV charging is predicable. (4) The configuration ratio of EVs, parking lots, and charging piles is 1:1:1 [26].

Stage I: EV Grouping Model
To reduce the amount of computation for solving the model in the second stage (e.g., in this paper, the computational time for solving the model in the second stage with 64 vehicles was longer than 1 month.), the EVs were generally grouped in the first stage. Then the grouped samples in smaller size were used for modeling at the second stage, which effectively reduced the dimensions of decision variables and the amount of computation for solving the model. However, the grouping of EVs would lead to the problems such as the constraint distribution of transformer's available capacity and the diverse demands for EV charging. To this end, the basic principles for grouping EVs were established as follows: (1) The sample size of each group of EVs should be the same and as small as possible. (2) The distribution of demands for EV charging should be the same in each group. (3) The transformer available capacity should be allocated according to the total charging demands in each group. In particular, only when complying with Principles (1) and (2), an EV grouping scheme that follows Principle (3) would be valid. Otherwise, it would be considered invalid.
In order to evaluate the similarity of the distribution of demands for charging between any two groups of EVs, the similarity of any two EV subgroup samples X = (x 1 , x 2 , · · · , x N ) and Y = (y 1 , y 2 , · · · , y N ) was defined and calculated as shown in Equation (1): where N denotes the sample size of X and Y, and r XY denotes the similarity between samples of X and Y, called the Pearson correlation coefficient [27]. Usually, the value of r XY falls bet −1 and 1; if r XY is closer to 1, it indicates that the similarity between samples X and Y are stronger. To evaluate the similarity in EV charging demands between groups, the minimum similarity between groups that equally divides all the EVs Z = (z 1 , z 2 , · · · , z N * M ) into M groups was defined and calculated as shown in Equation (2): where M denotes the number of groups of EVs, and r min denotes the minimum similarity between groups; when r min ∈ 0.9 , 1 , it is considered that the adopted grouping scheme could meet the Principle (2). At the same time, the decision variables for EV grouping were defined as shown in Equation (3): where O Z denotes a matrix with the decision variables for EV grouping, and k denotes the row number. Therefore, the EV grouping model established in the first stage is as follows: Specifically, the objective function (4) indicates the value of the minimum similarity that maximizes the groups of EVs. Constraint (5) indicates the integer whose element o kw is 0 or 1 in the decision variable O Z Constraint (6) indicates that each EV could only be a member of one group. Constraint (7) indicates that the sample size of each group is N.

Stage II: Coordinated Optimization of EV Charging and Charging Pile Selection
After the grouping in the first stage, all EVs Z were equally divided into M groups. With any group X = (x 1 , x 2 , · · · , x N ) as an example, with T as the study period, the decision variables of optimal charging for group X are defined as the charging power of each EV in the period of T, as shown in Equation (8). where U X denotes a matrix with the decision variables of optimal charging for group X, T = n∆t, ∆t denotes the time interval, n denotes the number of intervals within the period of T, u ti denotes the charging power of EV i within the period of t, and N denotes the sample size of group X.
At the same time, CH = L 1 , · · · , L s , · · · , L m is defined as the set of charging piles configured in group X, and L s denotes one type of charging pile. MP = P max (L 1 ) , · · · , P max (L s ) , · · · , P max (L m ) is the set of the maximum output power of charging piles, where P max () denotes a maximum output power function. With CH as the type of charging pile to be investigated, the decision variables of charging pile selection for group X are defined as shown in Equation (9): where V X denotes a matrix with the decision variables of charging pile selection for group X, m denotes the total number of types of charging piles to be investigates, v si denotes the variable of charging pile configured for EV i.
To minimize the annual investment and electricity purchasing costs on the charging piles in group X, the EV optimal charging-based model for selecting and optimizing charging pile was established in the second stage as follows: Specifically, the objective function (10) indicates the annual investment and electricity purchasing costs of the charging piles that minimize group X, f (L s ) denotes the equivalent annual investment cost for configuring charging pile L s , e t denotes the electricity purchasing price during the period of t, α denotes the number of annual charges of EV i at the charging station, which was taken as 330 here. Constraint (11) indicates the integer variables whose element v si is 0 or 1 in the decision variable V X . Constraint (12) indicates that if and only if there is one type of charging piles configured for each EV. Constraint (13) indicates that the charging power of each EV does not exceed the allowable value during different periods, and that the charging process is uninterrupted. Constraint (14) indicates the exact charging demands for all EVs, and ∆Q i denotes the charging demands of EV i. Constraint  (15) indicates that the total charging power of group X during different periods should not exceed the allocated transformer available capacity, which is calculated as shown in Equation (16): where P max ST (t) and P L (t) respectively denote the transformer's active capacity and routine load during the period of t, and ∆Q denotes the total charging demands of all the EVs.

Model Solution Method
In this paper, a two-stage optimization model was established, including the grouping model in the first stage and charging pile selection optimization model based on EV optimal charging in the second stage. Among them, the model in the first stage was a 0-1 non-linear integer planning model, while that in the second stage was a mixed integer linear planning model [28]. The CPLEX and IP_SOLVE packages were used in MATLAB to solve the two-stage optimization model, as shown in Figure 1. The specific process is as follows: Step 1: Initialize the EV charging parameters, including the total number of EVs, initial state of charge (SOC) distribution, expected SOC, and battery pack capacity. Generate the total charging demands Z of EVs via Monte Carlo simulation [29].  (17), and save the results.
where SOC 0 is the initial SOC; SOC e is the expected SOC; Q is the battery pack capacity of EV.
Step 2: Set the number of EV groups (2, 4, 8, 16, 32, or 64) in turn, and substitute the group number and EV total number Z into Models (1) to (7) in the first stage. The CPLEX package was used in MATLAB to solve the model with using dichotomy. The grouping scheme with the smallest number of groups M and similarity between groups r min ∈ 0.9 , 1 was saved as the optimal grouping scheme.
Step 3: Set parameters again, including the charging period T, time interval ∆t, number of interval n, charging electricity price, set of charging pile types CH, set of maximum output power MP, and annual investment cost of each type of charging pile. Read the number of groups M, grouped samples, and sample size N, and number each sample. Set the variable k = 1.
Step 4: Read the charging demands for each EV, total charging demands ∆Q for all EVs, and the transformer's maximum active capacity P max ST (t) and routine load P L (t) in the k-th group. Calculate the available active capacity of the transformer during different periods in the k-th group according to Equation (16). Substitute these parameters and those in Step 3 into models (8) to (15) in the second stage. The IP_SOLVE package was used in MATLAB to solve the model. The obtained charging pile's selection scheme, EV optimal charging scheme, and the annual investment and electricity purchasing costs of the charging piles were saved.
Step 5: Change the group number to k + 1. Determine whether M is reached. If yes, go to Step 6; otherwise, go to Step 4.
Step 6: Summarize the charging pile selection scheme, EV optimal charging scheme, and annual investment and electricity purchasing costs of charging piles in all groups. End the simulation and output the results. were saved.
Step 5: Change the group number to 1 k + . Determine whether M is reached. If yes, go to Step 6; otherwise, go to Step 4.
Step 6: Summarize the charging pile selection scheme, EV optimal charging scheme, and annual investment and electricity purchasing costs of charging piles in all groups. End the simulation and output the results.

Parameter Settings
(1) EV charging-related parameters. In this paper, the selection of EV charging pile at a workplace parking lot was investigated [30]. The working hours from 8:00 to 18:00 was the optimization period T , which was divided into 10 segments with interval t Δ of one hour. The total number of EVs was 256, and the charging of all EVs started at 8:00 for 10 h. The charging power during different periods was optimized and controlled. According to the current mainstream configuration (with a maximum mileage of about 150 km), the specifications of the battery of Bavarian Motor Work (BMW) MINI EV were adopted, and the battery pack capacity was set to 30 kW·h for simulation. Moreover, the expected SOC of each EV was set to 0.95 with considering the charging profile defined by the manufacturer [8], and the initial charge SOC data in the MINI E test

Parameter Settings
(1) EV charging-related parameters. In this paper, the selection of EV charging pile at a workplace parking lot was investigated [30]. The working hours from 8:00 to 18:00 was the optimization period T, which was divided into 10 segments with interval ∆t of one hour. The total number of EVs was 256, and the charging of all EVs started at 8:00 for 10 h. The charging power during different periods was optimized and controlled. According to the current mainstream configuration (with a maximum mileage of about 150 km), the specifications of the battery of Bavarian Motor Work (BMW) MINI EV were adopted, and the battery pack capacity was set to 30 kW·h for simulation. Moreover, the expected SOC of each EV was set to 0.95 with considering the charging profile defined by the manufacturer [8], and the initial charge SOC data in the MINI E test project carried out by BMW China was used for simulation, which was approximately in the normal distribution of N (0.35, 0.05 2 ) [31]. In addition, the range of the initial charge SOC was set to 0.2~0.5.
(2) EV typical charging pattern (TCP). Currently, the most typical method for EV slow charging is the two-stage charging method that alternates between constant current and constant voltage [13]. Throughout the entire charging process, since constant current charging is used for most of the time, its charging power does not vary greatly but only shows a significant increase at the end of constant current charging. For this reason, the EV battery can be regarded as a constant power load. The constant voltage charging was omitted in this paper, and the constant power charging mode was used as the TCP to compare with the optimized charging pattern (OCP). Under the TCP, the charging time of each EV was set to 10 h, and the charging power, which cannot exceed the maximum output power of the charging pile, was calculated with using the charging demand and charging time of EV.
(3) Electricity purchasing price of charging piles. It was assumed that the EV charging price was uniform, including the service price and electricity purchasing price of the charging piles. Only the latter price was investigated in this paper. Specifically, the electricity purchasing price was taken from the time-of-use price of a city [32], as shown in Figure 2. The valley period is from 23:00 to 7:00, for a total of 8 h, with an electricity price of 0.0555$/kWh. The peak period is from 10:00 to 15:00 and from 18:00 to 21:00, for a total of 8 h, with an electricity price of 0.1939$/kWh. The rest of the time is the flat period, with an electricity price of 0.1341$/kWh. project carried out by BMW China was used for simulation, which was approximately in the normal distribution of N (0.35, 0.05 2 ) [31]. In addition, the range of the initial charge SOC was set to 0.2~0.5.
(2) EV typical charging pattern (TCP). Currently, the most typical method for EV slow charging is the two-stage charging method that alternates between constant current and constant voltage [13]. Throughout the entire charging process, since constant current charging is used for most of the time, its charging power does not vary greatly but only shows a significant increase at the end of constant current charging. For this reason, the EV battery can be regarded as a constant power load. The constant voltage charging was omitted in this paper, and the constant power charging mode was used as the TCP to compare with the optimized charging pattern (OCP). Under the TCP, the charging time of each EV was set to 10 h, and the charging power, which cannot exceed the maximum output power of the charging pile, was calculated with using the charging demand and charging time of EV.
(3) Electricity purchasing price of charging piles. It was assumed that the EV charging price was uniform, including the service price and electricity purchasing price of the charging piles. Only the latter price was investigated in this paper. Specifically, the electricity purchasing price was taken from the time-of-use price of a city [32], as shown in Figure 2. The valley period is from 23:00 to 7:00, for a total of 8 h, with an electricity price of 0.0555$/kWh. The peak period is from 10:00 to 15:00 and from 18:00 to 21:00, for a total of 8 h, with an electricity price of 0.1939$/kWh. The rest of the time is the flat period, with an electricity price of 0.1341$/kWh. (4) Type and cost of charging pile. In this paper, three types of charging piles, i.e., Level 1, Level 2, and Level 2M, were taken from [24] Table 1. Among them, the annual maintenance cost was 10% of the purchase cost. It was assumed that all the charging piles to be built were located at the original parking lot of the workplace, and that the additional civil construction costs were not taken into account. The service life of a charging pile is generally five to eight years and was taken as six years in this study. Therefore, according to the calculation method in [23], the (4) Type and cost of charging pile. In this paper, three types of charging piles, i.e., Level 1, Level 2, and Level 2M, were taken from [24] to compose the set CH = Level1, Level2, Level2M for simulation. The maximum output power of the three types of charging piles was 1.8 kW, 7.2 kW, and 9.6 kW, respectively, as the set of the maximum output power MP = 1.8kW, 7.2kW, 9.6kW for simulation. The configuration costs of the three types of charging piles, including purchase, installation, and annual maintenance costs, are shown in Table 1. Among them, the annual maintenance cost was 10% of the purchase cost. It was assumed that all the charging piles to be built were located at the original parking lot of the workplace, and that the additional civil construction costs were not taken into account. The service life of a charging pile is generally five to eight years and was taken as six years in this study. Therefore, according to the calculation method in [23], the annual investment costs on the three types of charging piles f (Level1), f (Level2), and f (Level2M) were 208.82$, 318.22$, and 397.78$, respectively. (5) Selection scheme of charging piles. The impacts of the renovated area of parking lot on charging pile selection were not taken into account. The charging pile selection scheme in typical charging mode in Reference [23] was adopted, i.e., the model for selecting and optimizing the charging piles based on the EV typical charging method. Its goal was to minimize the investment cost of charging piles and its constraint was to meet the users' demands for charging. The model was compared with the two-stage optimization model.
(6) Routine load and transformer capacity. In this paper, the load data on typical workdays was selected for plotting the routine power load [12], as shown in Figure 3. Among the horizontal coordinates, Segment 8 denotes 8:00 to 9:00, Segment 9 denotes 9:00 to 10:00, . . . , and Segment 17 denotes 17:00 to 18:00, the duration of all of which is one hour. The distribution transformer capacity was selected as 1600 kV·A, the power factor was 0.9, and the corresponding maximum active capacity of the distribution transformer was 1440 kW.  (5) Selection scheme of charging piles. The impacts of the renovated area of parking lot on charging pile selection were not taken into account. The charging pile selection scheme in typical charging mode in Reference [23] was adopted, i.e., the model for selecting and optimizing the charging piles based on the EV typical charging method. Its goal was to minimize the investment cost of charging piles and its constraint was to meet the users' demands for charging. The model was compared with the two-stage optimization model. (6) Routine load and transformer capacity. In this paper, the load data on typical workdays was selected for plotting the routine power load [12], as shown in Figure 3. Among the horizontal coordinates, Segment 8 denotes 8:00 to 9:00, Segment 9 denotes 9:00 to 10:00, …, and Segment 17 denotes 17:00 to 18:00, the duration of all of which is one hour. The distribution transformer capacity was selected as 1600 kV·A, the power factor was 0.9, and the corresponding maximum active capacity of the distribution transformer was 1440 kW. (7) Runtime environment of the experiment. In this paper, the configuration parameters of the experimental platform were shown in Table 2.  (7) Runtime environment of the experiment. In this paper, the configuration parameters of the experimental platform were shown in Table 2.

(1) Group Analysis and Optimal Grouping Scheme
Based on the parameters related to EV charging, the Monte Carlo algorithm was used to simulate the charging demands of 256 EVs. And the grouped number of EVs was set to 2, 4, 8, 16, 32, or 64. On this basis, the model in the first stage was used to group these EVs, to obtain the minimum similarity between the groups under different grouping schemes, as shown in Figure 4.

Results and Analysis
(

1) Group Analysis and Optimal Grouping Scheme
Based on the parameters related to EV charging, the Monte Carlo algorithm was used to simulate the charging demands of 256 EVs. And the grouped number of EVs was set to 2, 4, 8, 16, 32, or 64. On this basis, the model in the first stage was used to group these EVs, to obtain the minimum similarity between the groups under different grouping schemes, as shown in Figure 4. As suggested by the figure, with the increase in the number of groups, the absolute value of the minimum similarity between groups gradually decreased. When the number of groups was 32, the minimum similarity between groups was 0.91. As a result, the optimal grouping scheme was 32 groups with 8 vehicles in each group, as shown in Figure 5. The charging demands in each group were evenly distributed, thus validating the effectiveness of the grouping model in the first stage.  As suggested by the figure, with the increase in the number of groups, the absolute value of the minimum similarity between groups gradually decreased. When the number of groups was 32, the minimum similarity between groups was 0.91. As a result, the optimal grouping scheme was 32 groups with 8 vehicles in each group, as shown in Figure 5. The charging demands in each group were evenly distributed, thus validating the effectiveness of the grouping model in the first stage.

Results and Analysis
(1) Group Analysis and Optimal Grouping Scheme Based on the parameters related to EV charging, the Monte Carlo algorithm was used to simulate the charging demands of 256 EVs. And the grouped number of EVs was set to 2, 4, 8, 16, 32, or 64. On this basis, the model in the first stage was used to group these EVs, to obtain the minimum similarity between the groups under different grouping schemes, as shown in Figure 4. As suggested by the figure, with the increase in the number of groups, the absolute value of the minimum similarity between groups gradually decreased. When the number of groups was 32, the minimum similarity between groups was 0.91. As a result, the optimal grouping scheme was 32 groups with 8 vehicles in each group, as shown in Figure 5. The charging demands in each group were evenly distributed, thus validating the effectiveness of the grouping model in the first stage.   Table 3 showed the running time for solving the model in the second stage under different grouping schemes. With the decrease in the number of groups, the running time substantially increased. When the number of groups was 4 or 2, the running time was longer than 1 month or 40 year. Therefore, the running time can be decreased effectively with using the grouped samples in smaller size. According to the optimal grouping scheme in the first stage, the models in the second stage and in the reference were used to select charging piles for each group. To simplify the analysis, the EV samples in the No.1 group were selected. Figure 6 shows the two charging patterns in the No.1 group under different charging pile configuration schemes, that is, the TCP and the OCP. In the TCP, the charging power of each EV was constant. In the OCP, however, the charging power of EVs No.1 to No.3 changed insignificantly, while that of No.4 to No.8 changed significantly. The underlying reason was that the type of charging piles configured for EVs No.1 to No.3 was Level 1, with the maximum output power of 1.8 kW, which limited the adjustable range of the charging power. The type of charging piles configured for other EVs was Level 2, with the maximum output power of 7.2 kW, which could give full play to the adjustability of EV charging.  Table 3 showed the running time for solving the model in the second stage under different grouping schemes. With the decrease in the number of groups, the running time substantially increased. When the number of groups was 4 or 2, the running time was longer than 1 month or 40 year. Therefore, the running time can be decreased effectively with using the grouped samples in smaller size. According to the optimal grouping scheme in the first stage, the models in the second stage and in the reference were used to select charging piles for each group. To simplify the analysis, the EV samples in the No.1 group were selected. Figure 6 shows the two charging patterns in the No.1 group under different charging pile configuration schemes, that is, the TCP and the OCP. In the TCP, the charging power of each EV was constant. In the OCP, however, the charging power of EVs No.1 to No.3 changed insignificantly, while that of No.4 to No.8 changed significantly. The underlying reason was that the type of charging piles configured for EVs No.1 to No.3 was Level 1, with the maximum output power of 1.8 kW, which limited the adjustable range of the charging power. The type of charging piles configured for other EVs was Level 2, with the maximum output power of 7.2 kW, which could give full play to the adjustability of EV charging.  The charge distribution of EVs under different charging patterns is shown in Figures 7 and 8. In the TCP, all EVs' charge during peak period accounted for 50% of the total charge. In contrast, in the OCP, except that the EVs No.1 to No.3 had a large amount of charge during the peak period, the charge during peak period of the EVs No.4 to No.8 all dropped to the lowest level. The charge during peak period of EVs No.1 to No.8 accounted for 22.23% of the total charge. Therefore, EV charging in the OCP could effectively avoid the peak period. The charge distribution of EVs under different charging patterns is shown in Figures 7 and 8. In the TCP, all EVs' charge during peak period accounted for 50% of the total charge. In contrast, in the OCP, except that the EVs No.1 to No.3 had a large amount of charge during the peak period, the charge during peak period of the EVs No.4 to No.8 all dropped to the lowest level. The charge during peak period of EVs No.1 to No.8 accounted for 22.23% of the total charge. Therefore, EV charging in the OCP could effectively avoid the peak period.   Tables 4 and 5. Compared with the TCP, the OCP had a larger demand for Level 2 charging piles. Although the investment cost of charging piles would be increased, the total cost could be reduced by 6.48%.   The charge distribution of EVs under different charging patterns is shown in Figures 7 and 8. In the TCP, all EVs' charge during peak period accounted for 50% of the total charge. In contrast, in the OCP, except that the EVs No.1 to No.3 had a large amount of charge during the peak period, the charge during peak period of the EVs No.4 to No.8 all dropped to the lowest level. The charge during peak period of EVs No.1 to No.8 accounted for 22.23% of the total charge. Therefore, EV charging in the OCP could effectively avoid the peak period.  The selection scheme and costs of charging piles in different charging patterns are shown in Tables 4 and 5. Compared with the TCP, the OCP had a larger demand for Level 2 charging piles. Although the investment cost of charging piles would be increased, the total cost could be reduced by 6.48%.   The selection scheme and costs of charging piles in different charging patterns are shown in Tables 4 and 5. Compared with the TCP, the OCP had a larger demand for Level 2 charging piles. Although the investment cost of charging piles would be increased, the total cost could be reduced by 6.48%. that is, four Level 1 and four Level 2. In the optimal charging method, there were two selection schemes of charging piles, that is, three Level 1 and five Level 2, or two Level 1 and six Level 2.  The selection scheme and costs of charging piles for all EVs under different charging patterns are shown in Tables 6 and 7. Compared with the TCP, the OCP had a larger demand for Level 2 charging piles. Nevertheless, it could reduce the total costs by 6.32%. The charge distribution under different charging patterns is shown in Figure 11. All EVs' charge during peak period accounted for 50% of the total charge in the TCP. In contrast, the percentage was 21% in the OCP. Therefore, EV charging in the OCP could effectively avoid the peak period.   that is, four Level 1 and four Level 2. In the optimal charging method, there were two selection schemes of charging piles, that is, three Level 1 and five Level 2, or two Level 1 and six Level 2.  The selection scheme and costs of charging piles for all EVs under different charging patterns are shown in Tables 6 and 7. Compared with the TCP, the OCP had a larger demand for Level 2 charging piles. Nevertheless, it could reduce the total costs by 6.32%. The charge distribution under different charging patterns is shown in Figure 11. All EVs' charge during peak period accounted for 50% of the total charge in the TCP. In contrast, the percentage was 21% in the OCP. Therefore, EV charging in the OCP could effectively avoid the peak period.    Tables 6 and 7. Compared with the TCP, the OCP had a larger demand for Level 2 charging piles. Nevertheless, it could reduce the total costs by 6.32%. The charge distribution under different charging patterns is shown in Figure 11. All EVs' charge during peak period accounted for 50% of the total charge in the TCP. In contrast, the percentage was 21% in the OCP. Therefore, EV charging in the OCP could effectively avoid the peak period. that is, four Level 1 and four Level 2. In the optimal charging method, there were two selection schemes of charging piles, that is, three Level 1 and five Level 2, or two Level 1 and six Level 2.  The selection scheme and costs of charging piles for all EVs under different charging patterns are shown in Tables 6 and 7. Compared with the TCP, the OCP had a larger demand for Level 2 charging piles. Nevertheless, it could reduce the total costs by 6.32%. The charge distribution under different charging patterns is shown in Figure 11. All EVs' charge during peak period accounted for 50% of the total charge in the TCP. In contrast, the percentage was 21% in the OCP. Therefore, EV charging in the OCP could effectively avoid the peak period.

Conclusions
To promote the coordinated development of both the EVs and charging facilities, this paper was intended to explore the mutual influences between electric vehicle (EV) charging and charging facility planning, to establish a two-stage model for optimizing the EV's charging and charging pile's selection. The major contributions of this study are as follows: Firstly, this paper proposed an EV grouping method in the first stage. Under the premise of meeting the principles for grouping EVs, a preset quantity of EVs were effectively grouped to guarantee that the charging demands in each group were evenly distributed.
Secondly, this paper proposed a coordinated optimization of EV charging and charging pile selection method in the second stage. Compared with the TCP, EV charging in the OCP could effectively avoid the peak period, and thus lower electricity purchasing cost of charging pile. Although the investment cost of charging piles would be increased in the OCP, the total cost could be reduced by 6.32%.
Moreover, since this article took into account the charging demand of each EV and the charging power levels of different charging piles, the proposed method can effectively improve the precision level of charging facility planning.