###### Abstract
Furthermore, in [15] fundamental aspects, definitions, and best practices regarding earthing systems in HV substations are outlined and in [16] a method for the straightforward safety assessment of typical grounding configurations of Medium-Voltage/Low-Voltage (MV/LV) substations is introduced on the basis of simple calculations. Additionally, a mathematical and numerical formulation, based on the well-known Maxwell's Equations, is developed to design and analyze grounding systems in underground electrical substations and it is presented in [17; 18]; emphasis is given to evaluating the grounding system for an underground distribution substation using a modified average potential method. Finally, in [19] a numerical model based on the boundary element method allows the analysis of the grounding systems of aboveground and underground substations under different locations and considerations. Despite the aformentioned literature which is mainly focused on the study of grounding in HV/MV substations, there has been relatively little research conducted on the earthing systems of power distribution lines. Within the [20], specific provisions detail the safety thresholds that grounding grids must meet and, as a result, Distribution System Operators (DSOs) are tasked with developing grounding grid designs that adhere to these specified criteria. A crucial aspect of the study procedure of grounding systems of MV lines is the absence of guidelines governing their design and operation. This lack of uniformity highlights the complexity and multifaceted nature of the challenges encountered in optimizing grounding systems, necessitating a detailed and context-specific analysis [5; 6; 7; 8]. In this framework, the current paper aims to analyze and optimize grounding systems by investigating several crucial parameters, encompassing soil structure, fault current magnitude, fault clearing times, and other operational variables that influence grounding system performance. To this end, a typical MV line, including its entire protection scheme, will be simulated using the DIgSILENT PowerFactory software tool. Short-circuit currents resulting from single-line-to-ground faults will be calculated, accounting for distributed generation (DG) units with varying rated power outputs and installation locations across the MV line. Evaluation of the grounding system's performance will be conducted for each fault scenario, leveraging the extensive capabilities offered by the SES CDEGS 19.0 software tool. It is noteworthy that this evaluation will encompass diverse soil structures and fault clearing times in accordance with the Time-Current Curves (TCCs) of the network's protection devices. In summary, this study aims to provide practical insights into how different parameters influence grounding system performance, thereby enhancing safety and efficiency within power distribution networks. However, achieving the optimal design of grounding systems extends beyond technical considerations alone; it necessitates addressing safety concerns while also aligning with techno-economic criteria. Balancing safety with economic feasibility is recognized as a crucial aspect in developing grounding systems that not only meet operational demands but also contribute to the overall sustainability of Medium-Voltage networks.