Comparative PSO Optimisation of Microgrid Management Models in Island Operation to Minimise Cost

: The rapid progress in renewable energy sources and the increasing complexity of energy distribution networks have highlighted the need for efficient and intelligent energy management systems. This paper presents a comparative analysis of two optimisation algorithms, P and M70, used for the optimal control of the operation of microgrids in islanded mode. The main objective is to minimise production costs while ensuring a reliable energy supply. Algorithm P prioritises the use of photovoltaic (PV) and battery storage and operates the diesel generator at minimum capacity to reduce fuel consumption and maximise the use of renewable energy sources. Algorithm M70, on the other hand, uses a heuristic approach to adaptively manage energy resources in real time. In this study, the performance of both algorithms is evaluated through simulation in different operating scenarios. The results show that both algorithms significantly improve the efficiency of the microgrid, with the M70 algorithm showing better adaptability and cost efficiency in dynamic environments. This research contributes to ongoing efforts to develop robust and scalable energy management systems for future smart grids


Introduction
The increasing integration of renewable energy sources (RESs) into power systems has necessitated the development of advanced control strategies for microgrids, especially those operating in island mode.Microgrids, which can operate independently or in conjunction with the main grid, offer a promising solution for enhancing the reliability and resilience of power supply, particularly in remote or isolated areas.The ability to operate autonomously in island mode is particularly crucial during grid outages, natural disasters, or other emergencies [1,2].
Microgrid management involves the optimisation of various components, including photovoltaic (PV) systems, wind turbines, diesel generators, and battery energy storage systems.Effective management ensures not only the stability and reliability of the power supply but also the economic operation of the microgrid by minimising production costs and maximising the utilisation of renewable energy [3,4].However, the inherent variability and uncertainty of RESs pose significant challenges to microgrid operation, necessitating robust and adaptive control strategies.
This paper focuses on two advanced optimisation algorithms, P and M70, designed to manage microgrid operations in island mode.The P algorithm employs Particle Swarm Optimisation (PSO) to determine the optimal sizing of PV fields and battery capacities.This approach maximises the use of PV energy while minimising the dependence on diesel generators, thereby reducing overall production costs.On the other hand, the M70 algorithm extends the capabilities of the P algorithm by dynamically adjusting the charge limit (chrLim) of diesel generators, also utilising PSO for optimisation.This dynamic Energies 2024, 17, 3901 2 of 19 adjustment allows for more efficient management of energy resources, further enhancing cost efficiency and operational performance [5,6].
The primary objective of this study is to compare the performance of the P and M70 algorithms in optimising microgrid operations in island mode.By conducting a series of simulations, we evaluate the effectiveness of these algorithms in minimising production costs and improving energy management.The results provide valuable insights into the potential of advanced optimisation techniques to enhance the economic and operational performance of microgrids.
In addition to the technical evaluation, this paper also addresses the practical implications of implementing these algorithms in real-world scenarios.By validating the simulation results against a laboratory-scale microgrid model, we ensure that the proposed strategies are both effective and feasible for practical applications [7].This validation is pivotal in bridging the gap between theoretical research and real-world implementation [8].
In the literature on the optimisation of hybrid energy systems, a variety of methods have been proposed to overcome the challenges of cost minimisation, energy production calculation and system management.For example, graphical methods have been used to determine the optimal number of photovoltaic modules and batteries for cost minimisation, to highlight the minimum system costs at the tangent points of cost curves and to optimise the size of wind turbines and photovoltaic arrays [9][10][11].Probabilistic approaches have been applied to calculate the total energy production of hybrid systems and have proven their effectiveness in dealing with uncertainties and fluctuations in energy production [12,13].
In sizing hybrid systems and minimising costs, as well as in optimising systems with respect to energy prices and the probability of load losses, the iterative linear programming approaches have been used [14,15].In order to reduce grid costs and optimise hybrid systems in both parallel and islanded operation, the dynamic programming techniques have been used extensively and also to optimise microgrid management [16][17][18][19][20][21].These methods aim to increase the efficiency and reliability of energy systems by improving management strategies and minimising operating costs.
More advanced techniques such as Genetic Algorithms and neural networks have been used to optimise the management and sizing of solar and hybrid systems, including PV, wind turbines and other components [22][23][24][25][26]. Multi-objective optimisation approaches, including Multi-Objective PSO (MOPSO), have been used to optimise hybrid systems, greenhouse gas emissions and the economic use of hybrid systems, often reconciling multiple conflicting objectives [27][28][29][30][31][32][33][34][35].Forecasting methods, software tools and reinforcement learning techniques have also been explored for energy forecasting, system simulation and optimised energy management [36][37][38][39][40].Overall, these methods demonstrate the diverse and innovative approaches that researchers have developed to improve the performance, efficiency and sustainability of hybrid energy systems.
From the analysis of the reviews, particle swarm optimisation proves to be an extremely effective method due to its versatility, fast convergence and high performance.The ability of PSO to be seamlessly integrated with other smart techniques further enhances its utility.Therefore, we have decided to use PSO in our research to take advantage of its fast and efficient optimisation capabilities for energy management in microgrids [41].
Table 1 provides an overview of the various optimisation methods being used in energy management systems for microgrids from 2018 to 2024.It lists the proposed optimisation methods and their advantages and disadvantages.The methods include Particle Swarm Optimisation (PSO), Dynamic Programming, Multi-Objective Particle Swarm Optimisation (MOPSO), Genetic Algorithms (Gas), Robust Optimisation (RO) and simulations using HOMER Pro 3.14.5 software.The strengths and weaknesses of each method are highlighted, such as cost efficiency, fast convergence and high performance, in contrast to challenges such as high computational requirements, complexity in implementation and the need for extensive data.This paper, which uses PSO for optimising microgrid systems, shares many advantages with other PSO-based approaches, such as adaptability to various constraints, fast convergence and high performance.The novelty of our work lies in the dynamic adjustment of the limit up to which the diesel generator charges the battery (chrLim), which increases the cost efficiency and reliability of the system.This method enables real-time adjustments, which ensures more efficient and cost-effective energy management compared to static optimisation methods.Although our approach also requires careful parameter tuning and can be computationally intensive, it offers significant improvements in terms of responsiveness and overall efficiency, setting it apart from other methods investigated.
The main contributions of this paper are as follows: • Objective 1: Analysis, systematisation and selection of optimal centralised microgrid management in islanded operation.This paper presents a comprehensive analysis of existing microgrid management models, focusing on their optimisation methods.Different approaches, including classical methods, metaheuristic techniques and artificial intelligence-based management, are analysed.Metaheuristic Particle Swarm Optimisation (PSO) is used due to its adaptability to problems with different types of constraints and objective functions and its iterative process of searching the solution space, improving the results through multiple iterations [34,35].

