Academic Journal of Science and Technology ISSN: 2771-3032 | Vol. 1, No. 3, 2022 43 Research on Optimal Design of Microgrid Including Electric Vehicles Zhongwei Qi1, 2, Hongyu Li1, Limei Yan1, Haishuang Yin1 1College of Electrical and Information Engineering, Northeast Petroleum University, Daqing 163000, Heilongjiang Province, China 2The Second Oil Production Plant of Daqing Oilfield, Daqing 163000, Heilongjiang Province, China Abstract: In view of the lack of consideration of electric vehicles in the design stage of microgrid, the use of traditional optimization algorithm in optimization design method, and only considering economic factors in optimization design index, this paper focuses on the mathematical model of electric vehicles, considering pollutants emission and other factors, and establishes a mathematical model of distributed energy. At the same time, the optimization design model of the microgrid and the constraints of the optimization problem were established, and the sparrow search algorithm with better comprehensive performance was used for reference. Finally, the optimization design and operation results of the microgrid were obtained. The simulation results proved the scientific and feasibility of the microgrid with electric vehicles under the new algorithm. Keywords: Power system, Microgrid, New energy, Sparrow optimization algorithm, Optimization design. 1. Introduction 1.1. Mathematical Models of Climatic Factors Both wind power generation and photovoltaic power generation are affected by weather factors. It is mentioned in literature [7] that wind speed changes constantly in a particular location, which depends on the local land terrain, weather system and ground height. Therefore, it is necessary to capture the change of wind speed in the model to predict power generation [8]. The Weibull probability density function can describe the change of wind speed. The Weibull probability function of wind speed (V) can be expressed as: 1 ( , , ) exp k k k V V f V k c c c c                      (1) As for the probability of temperature distribution data, the probability function described in literature [9] allows modeling of temperature behavior in system design. Distribution parameters are calculated with temperature data, and the formula is as follows:   , 1 1 , , n a a i a i T T f T h n K nh h            (2) Compare and select the calculation formula of light radiation conforming to probability density function: 1 1 max max ( ) ( ) 1 ( ) ( ) r r f r r r                           (3) 1.2. Distributed Energy Mathematical Model According to the current research on photovoltaic power generation, the output power of photovoltaic power generation can be expressed as:  0 0 ( ) ( ) ( )MT pv pv pv Pm M M G t P t f P T t T G      (4) Many wind power models such as WPMS, WPPT, Prediktor, ARMINES, Previento and WPFS Ver1.0 have been developed internationally. Among them, the commonly used mathematical model of wind power generation is: 2 2 2 2 or ; ( ) ; 0; M C wt C R R C wt R R F C F v v P v v v v v P t P v v v v v v v                 (5) The output power of the diesel generator (PG) is: ( ) ( )dg DG dgiP t P t (6) The energy storage formula established in this study for pumped storage system is as follows:     ( 1) ( ) 1 3600 ( ) ( )ba ba ba ba tE t E t q t q t     (7) The energy in the battery described in reference [10] accords with the expression in Formula (8), and takes into account that the charging and discharging powers are expressed by different variables Pbc and Pbd, both of which are positive.   1 ( 1) ( ) 1 ( ) ( )b b sd bc bc bd bd E t E t P t P t              (8) 44 1.3. Mathematical Model of Electric Vehicle System The types of electric vehicles are mainly divided into two types: the first type of electric vehicles, can only be used as charging load, can not provide energy output system. The second type of electric vehicle can be used as charging load or energy source to provide energy to the system. The second type of electric vehicle obeys the probability density function shown in Formula (9). 2 2 1 (ln ) ( ) exp 22 d f d d             (9) Therefore, through statistical random sampling of the cumulative probability of the above normal distribution and lognormal distribution, PEV's departure time, arrival time and daily driving distance can be obtained. 2. Optimization Design Model of Microgrid Including Electric Vehicles 2.1. Modeling of Microgrid Optimization Design Model Including Electric Vehicles In order to clarify the optimization problem, the battery needs to consider the different charge and discharge power, the power and pumping power generated by the turbine in the pumped storage system, the different types of charge and discharge power of electric vehicles, etc. Therefore, the degree of freedom of the design of the optimization variable can be obtained as follows: Number of photovoltaic panels (Npv), number of wind turbines (Nwt), Number of batteries (Nb), volume of water tank of pumped storage system (V), power transmitted by diesel generator set per hour (PGi(T)), battery charging power per hour (Pbc(T)), battery discharge power per hour (Pbd(T)), The power of water pumped per hour (Pba(t)), the power of water wheel delivered per hour (Pt(t)), the charging power of class I electric vehicles per hour (Pv1c(t)), the charging power of class II electric vehicles per hour (Pv2c(t)), Second class ev discharge power per hour (Pv2d(t)) and unsupplied power demand per hour (Pns(t)). The optimization variable can be expressed as a one-dimensional matrix: 1 2 2 ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( = ) T pv wt b Gi bc bd ba t v c v c v d ns x N N N V P t P t P t P t P t P t P t P t P t          (10) The objective function of this study is a multi-objective optimization function, which is essentially a multi-objective optimization problem. The objective function mainly includes the annual total cost CT of the system and the total carbon dioxide emission ET of the system. Combined with the research focus of this paper, the total annual cost of the system can be described as follows: T cp mt GC C C C   (11) Total system carbon dioxide emissions, total system emissions generated during component construction and diesel generator operation, ET is calculated by:            1 max ( ) max ( ) ( ) 2 c T M pv M wt M b Gba T pv pv c wt wt c b b c ba t op cd t c E T E N P E N P E N P E P t P t E G t T             (12) To solve this multi-objective optimization problem, a weighted summation method will be used, in which a weight factor is assigned to each objective, as shown in Formula (20) (a weight factor is assigned to CT and a weight factor wEET to total emissions).  min x T E Tf C w E  (13) 2.2. Optimize Design Model Constraints Battery pack, type 2 EV battery and pumped storage system must be kept within the permitted operating range. The specific requirement constraint formula is as follows: ( )m M b b b b bN E E t N E  (14) 0 ( )baE t V  (15) 3 ( ) 3m M v v vE E t E  (16) The daily discharge of type 2 electric vehicle must be greater than or equal to 80% of the energy used in daily travel during the running time. The specific demand constraint formula is as follows: 2 2 2 0.8 3 v b v d v G M P h        (17) 2.3. Research on Sparrow Optimization Algorithm The economic dispatching of microgrid is a nonlinear, multi- model, multi-objective complex system optimization problem. At the same time, based on the advanced in the field of artificial intelligence all sorts of modern intelligent algorithm is also gradually be applied to the actual power system engineering design, the early main using functional analysis, fuzzy system, genetic algorithm (ga) optimization method, but with the development of computer technology, the traditional intelligent optimization algorithm in convergence speed, precision, etc have been unable to meet the increasingly complex problems. In recent years, new intelligent algorithms such as new swarm intelligence optimization algorithm and new intelligent optimization algorithm have been proposed gradually. Through detailed comparative analysis, it is found that the performance of the latest sparrow search algorithm is outstanding, and it has good results in solving accuracy, convergence speed and execution time. Sparrow Search Algorithm (SSA) is an effective optimization technology, which simulates the group intelligence foraging and anti-predation behavior of sparrows. Compared with many other small birds, sparrows have strong intelligence and strong memory, so SSA can be rapidly promoted and applied. The techniques involved are used to solve global optimization problems because of their simplicity, flexibility, and efficiency. 3. An Example of Optimal Design of Microgrid with Electric Vehicle 3.1. Optimization Design Results of Microgrid Including Electric Vehicles Containing micro grid optimization design of electric cars through the sparrow search algorithm to calculate the optimal design results are shown in table 1, as can be seen from the table, the amount of electric cars in 50 vehicles, including type 1 as charging electric cars only 20, type 2 can be two-way transmission of the electric car 30 energy, in order to avoid the randomness of wind power generation, There are only 6 wind turbines and 823 photovoltaic panels. The total annual cost of the optimized system includes the emission cost 45 of 5.8654*106 RMB, the diesel saving cost is 1.3582*106 RMB, the total carbon dioxide of the system is 3731 tons, and the carbon dioxide emission reduction of the system is 1578 tons. Table 1. Micro-grid design optimization design results Optimization parameters optimization design results Optimization parameters optimization design results The number of iterations is 460 The number of iterations is 460 The best score is 10-300 The best score is 10-300 Number of wind turbines: 6 Number of wind turbines: 6 The number of photovoltaic panels is 823 The number of photovoltaic panels is 823 The battery quantity is 17 The battery quantity is 17 The number of type 1 electric bullet train is 20 The number of type 1 electric bullet train is 20 The number of type 2 electric vehicles is 30 The number of type 2 electric vehicles is 30 Pumped storage system water tank volume 2030m3 Pumped storage system water tank volume 2030m3 The rated power of the turbine is 23.896 kW The rated power of the turbine is 23.896 kW Pump rated power 334.83kW Pump rated power 334.83kW Total cost (including emission cost) 5.8654*106¥ Total cost (including emission cost) 5.8654*106¥ Diesel saves 1.3582*106¥ Diesel saves 1.3582*106¥ The system emits 3731 tons of carbon dioxide The system emits 3731 tons of carbon dioxide 3.2. Optimization Design Results of Microgrid Including Electric Vehicles In the day of wind power output is affected by wind speed is larger, with strong randomness and uncertainty, so in the actual power grid in order to obtain steady power output, should choose wind generating set less, and the tendency of photovoltaic power generation is affected by radiation and temperature, Power generation in the one day there is a clear and predictable trend, observation of photovoltaic power from the figure, you can see the photovoltaic and above for radiation and the trend of climate factors of temperature, beginning early in the morning the sun rises with optical radiation, photovoltaic power begins to increase gradually, until noon ray radiation and temperature height, photovoltaic power maximum. After noon, the sun gradually falls, the temperature gradually decreases, and the power of photovoltaic power generation gradually decreases. Therefore, when the output of photovoltaic power generation is large, energy storage can be used to store the energy beyond the power demand, and energy will be released by the way of energy storage battery discharge at the peak of electricity consumption in the evening. The power demand, diesel power generation and the operating status of new energy, where the power of new energy is the sum of the combined output of photovoltaic power generation and wind power generation. Can be seen in the figure, the photovoltaic (pv) power optimization results than the results of the wind power when the output of the new energy is mainly composed of photovoltaic power, thus has the high regularity and predictability, can see from. at the same time, in the case of lack of new energy output, system mainly with the method of diesel generator, and when the new energy power generation output is large, the power demand of the system mainly adopts the output mode of new energy. It can be seen that at the initial output stage of new energy, the output of diesel generator gradually decreases, and the power demand of micro-grid is mainly new energy. When the output of new energy increases to a certain power value, the output of diesel power generation does not. At this point, the charging power of the energy storage battery begins to increase, the electric quantity stored by the energy storage battery gradually rises, and the power generation output of new energy begins to decline. In order to meet the power demand of the system, the charging power of the energy storage battery begins to decline, and the energy storage of the energy storage battery reaches its peak. When a new output dropped to a lower energy level, the system first by the energy storage battery discharge meet the demand of electric power system, energy storage battery discharge power gradually rise, when the energy storage battery power down to a certain level, just as the evening peak, began to increase the output power of diesel generators, storage battery output power decreases, energy storage batteries store energy also gradually reduced, At this time, the power demand of the system is mainly diesel power generation. The electric power demand, pumped storage charge and discharge and water can run energy state, can be seen from the diagram, and the energy storage battery energy storage and put to work idea is consistent, in new energy output is large, by a gradual increase in pump pumping pumped storage power, at the peak, can begin to put through the turbine, So that the whole system can effectively use new energy to generate electricity, and at the same time meet the work of the system peak regulation operation. 4. Conclusion In this study, an optimization design method of microgrid containing electric vehicles based on sparrow search intelligent algorithm is proposed, and the mathematical model of distributed energy of microgrid and the mathematical model of two kinds of electric vehicles are established, and the optimization model is further established and the constraint conditions are clarified. At the same time, the algorithm optimization of the microgrid and programming with MATLAB software verify the scientific and feasibility of the proposed method. This study initially solves the problems of electric vehicle integration and climate data considered in the design stage, and uses the new intelligent optimization algorithm to avoid lighter and wind losses, reflecting the due economic value. At the same time, the emission of CO2, SO2, NO and NO2 of the unit is the lowest, so as to achieve the effect of energy saving and economic improvement. Acknowledgment This paper is supported by the higher education teaching reform project of Heilongjiang Province (No. SJGY20210111). References [1] Xu Jianjun, Huang Lida, Yan Limei, Yi Na. Insulator Self- Explosion Defect Detection Based on Hierarchical Multi-Task Deep Learning[J]. Transactions of China Electrotechnical Society, 2021,36(07):1407-1415. 46 [2] Limei,LIU Yongqiang,XU Jianjun,et al.Broken string diagnosis of composite insulator based on Grabcut segmentation and filler area discrimination[J].Power System Protection and Control,2021,49(22):114-119 [3] Yi, Q. Wang, L. Yan, et al., A multi-stage game model for the false data injection attack from attacker’s perspective. Sustainable Energy Grids & Networks 28 (2021). [4] Na Yi,Jianjun Xu,Limei Yan,Lin Huang. Task Optimization and Scheduling of Distributed Cyber-physical System Based on Improved Ant Colony Algorithm. Future Generation Computer Systems, 109(Aug. 2020),134-148. [5] Yang Zhao, Jianjun Xu, Jingchun Wu. A New Method for Bad Data Identification of Oilfield Power System Based on Enhanced Gravitational Search-Fuzzy C-Means Algorithm. IEEE Transactions on Industrial Informatics. VOL. 15, NO. 11, NOVEMBER 2019 5963-5970 [6] Jing Han,Xi Wang,LiMei Yan, Aida Dahlak, et al. Modelling the performance of an SOEC by optimization of neural network with MPSO algorithm. International Journal of Hydrogen Energy, Volume 44, Issue 51, 22 October 2019, Pages 27947- 27957.