## 4 Results and Discussion
### Inertia Weight Factors Analysis  
The inertia weight (global weight) is an important parameter in PSO because it affects the balance between global search and local search. A well-chosen value of inertia weight allows the algorithm to efficiently search the solution space and avoid getting stuck in local minima. When performing optimization, the inertia weight factor can be fixed or variable. The fixed factor is easy to apply and has a stable effect on most problems, while the biggest problem is that it is not variable during iterations. Therefore, the factor can be adjusted during optimization according to a certain criterion (linear, random, etc.). The weight factor can be adjusted depending on the performance of the swarm, i.e., the degree of improvement in function, and in this case, it is an adaptive weight factor [65].  
The correct selection of inertia weighting factors improves the performance of the algorithm [66]. In the study [67], the influence of different inertia weight factors on the exploitation costs and lifetime of the battery ESS was analyzed. The use of an adaptive nonlinear approach to the determination of weight factors resulted in a reduction in operating costs and an extension of the lifespan of the battery energy storage system. In this research, the influence of choosing the proper size of the inertia weight on the function goal of this optimization task, which is the reduction of the peak charging power, was analyzed. There are different strategies when choosing inertia weight [68]. The usual setting is to select an initial value between [0.8 and 1.2]. However, in this optimization task, the local minimum was not reached in the interval of [0.6, 1.2]. In this research, the effect of the change in the magnitude of the inertia weight in the interval [0.2, 0.6] with a linear step of 0.05 was examined. The best result was achieved when the global weight was set to 0.55, and the number of particles was set to 2048. At such settings, the minimum amount of charging power is 0.9595 MW. With this optimization of parameters, a reduction of 16.2% was achieved in relation to the previously optimized charging power, which amounted to 1.14519 MW. Figure 14 shows the influence of the inertia weight factor on the optimization effect, i.e., on the reduction of the required peak charging power.  
Finally, Figure 15 shows the optimized charging schedule of ships when a savings of 16.2% was achieved compared to the first  
Figure 14: Influence of the inertia weight factor on the reduction of the peak charging power.  
Sensitivity analysis is carried out to ensure the smooth functioning of a system, such as an energy system in which energy sources are renewable [69]. The mentioned research analyzes the optimization method for selecting the calculation of the sensitivity of dynamic characteristics and the mode of operation of the energy system. The results show that by applying the PSO algorithm, it is possible to reduce network losses and increase computing efficiency. In this particular study, the impact of the number of ferries was observed and it was concluded that the number of ferries itself does not significantly affect the results of optimization. However, the daily energy needs of each ferry significantly affect the optimization results. This is best manifested through the optimization effect and the time required to achieve the local minimum of the function goal.