•
Objective 2: Simulation model of centralised microgrid management considering microgrid components.In this paper, a detailed simulation model for centralised microgrid management is developed considering all relevant components such as photovoltaic panels, battery storage systems, diesel generators and bidirectional converters.This model was created using MATLAB R2022a Simulink and the Simscape Power Systems Toolbox and provides a robust environment for analysing and optimising the performance of microgrids under different conditions and configurations.

•
Objective 3: Evaluation of the microgrid simulation model.The effectiveness of the proposed simulation model is evaluated through extensive simulations.Comparative analyses will be conducted to measure the performance of different management strategies, focusing on cost minimisation, reliability and resource utilisation.The results highlight the benefits of integrating advanced optimisation techniques such as PSO for optimal microgrid management.
The novelty of this work lies In the development and comparative analysis of two optimisation algorithms, P and M70, for the management of microgrids in islanded operation.The M70 algorithm introduces a dynamic adjustment of the charging limit of the diesel generator (chrLim) using PSO and offers a novel, adaptive and cost-efficient solution for energy management.This innovative approach improves the operational efficiency and economic viability of microgrids, especially in isolated environments.
The remainder of this paper is organised as follows.Section 2 describes the methodology, including the detailed workings of the P and M70 algorithms and the simulation setup.Section 3 presents the simulation results and a comparative analysis of the two algorithms.Section 4 discusses the practical implications of the findings and validates the results using a laboratory model.Finally, Section 5 concludes the paper and outlines directions for future research.

Methodology and Mathematical Modelling
This section presents new management algorithms for determining the optimal management model and performing simulations to determine the optimal management of a microgrid in islanded operation based on minimising production costs.An innovative approach is demonstrated by redefining battery storage in contrast to the classical charging approach used in the cited literature [19][20][21]36].
To solve this problem, the metaheuristic method of Particle Swarm Optimisation (PSO) is used.PSO is a simple and effective method commonly used for energy management systems (EMS) in microgrids [42,43,49,50].The PSO method is applied to two different algorithms for microgrid management: First algorithm (algorithm P): In this algorithm, the loads (P Ti ) are supplied primarily by the photovoltaic (PV), then by the battery bank and only when the battery bank is exhausted, when the State of Charge (SOC) of the battery in percent is less than 20% and the PV panels (P Pvi ) do not provide enough power, by the diesel generator (DG).The DG operates with a variable output power (P Dgi ), which is required to cover the consumption demand (P Ti ), while the battery bank (P Bti ) is charged exclusively by the PV source (Figure 1).
Energies 2024, 17, x FOR PEER REVIEW 5 of 20 diesel generator (chrLim) using PSO and offers a novel, adaptive and cost-efficient solution for energy management.This innovative approach improves the operational efficiency and economic viability of microgrids, especially in isolated environments.The remainder of this paper is organised as follows.Section 2 describes the methodology, including the detailed workings of the P and M70 algorithms and the simulation setup.Section 3 presents the simulation results and a comparative analysis of the two algorithms.Section 4 discusses the practical implications of the findings and validates the results using a laboratory model.Finally, Section 5 concludes the paper and outlines directions for future research.

