## 5 Optimisation of a Wind Farm--Kinetic Energy Storage System
### Selection of Optimisation Method, Description of Application Developed  
The selection of the optimisation method dedicated to the solution defined in Section 5.1 of the task requires a detailed analysis of several elements, including in particular: the form of the function of the objective, the number of decisive variables and the size of the acceptable solution area [25; 34; 35; 36]. Additionally, one should consider the possibilities of including in the optimisation complex numerical calculations used for identifying the value of the function of the objective and constraint control. The experience of the authors in the effective use of the method to solve similar tasks is very important [37].  
The multi-modal nature of the acquired function of Equation (11) requires the use of stochastic methods or heuristics in order to seek its global extreme. Even though only five variables were defined in the reference task, the task remains complex and time-consuming, as a result of the multiple identification of changes in the power value in the analysed system, the integer nature of decisive variables and the hidden occurrence of variables in the criterion function. In relation to the above, a genetic algorithm population method is used to optimise the structure of a wind farm-kinetic energy storage system, which leads to the minimisation of storage capacity \(A_{FESS}\), according to the system operation algorithm described in Section 2.1. An important advantage of the method is related to its ability to modify the basic parameters in order to improve its effectiveness when performing detailed tasks. A disadvantage in the case of tasks with highly complex calculations is the reduced reproducibility of the results [35; 36]. It is also necessary to perform initial tests whose results help to identify the appropriate AG parameters that would improve the reproducibility of the results and reduce calculation time.  
The effectiveness of the proposed method in solving tasks of global optimisation in the area of electrical engineering and renewable energy was proven in a number of scientific publications, e.g., [38; 39] and the authors used it successfully to optimise the structure of complex electrical light systems, the shape and parameters of high-power lines, and to minimise the cost of power generation in hybrid generation systems [37; 40; 41; 42; 43; 44; 45].  
Based on the mathematical model described in Section 3 and a selected optimisation method in Matlab (Linceno: 975466, Version 2014b, Poznan University of Technology, Poznan, Poland, 2014) and MS Visual Studio environment, an application was developed intended to optimise the structure of a wind farm--kinetic energy storage system with a view to minimising energy storage capacity. The application uses proprietary structures and classes related to different types of energy storage, wind turbines, PV modules, power electronics systems and indicators of the reliability of power supplies to the power grid mentioned in Section 4, as well as functions from the Global optimisation toolbox of the Matlab environment to implement the modified genetic algorithm method.  
The assessment of the quality of solutions obtained through optimisation required an analysis of power: generated by farm \(P_{1}\), energy storage \(P_{2}\), and supplied to the power grid \(P_{3}\) in the analysed system. To that end, measurements of the wind speed in a one-year period and data from wind turbines and PV modules collected in a database developed for the purpose of the application were used.  
The Augmented Lagrangian Genetic Algorithm (ALGA) interior penalty function method [46] was employed to consider the constraints of the optimisation tasks (Equations (12)-(14)). The ALGA method was implemented in the Matlab environment.