## 4 Case Study
### The AS Provision Case  
In the AS provision case, CHP units, battery storage, and industrial load control are considered as ancillary service assets, with the parameters previously defined in Tables 2-4. Figure 6: The base case MG operation. Figure 7: The base case MG operation per unit. In addition, two different sub-cases are considered: (a) The case with grid modeling, where all voltage profiles and MG power losses are considered; (b) The case without grid modeling, where MG is considered to have all assets connected to a single bus. The latter case was usually the case study of previous research papers. The goal of this paper is to show the importance of grid modeling by comparing the results of sub-cases (a) and (b). The AS request is modeled by Virtual Load in the point of connection, as shown in Figure 8. It represents three requests for AS provision, with different amounts of power requested in both the upward and downward directions. After running the optimization procedure for the model represented in Chapter 2, using Genetic Algorithm (GA), the obtained results are shown in Figure 9 for sub-case (a) and in Figure 10 for sub-case (b), as well as in Table 5 for both cases. To avoid confusion, it should be noted that in single-bus modeling (sub-case (b)), the names of the assets are kept the same, so \"Battery node 10\" and \"Battery node 5\" can be seen. These are only their names, while all the assets are connected to the same bus. Therefore, nodes 5 and 10 do not exist in this case. Additionally, L1-L5 in Figures 9 and 10 refer to controllable loads, as defined in Table 4.  
Fitness values are metrics proportional to the objective functions, a term specific to genetic algorithms. Fitness values indicate how good a solution is, with lower values being better in the context of our minimization problem, as defined by Equation (1). By comparing the fitness values of both solutions, with sub-case (a) having the fitness value of 178.37 and sub-case (b) having the fitness value of 178.8, it can be wrongly concluded that the case without modeling the grid is the same for MG operation. However, it must not be forgotten that this fitness value does not consider power losses that actually exist in real MG. For this reason, another load flow procedure is conducted using the solution of sub-case (b). After obtaining the load flow results, the fitness value is recalculated, and a value of 197.99 is obtained. This procedure of comparative analysis and fitness value recalculation is shown in Figure 11.  
Finally, the obtained results can be used to evaluate the improvement of the objective function, which also indicates technical and economic improvement of MG operation. Technically, the detailed grid modeling in sub-case (a) enhances accuracy by accounting for power losses and ensuring voltage profiles stay within safe limits. Economically, this approach leads to a more precise assessment of operational costs, reducing unnecessary energy expenditure and optimizing asset use. To evaluate the Improvement Factor (IF), the fitness values of both sub-cases (_Fitness\({}^{a}\)_ and _Fitness\({}^{b}\)_) are compared as per Equation (22). It must be noted that fitness values are compared at the real microgrid level from Figure 11.  
\[IF=\left|\frac{Fitness^{a}-Fitness^{b}}{Fitness^{a}}\right|\times 100\%\ \approx\ 11\% \tag{22}\]  
Figure 10: Optimal AS provision without grid modeling (sub-case (b)).