Methodology and Mathematical Modelling
This section presents new management algorithms for determining the optimal management model and performing simulations to determine the optimal management of a microgrid in islanded operation based on minimising production costs.An innovative approach is demonstrated by redefining battery storage in contrast to the classical charging approach used in the cited literature [19][20][21]36].
To solve this problem, the metaheuristic method of Particle Swarm Optimisation (PSO) is used.PSO is a simple and effective method commonly used for energy management systems (EMS) in microgrids [42,43,49,50].The PSO method is applied to two different algorithms for microgrid management: First algorithm (algorithm P): In this algorithm, the loads (PTi) are supplied primarily by the photovoltaic (PV), then by the battery bank and only when the battery bank is exhausted, when the State of Charge (SOC) of the battery in percent is less than 20% and the PV panels (PPvi) do not provide enough power, by the diesel generator (DG).The DG operates with a variable output power (PDgi), which is required to cover the consumption demand (PTi), while the battery bank (PBti) is charged exclusively by the PV source (Figure 1).The management therefore starts with the following condition-that the power of the PV field (PPvi) is sufficient to cover the consumption (PTi).In this case, the entire consumption is covered by the PV field and the surplus from the photovoltaic field is transferred The management therefore starts with the following condition-that the power of the PV field (P Pvi ) is sufficient to cover the consumption (P Ti ).In this case, the entire consumption is covered by the PV field and the surplus from the photovoltaic field is transferred to the battery bank until it is full (SOC = 98%).When the battery bank is charged up to 98%, the charging process is stopped in order to preserve the battery's service life.
If the power of the PV field is not sufficient to supply the load, the power from the battery (P Bti ) is used, on the condition that the battery is only used after 80% charge to maximise the use of the battery energy and maintain its lifetime.The battery serves as a power source for consumption until we receive power from the PV field again or until we have used up the battery capacity (down to 20%).
When the battery is discharged to 20% and the PV field is still not producing enough power to supply the load, the diesel generator is switched on to supply only the load (P Dgi = P Ti ).The DG covers the consumption until the battery is 80% charged or until the PV field supplies enough power to cover the consumption.
The second algorithm (algorithm M70) differs from algorithm P in that the level (chrLim 70 ) to which the diesel generator charges the battery is calculated in the PSO process before the management algorithm is started and after the system has been dimensioned and modelled.The chrLim 70 level is dynamically determined by the input parameters of the model and represents an innovative contribution to microgrid management.Once set, chrLim 70 remains constant over the entire lifetime of the project.The difference to algorithm P is that in algorithm M70 the load is supplied by both the PV and the battery.Only when the supply from these sources is no longer sufficient does the DG take over the full supply to the load and charges the battery up to chrLim 70 .In algorithm M70, the diesel generator operates continuously at 100% output power after activation, as this is when its efficiency is at its highest (Figure 2).98%, the charging process is stopped in order to preserve the battery's service life.
If the power of the PV field is not sufficient to supply the load, the power from the battery (PBti) is used, on the condition that the battery is only used after 80% charge to maximise the use of the battery energy and maintain its lifetime.The battery serves as a power source for consumption until we receive power from the PV field again or until we have used up the battery capacity (down to 20%).
When the battery is discharged to 20% and the PV field is still not producing enough power to supply the load, the diesel generator is switched on to supply only the load (PDgi = PTi).The DG covers the consumption until the battery is 80% charged or until the PV field supplies enough power to cover the consumption.
The second algorithm (algorithm M70) differs from algorithm P in that the level (chrLim70) to which the diesel generator charges the battery is calculated in the PSO process before the management algorithm is started and after the system has been dimensioned and modelled.The chrLim70 level is dynamically determined by the input parameters of the model and represents an innovative contribution to microgrid management.Once set, chrLim70 remains constant over the entire lifetime of the project.The difference to algorithm P is that in algorithm M70 the load is supplied by both the PV and the battery.Only when the supply from these sources is no longer sufficient does the DG take over the full supply to the load and charges the battery up to chrLim70.In algorithm M70, the diesel generator operates continuously at 100% output power after activation, as this is when its efficiency is at its highest (Figure 2).

Selection of Optimal Management
The selection of the optimal management is based on two previously proposed management algorithms (P and M70).The methodology consists of the following steps:

Selection of Optimal Management
The selection of the optimal management is based on two previously proposed management algorithms (P and M70).The methodology consists of the following steps: 1.
Preparation of the microgrid model: A microgrid model with discrete data is created to simulate the real operating conditions.MATLAB R2022a Simulink with the Simscape Power Systems Toolbox, which enables the modelling and analysis of energy systems, is used for the simulation.The model includes PV modules, a battery, a diesel generator, a bidirectional converter and loads.Parameters and constraints are also defined for each element of the MG. 2.
Implementation of the PSO algorithm (Figure 3): The PSO algorithm is used to optimise the management of the MG.This process includes initialising a population of particles, evaluating the objective function, updating the velocity and position of the particles, checking convergence and selecting the optimal management model.

3.
Simulation of the proposed management algorithms: The proposed management algorithms are simulated in MATLAB R2022a Simulink using the Simscape Power Systems Toolbox.This setup enables the modelling and analysis of power systems.Parallel processing is used to speed up the execution of the algorithms and achieve efficient results.4.
Analysis and comparison of the results: The results of the two algorithms for the management of the microgrid in islanded mode are analysed and compared.The production costs, including the fuel costs for the diesel generator, the maintenance  Algorithm P model: The output of the photovoltaic system (P PV ui and the battery capacity K BT ui are dimensioned using the PSO method in the solution space, subject to the condition that the total project costs (UTP) are minimised over N years, as described in Formulas ( 1)- (7).
Algorithm M70 model: This model builds on algorithm P by also determining the chrLim value, i.e., the value up to which the DG charges the batteries before it is switched off and switched to the RES.The photovoltaic field power (P PV ui and the battery capacity K BT ui are dimensioned using the PSO method within the solution space, optimising the chrLim value to minimise the UTP over N years, as described in Formulas ( 8)- (14).The chrLim value is calculated using the PSO method with the input values P PV ui and K BT ui .In the P algorithm model, the battery is charged to 80% before switching to RES, while in the M70 algorithm model, chrLim is determined dynamically for each pair of module power and battery capacity.The optimal chrLim value is between 50% and 80%, with 74% being optimal in our case.
To select the optimal microgrid management model for islanding based on production cost minimisation, the objective function has to be defined in order to minimise the total project cost for the P management algorithm as described below. minC (1) (5) (2) (3) where C UTP = total project costs, C 0 = initial investment costs, C S j=N = residual value of equipment at the end of the project, C odr j = maintenance costs in year j without fuel costs, C odr jmod10=0 = cost of replacing the equipment in the 10th year, C odr jmod15=0 = cost of replacing the equipment in the 15th year, P PV i = power generated by the panels at time i, P T i = power required by the consumers at time i, dP i = P PV i − P T i = power difference in the microgrid (MG), SOC i = state of charge of the battery in per cent, K BT i = stored battery energy at time i, dK P i = battery charging energy at time i, K PV i = energy used to charge the battery by solar panels at time i, G i = fuel consumed at time i, V = fuel price (1.7 EUR/L), G i × V = fuel costs.In order to select the optimal microgrid management model for island operation based on the minimisation of production costs, the objective function for minimising the total project costs for the M70 management algorithm must be defined, as described below. (1) where P DG i = output power of the diesel generator at time i, dP DG i = energy for charging the battery by the diesel generator at time i, chrLim = level to which the diesel generator charges the battery bank.

Economic Indicators for Microgrid Optimisation
The costs of generating electricity in a microgrid is determined in relation to the investment costs (planning, design and construction costs) and the operation and maintenance costs (O&M costs), such as maintenance of system components, replacement or fuel.
An optimisation of the total project costs is carried out and the net present costs [44] (NPC) or life cycle costs are also calculated, which include the following [45]: All system costs over the lifetime minus all revenues.o The value of the costs is reduced to present value by discounting.o Included costs: capital costs, replacement of system components, operation and maintenance costs, fuel, electricity purchased from the grid.o Revenues include sale of electricity to the grid, residual value of the system at the end of the project.
When selecting the optimal model, the average cost of energy generated per kWh (Levelised Cost of Energy-LCOE) is calculated.The LCOE is the standardised cost of generating electricity from a particular energy source or system.It is a commonly used measure for comparing different energy sources or projects [45].
The optimal point in microgrid modelling is calculated based on the total project costs (UTP) [46] over the lifetime and the energy costs in relation to UTP and COE [EUR/kWh] [47].

Defining the Input Data for the Microgrid Model
The input data for the simulation model includes climate data, electrical load, technical and economic parameters of the equipment used for generation and storage, sensitivity variables, dispatch strategy and other constraints.The model simulates system operation and calculates the energy balance for each of the 8760 h in a year.This results in the optimal system size and management strategy based on minimising total production costs.
The simulated model for optimal microgrid management is based on the needs of the University of Applied Sciences in Zagreb.Given the specified operating conditions for the microgrid and all input data, the goal is to find a solution for optimal system management.Selecting the optimal size of the distributed energy sources and optimising their management is crucial to justify the investment costs and achieve the best possible system efficiency.The aim is to detect the optimal management practices that meet the electricity demand and minimise operating costs, taking into account all the particularities of the market in which the microgrid is located.

Location and Meteorological Data
The University of Applied Sciences in Zagreb (TVZ) is located at Konavoska 2, 10000 Zagreb.It is located at a latitude of 45 A photovoltaic plant will be used as the source of the renewable energy, which renders the meteorological data crucial for the project implementation.One of the important meteorological data points is the average daily solar radiation at the site [kWh/m 2 ].The data for the average daily irradiation at the site come from Homer Pro 3.14.5, a programme based on NASA statistics.The average daily irradiation at the site is 3.52 kWh/m 2 .

Electricity Consumption Requirements at the Site
By monitoring the consumption history and scheduling changes in the system, daily, monthly and annual consumption profiles of the users are created.The annual electricity consumption at this site is 269,431.00kWh.

Selection of Optimal Microgrid Management in Island Operation
According to the previously defined methodology, the input variables are dimensioned in the following section of this chapter: the power of the solar modules in the photovoltaic field and the battery capacity, labelled P PV ui and K BT ui .Deciding on the parameter dimensions for the model is carried out for both management models (P and M70) in order to obtain the optimum points for both management models.Setting the dimensions is performed using the PSO method (Figure 3) through three iterations according to Formulas (1)- (14).
Optimising system management using PSO can be challenging, especially when the goal is to minimise system costs while selecting the optimal size for the photovoltaic module output, battery capacity and diesel generator output.This is a multi-criteria problem.There is a balance to be found between these objectives, which leads to a large search space.The PSO model then requires a large number of particles to search this space effectively, resulting in lengthy simulations and a significant demand on computational resources.The optimal modelling of the capacity of the photovoltaic modules, the battery system and the diesel generator is achieved through an economic analysis of different combinations of component sizes.
In order to reduce the number of criteria in the multi-criteria optimisation, an analysis and selection of the generator output was performed based on the evaluation of the worstcase scenario, in which the generator must supply sufficient power for the continuous operation of the system.The analysis of the annual load profile showed that the power requirement does not exceed 80 kW over the course of a year.
Based on this analysis, a generator with a continuous output of 100 kW was selected to provide an additional buffer for possible increases in consumption.In addition, it is important to choose a suitable size for the photovoltaic (PV) array and the battery system.The key element in this selection is the balance between the capacity of the PV array and the battery.If a larger PV array capacity is selected with an insufficient battery capacity, the energy generated by the PV array cannot be stored and production may have to be curtailed during the summer months.Conversely, selecting insufficient PV array power may result in the batteries not being sufficiently charged in the winter months, leading to underutilisation of expensive energy storage capacity.
The total cost function for optimal microgrid management in island operation, based on minimising production costs, is shown in (15): C UTP = total project cost over N years (UTP), C P = initial investment cost, C O&M (i) = maintenance and equipment replacement cost in year i, N = number of project years, C s = residual value of equipment at the end of the project.
C PV = total installation cost of solar panels, C PR = cost of the bidirectional converter, C MMPT = cost of the MPPT voltage regulator, C BT = cost of batteries, C DG = cost of the diesel generator.
C S (25) = (0.5 where Using the cost function according to Formula ( 15), the total costs of the microgrid are calculated over 25 years for value pairs P PV ui and K BT ui within the PSO optimisation iterations.The aim is to find the optimal pair P PV ui and K BT ui that leads to the lowest cost function C UTP for the MG after 25 years.
The PSO algorithm determines the optimal combination of pairs P PV ui and K BT ui and tests combinations of values within the given range according to Formulas (2) and ( 9), calculating the total cost for each pair.In the initial phase, the algorithm selects the value For the selected value of K BT u , the algorithm runs through all values of the photovoltaic field power ∀ P PV u ∈ P PV min , P PV max .As a result of the PSO (P, M70) optimisation, the algorithm calculates the C UTP (P, M70) values for ∀ P PV u ∈ P PV min , P PV max , ∀ K BT u ∈ K BT min , K BT max over the 25-year simulation through three iterations.The values obtained for the M70 management model over three iterations, which narrow down the search space and increase the accuracy of the local optimum in the PSO are P PV ui = 190 KW i K BT ui = 100 kWh, for which the minimum cost function is achieved UTP = min C UTP = EUR 2,312,823 (Figure 4).
Energies 2024, 17, x FOR PEER REVIEW 12 of 20 may result in the batteries not being sufficiently charged in the winter months, leading to underutilisation of expensive energy storage capacity.The total cost function for optimal microgrid management in island operation, based on minimising production costs, is shown in (15): Using the cost function according to Formula (15), the total costs of the microgrid are calculated over 25 years for value pairs  and  within the PSO optimisation iterations.The aim is to find the optimal pair  and  that leads to the lowest cost function CUTP for the MG after 25 years.
The PSO algorithm determines the optimal combination of pairs  and  and tests combinations of values within the given range according to Formulas (2) and ( 9), calculating the total cost for each pair.In the initial phase, the algorithm selects the value  ∀  ∈  ,  .For the selected value of  , the algorithm runs through all values of the photovoltaic field power ∀  ∈  ,  .As a result of the PSO (P, M70) optimisation, the algorithm calculates the CUTP(P, M70) values for ∀  ∈  ,  , ∀  ∈  ,  over the 25-year simulation through three iterations.The values obtained for the M70 management model over three iterations, which narrow down the search space and increase the accuracy of the local optimum in the PSO are  = 190    = 100 kWh, for which the minimum cost function is achieved UTP = min CUTP = EUR 2,312,823 (Figure 4).For the P model of optimal microgrid management, the obtained values are P PV ui = 419 KW i K BT ui = 330 kWh, for which the minimum cost function (UTP) is achieved: min C UTP = EUR 2,666,491.
Table 2 shows the results of the optimal parameter design for each of the algorithm models P and M70.Parameter optimisation was performed over three iterations, narrowing the range of possible values for P PV ui and K BT ui .This narrowing of the range increased the precision of the parameter determination for the models.The models were evaluated in terms of minimising the objective function minC UTP (P, M70).In addition to the total project costs (UTP), the values for COE, NPC and LCOE were also calculated.Comparing the optimal values of the two management algorithms, it can be seen that the M70 algorithm delivers very satisfactory total project costs of EUR 2,312,823, while the P management algorithm leads to higher total project costs of EUR 2,666,491.The M70 algorithm is based on two PSO optimisations: one for the input parameters of the model and another for the calculation of chgLim.The P algorithm uses PSO for the parameterisation of the input data for PV field power and battery capacity, but does not use any other optimisation methods during management.
Table 3 shows the input and output parameters of the management algorithms P and M70 at their optimal points.The input parameters, PV field power and battery capacity are the optimal pairs for each model, respectively.The diesel generator has an output of 100 kW, but in the P model it operates at 30% of its rated power on average, while in the M70 model it operates at 100% of its rated power.Since the P model has the highest PV array power and the highest battery capacity, it is expected that the production from the PV array is the highest and the production from the diesel generator is lower than the M70 model, which is confirmed by the results.However, compared to the M70 model, the P model consumes 27% less fuel for 52% lower production as it operates at non-rated power.This results in lower efficiency, which translates into higher fuel consumption for lower production, cancelling out the benefits of investing more in larger PV field capacities.Table 2 confirms these conclusions as the P model is a more expensive management model.The results show that the choice of optimal microgrid management is clearly in favour of the M70 algorithm model.

Evaluation Results and a Comparative Analysis
Using the discrete input data described in Section 2, a microgrid model was created that simulates the real operating conditions of the microgrid.MATLAB R2022a Simulink with the Simscape Power Systems Toolbox, which enables modelling and analysis of power systems, is used for the simulation.The optimal parameters for each model were calculated in the PSO (P, M70) analysis.The simulation is performed at the optimal points of each model presented to observe the behaviour of the models at the optimal points of the competing algorithms.
The development of the management model was carried out in two steps.In the first step, the microgrid for each of the developed management algorithms (P, M70) was modelled to obtain the optimal value of each management algorithm using parallel processing and discrete input data together with the developed PSO management algorithms.The results are shown in Tables 2 and 3.
In the second step, simulation and evaluation of the two management models were performed to determine the behaviour of the management algorithms outside their optimal points.The simulation results of the two models show the expected advantage of the M70 model over the P model (Tables 4 and 5).For the same input parameters at the optimal point of the P algorithm P PV ui = 330 kW i K BT ui = 419 kWh and at the optimal point of the M70 algorithm P PV ui = 190 kW i K BT ui = 100 kWh, the M70 model has lower maintenance and fuel costs and better economic indicators (UTP, COE, NPC, LCOE) (Tables 4 and 5).The M70 model calculates the parameter chrLim right at the start of the simulation using the PSO method for the input parameters P PV u and K BT u .The PSO method finds the chrLim for which the objective function is minimal, ∀chrLim z i ∈ [chrLim z min , chrLim z max ], ∀P PV u ∈ P PV min , P PV max , ∀K BT u ∈ K BT min , K BT max .The result of the PSO optimisation is chrLim = 74% (Figure 5), which means that once activated the diesel generator charges the battery (SOC) up to 74%, after which the algorithm switches the supply to the consumption of renewable energy.Figure 5 shows that a very similar result is achieved even if chrLim is 52%.The M70 model calculates the parameter chrLim right at the start of the simulation using the PSO method for the input parameters  and  .The PSO method finds the chrLim for which the objective function is minimal, ∀ ℎ ∈ ℎ , ℎ , ∀  ∈  ,  , ∀  ∈  ,  .The result of the PSO optimisation is chrLim = 74% (Figure 5), which means that once activated the diesel generator charges the battery (SOC) up to 74%, after which the algorithm switches the supply to the consumption of renewable energy.Figure 5 shows that a very similar result is achieved even if chrLim is 52%. Figure 6 shows how the algorithm adjusts the chrLim level and manages the battery charge (SOC) in the M70 model.The algorithm of the P model manages the microgrid exclusively via the algorithm without additional methods, as is the case with the M70 model.Figure 6 shows how the algorithm regulates the utilisation of the individual sources.For example, the diesel generator is not activated in summer and the entire production comes from the PV field.
[kW] Figure 6 shows how the algorithm adjusts the chrLim level and manages the battery charge (SOC) in the M70 model.The algorithm of the P model manages the microgrid exclusively via the algorithm without additional methods, as is the case with the M70 model.Figure 6 shows how the algorithm regulates the utilisation of the individual sources.For example, the diesel generator is not activated in summer and the entire production comes from the PV field.
A comparison of the two models shows that the M70 algorithm clearly outperforms the P algorithm in terms of total project costs and cost efficiency.The utilisation of the diesel generator at full capacity when required by the M70 model in combination with an optimal balance of PV and battery capacities leads to lower overall costs and better energy management.The M70 algorithm achieves significant savings in both operational and capital costs, resulting in a more sustainable and economically viable microgrid solution.
Figure 6 shows how the algorithm adjusts the chrLim level and manages the battery charge (SOC) in the M70 model.The algorithm of the P model manages the microgrid exclusively via the algorithm without additional methods, as is the case with the M70 model.Figure 6 shows how the algorithm regulates the utilisation of the individual sources.For example, the diesel generator is not activated in summer and the entire production comes from the PV field.

Discussion
The simulations carried out with the P and M70 algorithms for optimal microgrid management in island operation showed clear differences in their economic performance and efficiency.The M70 algorithm showed better adaptability and cost efficiency compared to the P algorithm, which is reflected in the lower total project costs (UTP) and better economic indicators.
The P algorithm focuses on maximising the use of photovoltaics and battery storage and operates the diesel generator at an average of 30% of its rated power.This approach leads to higher initial investment costs due to the larger PV field and battery capacity.In contrast, the M70 algorithm calculates the chrLim parameter at the beginning of the simulation using the PSO method and dynamically adjusts the charging limit of the diesel generator.This method results in a chrLim value of 74%, which ensures efficient battery charging and operation of the diesel generator.
A comparative economic analysis at the optimal points of each algorithm shows that the P model (Table 4) has higher initial investment and maintenance costs and lower fuel costs compared to the M70 model (Table 5), which ultimately leads to a higher total project cost.The total project cost for the P model is EUR 2,666,491, compared to the total project cost for the M70 model, which is EUR 2,312,823.In addition, the utilisation of the diesel generator by the M70 model and the optimised balance between PV and battery capacities resulted in lower overall costs and better energy management.The M70 algorithm also achieved significant savings in operational and capital costs, making it a more sustainable and economically viable solution for microgrid management.
The results show that dynamically adjusting the load limit of the diesel generator through the M70 algorithm provides a more efficient and cost-effective approach to microgrid management.This has practical implications for the design and operation of microgrids, especially in scenarios where economic efficiency and reliable energy supply are critical.The ability to dynamically optimise the use of energy resources can lead to significant cost savings and improved system performance.
The evaluation of the simulation models shows that the costs of the models largely depends on the input parameters and user requirements.In this study, the consumption requirements did not effectively support PV production, as the highest PV energy production with the lowest consumption occurred in summer and the highest consumption with the lowest PV production occurred in winter.This consumption pattern requires large investments in battery storage, which increases the overall cost of the project.The task was to develop an algorithm that optimises the system parameters for the given user requirements in the first step.In the second step, the algorithm must maximise the use of the given model parameters in order to minimise the target function minC UTP (M70).Both tasks were successfully solved using the metaheuristic PSO method.Future research aims to further develop the predictive algorithm in order to minimise external influences on the management and operation of the microgrid.The developed model is accessible for further analyses and developments via its parametric interfaces.
The study successfully fulfils the objectives mentioned in the introduction: • Objective 1: Analysis, systematisation and selection of optimal centralised microgrid management in islanded operation.The analysis and systematisation of optimisation methods, especially the PSO method, provided a comprehensive understanding of their performance and led to the selection of the M70 algorithm as the optimal model for centralised microgrid management in islanded operation, based on the minimisation of production costs.

•
Objective 2: Simulation model for centralised microgrid management considering microgrid components.The development and implementation of detailed simulation models in MATLAB R2022a Simulink for both algorithms enabled an accurate evaluation of their performance under different conditions and revealed the strengths and weaknesses of each approach.

•
Objective 3: Evaluation of the simulation model for the microgrid.The comprehensive evaluation of the simulation results highlighted the economic and operational benefits of the M70 algorithm and confirmed its superiority over the P algorithm in terms of cost efficiency and system reliability.
Future research should focus on the further development of prediction algorithms to minimise external influences on the management of microgrids.In addition, the integration of advanced machine learning techniques and real-time data analysis could improve the adaptability and responsiveness of microgrid management systems.

Conclusions
The study has shown that the M70 algorithm outperforms the P algorithm in terms of economic efficiency and operational performance in microgrid management.The dynamic adjustment of the limit up to which the DG charges the battery in the M70 model resulted in lower overall project costs and better economic indicators.
The main results are as follows: • The M70 algorithm achieved a total project cost (UTP) of EUR 2,312,823, which is significantly lower than the EUR 2,666,491 of the P model.• The M70 model had lower maintenance and fuel costs due to the efficient operation of the diesel generator and the optimised balance of PV and battery capacities.• The use of the PSO method to dynamically adjust the chrLim parameter in the M70 model proved to be highly effective in minimising costs and improving the overall efficiency of the system.
The main results of this study underline the novelty and contribution of the proposed optimisation algorithms.The dynamic adjustment of the limit up to which the DG charges the battery (chrLim) by the M70 algorithm using PSO significantly improves the cost efficiency and operational performance compared to the traditional P algorithm.This work demonstrates that advanced optimisation techniques can provide significant benefits in microgrid management, particularly in terms of reducing total project costs and improving power supply reliability.
The results have significant implications for the design and management of microgrids, especially in isolated or remote areas.The implementation of the M70 algorithm can lead to significant cost savings and improved reliability of energy supply, making it a valuable approach for future smart grid developments.
Based on the results, it is recommended to integrate dynamic and adaptive optimisation techniques, as used in the M70 algorithm, into the management of microgrids to improve economic efficiency and operational performance.Further research should also focus on the integration of advanced predictive and machine learning techniques to improve the adaptability and responsiveness of the system.

Figure 1 .
Figure 1.Management algorithm for individual sources (algorithm P).

Figure 1 .
Figure 1.Management algorithm for individual sources (algorithm P).

1 .
Preparation of the microgrid model: A microgrid model with discrete data is created to simulate the real operating conditions.MATLAB R2022a Simulink with the Simscape Power Systems Toolbox, which enables the modelling and analysis of energy systems, is used for the simulation.The model includes PV modules, a battery, a diesel generator, a bidirectional converter and loads.Parameters and constraints are also defined for each element of the MG.

Figure 3 .
Figure 3.The PSO algorithm for sizing MG parameters.
the variables are C O&M (i) = annual cost in year i, C odr (i) = annual maintenance costs of the microgrid, C gor (i) = fuel cost for the diesel generator, C BT10 (10) = battery replacement cost in year 10, C BT20 (20) = battery replacement cost in year 20, C PR15 (15) = converter replacement cost in year 15, C S (25) = residual value of equipment at the end of the project.

Figure 4 .
Figure 4. Calculation of the optimal point for the M70 management model.Figure 4. Calculation of the optimal point for the M70 management model.

Figure 4 .
Figure 4. Calculation of the optimal point for the M70 management model.Figure 4. Calculation of the optimal point for the M70 management model.

P
PVmin = lower search boundary in PSO optimisation for PV power [kW], P PVmax = upper search boundary in PSO optimisation for PV power [kW], K BTmin = lower search boundary in PSO optimisation for battery capacity [kWh], K BTmax = upper search boundary in PSO optimisation for battery capacity [kWh], P PV = optimal PV field power size [kW] for minimum UTP costs [EUR], K BT = optimal battery capacity size [kWh] for minimum UTP costs [EUR], UTP = total cost at the end of the 25-year project period [EUR], COE = average cost of produced energy relative to UTP per kWh [EUR/kWh], NPC = minimum net present cost in PSO optimisation [EUR], LCOE = average levelised cost of produced energy per kWh [EUR/kWh].

Figure 5 .
Figure 5. Result of PSO optimisation for chrLim in the M70 model.

Figure 5 .
Figure 5. Result of PSO optimisation for chrLim in the M70 model.

Figure 6 .
Figure 6.ChrLim and SOC of the M70 model.

Figure 6 .
Figure 6.ChrLim and SOC of the M70 model.

Table 1 .
Systematisation of optimal methods for the management of microgrids.

Table 2 .
Search space ranges for finding the optimum in the PSO optimisation model.

Table 3 .
Input and output parameters of the management algorithms at their optimal points.

Table 4 .
Economic indicators of the management algorithm at the optimal point of algorithm P.

Table 5 .
Economic indicators of the management algorithm at the optimal point of algorithm M70.