Utilising a Lagrangian approach to compute maximum fault current in hybrid AC–DC distribution grids with MMC interface

: Hybrid AC–DC networks are transforming high-voltage transmission and medium-voltage distribution grids by embracing the advantages of both AC and DC systems, which facilitates the inclusion of renewable energy sources and distributed generation. As modular multilevel converters (MMCs) are vastly employed in such hybrid networks, determining their maximal fault current in worst-case scenario is a critical design factor for planning and implementation of a reliable protection scheme. This study develops a novel mathematical framework that applies a Lagrangian energy method to calculate the maximal fault magnitude. This method allows to account for converter's internal energy and compute its impact on the amplitude of the fault current. It is shown when the converter is interfacing weak AC sources with high internal impedance such as wind farms or solar farms, dumping the internal energy of the converter into the fault is the salient contributing factor of the fault magnitude. Furthermore, to distinguish and classify the output overcurrent as either ignorable transients or destructive faults, a perceptron with sigmoid threshold is employed. The model is verified using a simulated medium-voltage hybrid AC–DC distribution network.


Introduction
The traditional grid is undergoing a transformational metamorphosis to evolve as a self-aware and self-healing 'smart grid', yet sustainability of this giant energy network is still a major concern [1]. Numerous policies emphasise harnessing and integrating renewable resources and distributed generation (DG) into the existing grid. Research shows that direct current when employed properly is a more suitable option for deployment of DG [1]. In fact, feasibility and prospects of leveraging DC in combination with AC for accommodating renewable resources have been studied and verified by many researchers [2,3]. Therefore, future grid is not a choice between AC or DC, but a hybrid one which is the superior choice for both transmission and distribution of electric energy [3]. Power converters play a major role in successful development of hybrid AC-DC systems, and among existing converter topologies, modular multilevel converters (MMCs) have enjoyed a remarkable popularity fostered by their modularity, versatility, and very low total harmonic distortion.
MMC is also a suitable candidate for interfacing mediumvoltage DC and AC distribution systems. Nonetheless, handling and managing faults in hybrid networks has proved to be a formidable obstacle; firstly, because the impedance values in DC networks are much lower than AC grids, and secondly, there is no zero-crossing in DC current. Therefore, a DC short-circuit can lead to serious consequences of catastrophic proportions if not detected and mitigated properly. Consequently, computing the maximum fault current value is imperative in selecting and sizing of protection equipment. Especially in large interconnected DC networks, such calculation is the basis for planning the type and size of fault current limiters and circuit breakers (CB) [4].
This paper contributes to the existing literature by providing a mathematical framework for analysing the worst-case scenario, when MMC's controller happens to fail or malfunction, hence dumping the internal stored energy of the capacitors into the fault and allowing the fault current to continue to flow through the system. To ensure the suitability of chosen parameters, multitude of standards are referred to and their suggested values considered. Furthermore, we adopted the definition put forward by IEEE standard 1709-2010 for DC distribution systems operating between 1 and 35 kV as medium-voltage direct current. Moreover, to simulate the worst-case scenario -maximal fault current -our key assumptions are as follows: i. Short-circuit takes place at a close distance from converter's DC output terminals (pole-to-pole). ii. Fault impedance is minimal and mainly resistive, as suggested in IEC 60909. iii. Analogous to the method set out in IEC 61660, converter's controller is disabled to not intervene or limit the output current. iv. Consistent with IEEE 1346-1998, the voltage sag tolerance on the AC side is set to be in the order of tens of milliseconds; hence, AC breaker allows the energy to flow to the DC terminals. v. As stated in IEEE C37.09, practical minimum relay tripping delay is set to 0.5 cycle, corresponding to 8.33 ms on a 60 Hz basis.
The above assumptions ensure that fault current is not capped by either internal factors (MMC's controller) or external agents (CB on the AC side). Our approach accounts for both stored energy in MMC's capacitors and the rectified current passing through the anti-parallel diodes. As illustrated in the flowchart depicted in Fig. 1, faults on the AC side of the hybrid grid can be readily calculated using the symmetrical components method. It is, however, important to bear in mind that, in practice, converter's controller acts as the first line of defence for capping the maximum output current. Then, CB acts to completely isolate the faulty section. CBs distinguish between a transient fault and a permanent failure using an auto-reclosing sequence. After disconnecting the faulty subsection which stops the current flow, a low amplitude test current is fed to investigate whether the fault or short-circuit is eliminated or still exists.
The rest of this paper is organised as follows: we first review the existing methods developed by other authors for calculating and managing faults in hybrid networks. Then, we delve into modelling MMC and turn into producing the necessary mathematical framework. In Section 5, we utilise a SIMULINK model based on the detailed switching model of MMC to simulate the results and verify the predictions of the mathematical computations. In Section 6, we develop a fault classification model. Finally, the paper concludes by summarising the findings and implications in fault calculation and management.

Existing methods
To calculate the short-circuit current, MMC converters are usually modelled as a three-phase rectifier, or a DC source with equivalent RLC elements. For instance, Heising et al. [5] maintain that the converter behaves as three-phase rectifier where the short-circuit current can be calculated by the short-circuit power of the AC grid and the overall AC-side reactance. The author therefore proposes a formula to calculate the short-circuit current as a rectifier as follows: Z a denotes the short-circuit impedance of the grid, Z s stands for the overall AC side impedance of the converter, and finally, V a represents the phase voltage. Sharifabadi points out that the situation is transitory until the AC-side breaker disconnects the converter. However, at the instant of fault occurrence, the shorted circuit experiences a huge inrush current forced by large capacitance of the converter and DC system [5]. However, the above model proposed by Sharifabadi et al. [6] completely ignores this transitory period and inrush current or typical practical values discussed in [7,8]. In [7], the impact and contribution of stored energy in MMC's leg capacitors to the fault is recognised, but not as a worst case when controller malfunctions. Some other authors like [9][10][11][12][13][14] have reduced the system to an equivalent model of series RLC, and second-order differential equations are employed to calculate the current as a function of time, and to determine the peak amplitude. For example, in [8], the fault current is derived as below where C 0 , L, and τ are the parameters of the equivalent RLC circuit derived from the converter's original circuit values. Again, the above model does not explicitly consider the total internal energy of the converter stored as circulating current between arms, and the potential energy deposited in cell capacitors. On a positive note though, Li et al. [10] have developed a viable mathematical model in matrix form that facilitates calculation of the fault current in multi-source multi-terminal DC network. In [13], the authors used the model to calculate and plot the short-circuit current for a pointto-point medium-voltage AC-DC system operating at 40 kV DC and transferring 40 MW power. Nonetheless, as simulation is based upon the equivalent circuit of the converter not the detailed switching model, all other parameters and aspects are suppressed. Although the above methods have their merits while applied to certain limited situations, we intend to illustrate the shortcomings of such reductionist representations. Reducing the converter to either a three-phase AC rectifier with shorted output terminals, or a DC source in series with and RLC system results in miscalculating the maximal fault current, as they miss the effect of converter's internal energy. For instance, if the rectifier model is used to calculate the short-circuit current as defined in [6], then removal or augmenting cell capacitors has theoretically no bearing on the peak short-circuit current. Whereas in practice, the short-circuit current depending on its direction can pass through the anti-parallel diodes which allow the cell capacitors to dump their energy into the fault. Furthermore, if for whatever reason, such as malfunction or failure, controller and cell protection systems fail to turn the valves off, capacitors' stored energy will flow through the valves.

Modelling MMC
Although the functional principle of MMC is well studied and researched, the impact of combining such power converters with AC grid on fault current is less so. In general, incorporating DC into an AC grid introduces new challenges [2,3,15] that must be analysed and addressed. Especially, fault dynamics in a hybrid AC-DC system deserves a thorough analysis and perhaps a new framework [16]. The situation turns out to become even more complex once DG is added to the grid, as it will introduce new complexities and dynamics to the overall system [17]. Therefore, developing a comprehensive model to understand and analyse fault, which itself is a prerequisite to better fault management practices, is necessary for the successful transition to the smart grid [16]. It is in this context that we need to revisit the basic principles.

Fundamentals
We have considered a half-bridge topology which is the most common module type as shown in Fig. 2. Each individual submodule performs as a controllable voltage source and operates in the following modes: • Insertion, where the valve in series with the capacitor is conducting; thus, the output of the cell would be V C . • Bypass, where the other valve is on, hence the submodule's two terminals are shorted and output voltage of the cell is zero. • Blocking, when neither valve is conducting. This state is not used in normal operation, but during start-up and some emergency conditions only [6].
As shown in Fig. 3, several cells are connected in series to form a leg with two strings of submodules. Assuming each leg consists of N submodules, it is easy to see that leg's voltage can attain stepwise voltages between zero and N × V c . Therefore, N + 1 voltage levels can be achieved in total. Furthermore, each phase consists of two legs that are connected through inductors to the midpoint, i.e. output AC terminal. The inductors are required to avoid parallel connection of submodule strings and to eliminate the possibility of high transient currents between the phase legs [6]. At each switching step, one or more submodule turns on or off, while a corresponding submodule in the other phase arm is gated off or on, respectively. Ignoring the details of submodule strings, the three-phase circuit can be transformed and analysed using Fig. 4. As illustrated, the output voltage of each phase at the midpoint would be the driving emf for phase currents. The voltage and phase current for phase a are, respectively, denoted as va o and ia o , and applying Kirchhoff's voltage law (KVL) to phase a upper loop and lower loop denoted as au and al, and Kirchhoff's current law (KCL) to the midpoint terminal, we can derive For the loop containing the AC voltage, we can write and Nonetheless, this model does not lend itself to more detailed analysis of the converter during normal operation or fault occurrence. Thus, for the study of short-circuit current, we need to derive both average and switching models of the converter.

Average model
In theory, we can increase the number of submodules in each string without any limit and push the switching frequency towards infinity. Therefore, the average MMC model can produce a perfect sinusoidal AC voltage at its AC terminal [16]. In this case, each phase of MMC can be simplified as series of arm inductance, resistance, and a continuously variable voltage source represented by a variable capacitor. Denoting the output voltage of each string, which is equal to the sum of the capacitor voltages in the insertion mode as V C Σ , we can define a multiplier m which ranges from zero to one to reflect the ratio of the capacitors in insertion mode to the total number of capacitors in the string. Evidently, m is a function of time as it is varied by the modulation scheme to create an alternating voltage. The output voltage of each string can be calculated as Then equivalent capacitance of string at time t, denoted as C eq , and the current i str are calculated as follows [18]: As shown in (4), the output current of each phase at AC terminal is the difference between the currents of the upper arm and lower arm. Considering KCL at the output AC terminal, and naming the difference between the currents of the upper and lower legs as i dif , we can rewrite the equations as follows: The indices u and l in the above indicate the multiplier m and total number of capacitors per upper or lower string at time t.
Combining the derivations yields the output voltage at AC terminal. Since the resistance of the arm inductance is not negligible in many practical cases, we also account for the voltage drop across R arm , thus Also, eventually, all relationships, which are governed by differential equations, are put in the matrix form that readily lends itself to computerised simulation To construct the mathematical model for the currents flowing through upper and lower arms of each phase, the method similar to [19] is adopted, as we also need to compute the instantaneous energy stored in converter legs. Since the alternating voltage and current at the AC terminal of the MMC converter can be defined as a cosine function cos(ωt), we restate the formulas already derived in phasor format. In this study, we suppose the voltage phasor is the reference phasor. Consequently, deriving the formula for the upper arm The formulas for the lower string can be derived in the same manner. Having identified the voltages and currents, the power in either the upper or lower arm, and subsequently, the total power in each phase leg can be calculated as below Obviously, the average of the last term in (24), the equation derived for phase power is zero, as it is an alternating value at double power frequency. This AC power circulates back and forth between the upper and lower arms of the MMC converter. The first two terms, on the other hand, add up to the average DC power consumed or delivered by each phase. By integrating the third term, we can figure out the average total alternating energy stored within each phase of the converter, that is inside the capacitors. Since the three phases are identical, equal DC power is drawn or delivered by each phase, and the sum of circulating AC components of the three legs, which are shifted apart by 2π/3, would be zero during 'normal operation'. Therefore, denoting the stored energy by E ph , we have The last result is of outmost importance, as it is the energy which is dumped into the fault on converter's DC terminals.

Switching model
For derivation of the switching model, we have considered a practically viable case for medium-voltage network, and used the parameters indicated in Table 1.
Twenty-four submodules constitute each converter arm, thus the maximum voltage per each cell would be 20 kV/24 = 833.33 V, which allows us to select from a variety of commercially available insulated-gate bipolar transistors (IGBTs) such as ABB's 5SNG 0450R170300, LoPak1 phase leg IGBT module, with a rated voltage of 1700 V and maximum collector current of 450 A. Both rated voltage and rated currents of the IGBT module are about twice the required voltage and current capacity; hence, guaranteeing modules will work within the safe operating area.
There are two key approaches to follow for the basic design of submodules. Implementing each cell with its own control unit, which could be either field programmable gate array-based or complex programmable logic device (CPLD)-based, has its certain merits [20]. However, in prototypes built for research purposes, it is possible to employ submodules with no individual control, which make the design endeavour much simpler [21]. The selection of arm inductance is also dependent on the type of cells chosen to build the arm strings, as to whether the modules are equipped with thyristors to safeguard anti-parallel diodes during short-circuit or not [6]. In the design we employed, there is no thyristor included in the cells; hence, the typical range for the arm inductor is between 0.1 and 0.15 p.u. [22]. We have picked the lower boundary as higher inductance values restrain the maximum short-circuit current.

Decoupling AC, DC, and stored energy
To develop the mathematical framework for calculating the maximal fault current, we have benefited from a similar concept elaborated in [23], where conventional modelling of MMC has been questioned because it relies on the assumption that DC bus performing as a stiff voltage source. Cui and Sul [23] argue that due to the existence of a considerable lump inductance -including smoothing reactors, and inductances of both overhead transmission lines and underground transmission cables -the DC bus exhibits the characteristics of a current source. The choice between considering the DC bus as a voltage source or current source ascertains fundamentally different results while calculating the short-circuit current of the converter. In most HVDC transmission lines, two MMC converters operate back to back, where one MMC is tasked with voltage regulation (VR) and the other performs as a power dispatcher to control and adjust power flow [24]. However, during the short transitory state of fault occurrence, the VR converter cannot regulate voltage throughout the first few milliseconds when the fault current is rapidly increasing. Even though the clearing time constraints are quite stringent in DC grids (compared to AC), the typical response time of the protection systems is in the order of milliseconds [25]. On the other hand, mere reliance on the protection relays on the AC side could be a disastrous mistake, as the voltage sag tolerance time is even much

Fault calculations
The initiation of any type of fault in a hybrid multi-agent system shall be analysed dynamically by accounting for the behaviours of all components who respond to the fault and interact with one another at the same time, and the response of each agent creates a new state which serves as starting point for readjustment of the entire system's state [26]. In other words, the relationship among them cannot be described as a simple single-agent cause-and-effect system, but a dialectical one where all agents act and interact simultaneously in a cyclical manner. It is also crucial to be aware of different time constants of the components of the hybrid system, as they respond differently to large disturbances such as solid short-circuit faults or abrupt load swings. For instance, large synchronous generators are very efficient dampers of sudden transient changes and a key factor in keeping grid frequency stable, as they have massive mechanical inertia. Conversely, converters, photovoltaic arrays, and most DG sources lack such an inertia and respond with much higher agility to any changes to the steady-state parameters of the system. We aim at calculating the maximal fault current fed by converter DC output only, and that happens when a pole-to-pole short-circuit occurs. Once again, as to IEC 61660-1, we eliminate intervention of the control system in limiting the fault current, or any interruption caused by the protection relays at the AC side, to guarantee calculating the worst-case scenario. Consequently, during the simulation, the converter performs in open loop mode, allowing the short-circuit current to assume the highest possible. Our method is based on decomposing the system into three separate subsystems, shown in Fig. 5, as follows: i. AC grid model, ii. converter's internal stored energy, iii. DC-bus model.
Each of these subsystems contributes to the magnitude of the fault current on the DC side. If the fault breaks out on the DC bus somewhere remote that all agents can operate normally and feed the fault in almost the same order of magnitude, analysis models similar to [25] and [26] can be employed. However, in our study, DC terminals of the converter are shorted and evidently, other sources have a minimal impact on the magnitude of the DC fault current. Therefore, the first two components -encompassing converter's contribution to the fault -are the ones that we will examine.

Contribution of AC grid to fault current
If the fault appears on the AC side, conventional methods based on symmetrical components analysis can be used to calculate the short-circuit current. For the short-circuit on the DC side of the converter, we have the internal energy of the capacitors depleted by fault, and the AC grid. Once V dc drops, anti-parallel diodes and silicon controlled rectifiers (SCR) which are embedded in MMC submodules to protect switches, start feeding the fault like a threephase rectifier as shown in Fig. 6.
In case the AC grid is abruptly connected to a rectifier, we will witness huge inrush current and voltage overshoots at the DC side which may reach as high as 2√2V LL for a three-phase system [27]. However, our assumption is that the converter is under normal operation mode before fault occurrence. Therefore, the following calculation can be applied for MMC's rectifier mode of operation 2V LL cos(ωt)d (ωt)/ Z fault (28) Obviously, in a hybrid system as in Fig. 7, or generally any AC source possesses some internal impedance. The transmission lines, transformers, and any passive current limiter inductor that might be installed in series with the AC source curb the maximum shortcircuit current on the DC side [27]. Therefore, we must refine (29) to consider these impedances. Ignoring the negligible resistance of the source and transmission line, we can rewrite the above formula as follows: Finally, substituting for I g which denotes the grid-side current, and Z g as the lump impedance of the grid seen by the converter, we obtain Practically, the arms' inductance and resistance, and grid's impedance must be included as part of total impedance as they also limit the current.

Contribution of internally stored energy to fault current
Equation (23) calculates the average total alternating energy stored within each phase of the converter. During normal operation, the sum of circulating currents of three legs is zero, as they are shifted apart by 2π/3. However, the arm currents do not add up to zero during fault condition, because all three legs are shorted simultaneously. We have chosen the Lagrangian general coordinate system to solve for the current produced by the stored energy. In principle, the Lagrangian method can be applied to any dynamic mechanical or electrical system. The equation pivots on a quantity called Lagrangian denoted by £ which is the difference between the kinetic energy T of the system and its potential energy V. That is Furthermore, we are going to analyse the system during a transitory phase, when the fault happens. Thus, we need to consider the Lagrangian dynamics when an action takes place. In the mechanical version, action is denoted by S, then the principle of stationary action states that As said the Lagrangian is valid for any dynamic system, provided that the total energy of the system remains constant during the analysis, delimited by t 1 and t 2 . The two instants t 1 and t 2 represent a course of time during which system configuration changes [28]. For the Lagrangian analysis, it is of utmost importance to ensure all works done by all forces are accounted for. In our analysis, t 1 represents the last moment of the AC-DC system working in normal operation and just before the fault occurrence, and t 2 when the stored energy is fully consumed, that is potential energy V = 0. As a first step, we must identify the generalised coordinates of the analysis q k , which shall not be confused with electric charges which are also denoted by q. The kinetic energy T is then calculated based on the generalise coordinates [28,29] and can be written as Now, since we are dealing with an electric circuit, the mechanical Lagrangian would translate into the following equations, as q (electric charge) would be the generalised coordinate, and Q (that is u) the applied force, then The last derivation of (40) is just another interpretation of KVL, hence corroborating the validity of the formula. Now, we can implement the above equations into our model. We already showed the calculation for the phase energy E ph in (25) and can plug in the same into our Lagrangian model. Therefore, assuming the total energy of the system -stored as the circulating current in the three phases -is fully dumped during the fault occurrence and consumed by the lump resistance R of the equivalent circuit, we can conclude that the potential energy at the end of the event S is zero; hence, the potential part of the Lagrangian formula V disappears. Denoting total energy converter as E con and equating it with total potential energy before the event S happens, and assuming that all energy is transformed to T at the end of t 1 -t 2 period, we deduce The first derivative of q in Lagrangian is current i, and (43) asserts that the current will be a decaying sinusoid function biased by the current i o before failure and parameterised by circuit's resistance and inductance. Yet, as a second-order circuit, system's response depends upon the value of the damping factor ζ, so it essentially can behave in radically different ways. As the value of the fault resistance is quite low and negligible, system response would evolve as an under-damped circuit, therefore forms a decaying oscillation which is contained within the attenuation envelop.

Maximal fault current
Putting the contribution of rectified AC grid and stored energy together, we can compute the maximal fault current fed by MMC on its DC output terminals. As we aim at determining the highest possible magnitude of the current, we eliminate the oscillatory parts, and focus on the absolute value of the envelopes that encompass any decaying or persistent oscillation. Subsequently, frequency-dependent functions will be decoupled. Therefore, in the instance that highest magnitude is reached, the amplitude would be In high-voltage networks, the value of R is typically negligible compared to L, the maximum value of exp [−R/L] approaches one. In medium-voltage networks, the resistance is not usually negligible, nonetheless it has been eliminated from (43) and inserted to (44). Our rationale in doing so is to guarantee that in practical applications, the fault current will not surpass the value we compute by the model. Furthermore, L eq denotes the equivalent inductance of the converter arms in series with fault. As shown in Fig. 5, the L eq is equivalent to 2L arm /3, which will be in series with the fault impedance. Therefore, the denominator can be replaced as follows:

Conversion to per unit values
General mathematical framework elaborated so far would be more practical if converted to and expressed as per unit values. As to [29], the base AC voltage is the peak value of the line to neutral, which generates 1.0 p.u. DC at unity modulation index. Hence We represent the lump impedance of the AC system as seen by the converter as Z g , which includes the impedance of the step-down transformer, transmission line, and main generator or AC source. It is imperative, though, to convert all impedances while changing the voltage base of the system. Eventually, two important conclusions to take note of: (i) in most applications, the grid impedance is quite low; therefore, the first term of (46) will be the dominant part, (ii) the second term is the transitory manifestation of a fast decaying current which dies off at a rate of exp[−R/L eq ]. Therefore, except for occasions where the AC source is of high internal impedance, the impact of the second term of (46) would not be tangible.

Verification of the results
To verify the mathematical model, we first simulated the hybrid system in Simulink environment, using time-domain blocks. Consistent with distribution voltage levels in Ontario, we chose the AC medium voltage for the outgoing feeders of both substations to be 27.6 kV, 60 Hz. A step-down transformer reduces the line-toline voltage from 27.6 to 12.250 kV which is directly fed to the AC side of the MMC.
The hybrid system holds a bipolar ±10 kV scheme, with a power transfer capability of 5 MW. XLPE power cables connect the two interfacing converters stationed at AC distribution substations which are 10 km apart. Commercially available cables with a cross-section of 250 mm 2 (500 kcmil) to 500 mm 2 (1000 kcmil) will suffice to carry the current. Yet, software such as CYMCAP or ETAP can be used to ensure the ampacity based on either IEC 60287 and IEEE 835 (Neher-McGrath method) as elaborated in [30].
As explained, unlike typical power system analysis where rms value is the base, per [29], the base voltage selected to be the peak value of the line to neutral voltage, with the advantage of feeding 1.0 p.u. on the AC side yielding 1.0 p.u. on the DC output at unity modulation index. The fault with an impedance of 1.0 + j0.25 mΩ is placed at the DC output of MMC converter. In [31], typical fault values for transmission lines are provided. The minimum reported grounding impedance value for 69 kV is 2.45 + j0.54 mΩ, and the maximum value for delayed protection for the same voltage level is 39.5 + j5.79 mΩ. Therefore, the value we have chosen for the fault impedance is very conservative.
To choose sensible transmission line class reactance values and X/R ratios for the transmission lines and the step-down transformers, we referred to [32,33] and extrapolated the values to 27.6 kV, resulting in an average reactance of 0.1294 p.u., and average X/R ratio of 8.648. Typical values for transmission voltage levels are indicated in Table 2.
According to IEEE C37.113, Guide for Protective Relay Applications to Transmission Lines, a source impedance ratio (SIR) of 4.0 was selected, which, as illustrated in Table 3, denotes a medium line. For characteristic reactance and resistance of a typical aluminium cable steel reinforced (ACSR), the work in [32] is consulted.
Finally, Table 4 tabulates all internal and external parameters used for the simulation.
The essence of simulation result which clearly illustrates the transient impact of dumping the stored energy of MMC's capacitors into the fault is shown in Fig. 8. In this simulation, three different values for leg capacitors are chosen, and their respective impact on the total energy which is fed to the fault is shown using different colours. In all three cases, MMC steps into the rectifying regimefeeding the fault through anti-parallel diodes -after 15 ms. Simulation result confirms predictions of the mathematical model, which ascertains calculation of MMC's fault current-based equivalent three-phase rectifier model is not adequate. Evidently,  when the AC line has a low impedance, the difference between the two maximum values during transient period and rectifier mode would be less; simulation result for such a scenario is depicted in Fig. 9. Therefore, unless the AC source has a high impedance, the AC feed through current may obscure the total impact of converter's stored energy on the total fault magnitude. Figs. 10 and 11 help distinguish the proportional contribution of these two components of fault current for various grid and fault impedance values.
After verification of the mathematical model to compute the maximum fault current, we need to distinguish between the faults with destructive effect and transient faults that shall be tolerated by the system. Therefore, devising a fault detection and classification system to correctly identify and mitigate the faults is imperative.

Fault detection and classification
As mentioned, calculating the maximal fault current is only a first step in planning and devising a comprehensive and reliable fault management system, as any such scheme encompasses measurement and detection, classification, and finally proper mitigation of the faults. The ultimate goal is of course upholding system reliability and service continuity paramount. Therefore, any component and subsystem of the fault management deserves an indepth study to ensure precision, validity, and reliability. A key problem in hybrid systems is accurate classification of transient phenomena into actionable categories. While a short transitory overcurrent might be tolerated or completely ignored, the same current magnitude if lasts for longer time periods could damage converter valves and other line equipment. Even same current magnitude, with different harmonic content, can lead into entirely dissimilar consequences. Thus, it is clear that classification shall be a function that takes many parameters into account not only current amplitude and time.
While on the subject of reliability, we would like to briefly remind how the fault current impacts the system reliability. As emphasised in the introductory section, among the key parameters that heavily influence the engineering design and manufacturing of equipment, the concept of expected life which is closely related to reliability, stands prominent [33].
Having an idea about the expected life of the apparatus is often the starting point for the design and selection of materials and manufacturing technology [34], so due consideration shall be given to all equipment that make up the vital infrastructure of the electric grid. Designers of electrical equipment and systems are often faced with identifying various stress factors that may lead to premature failure of equipment. Short-circuit current, which is usually manyfold the magnitude of equipment's rated current during normal operation, is known to be one of the dominant stresses that leads to electrical and thermomechanical fatigue of electrical components and insulation material. As an example, the effect of short-circuit current on IGBT module bond wires fatigue is presented in [35].
Knowing the maximum amount of fault current is an undeniably crucial criterion in sizing the equipment, and also selection of and setting the protection devices. Nonetheless, the total damage that any fault inflicts on the system depends on the fault current amplitude and the duration; both typically measured and monitored by all protection systems. The damage factor formula is defined as i 2 t which in a way represents the total fault energy dumped on the system. Hence, many utilities prefer to measure both the magnitude and duration of fault current [36] to figure out the total damage caused by the fault. Accumulation of this information provides an important indication on the total damage suffered by the power equipment, and also a way in assessing the life expectancy and effective timing of the maintenance procedure.

Measurement and detection
Surely enough, measuring the current is the underlying method for fault detection. Nevertheless, it has proven not to be a straightforward task, and numerous methods have been developed to analyse and detect the fault current [37]. In most hybrid systems, current is measured at both AC and DC sides to enhance system reliability and redundancy of measuring instruments. However, precise measurement of the fault current poses some challenges in practice. For instance, the harmonics interfere with accurate measurement of the fundamental AC current. The harmonics appear as a result of decaying DC component superimposed on the AC sinusoids. Consequently, a filtering algorithm which implements Fourier transform is used to eliminate the offset and harmonics [38]. Most protection relays, however, just sample the signals and use a discrete Fourier transform with a full cycle filtering algorithm. The Fourier transform for continuous signal and the corresponding formulas for discrete version based on considering N samples [37] are as follows: Recording and analysing the faults using microcontroller-based systems is employed to deduce many beneficial conclusions about system's behaviour during faulty conditions, grid's reliability issues, and remaining expected life of equipment. The next step, however, is classifying the fault.

Classification
For classification purpose, we implemented a perceptron with a probabilistic classification algorithm as in Fig. 12. Fault F is represented by a vector of characteristics that describe several components and aspects of the fault. Based on vector values, a fault is assigned to a 'class', and necessary mitigation action can be undertaken afterwards. It is clear that any supervised classification algorithm needs some valid data points to train the system. Yet, before implementing a fault management system, the real data are not readily available for training purposes. Therefore, such data points are generated using Simulink. Of course, in practice, other software packages such as PSCAD or ETAP could be used for simulating the fault results and training the perceptron. Furthermore, depending on the grid and utility requirements, parameters, such as acceptable fault duration, maximum and minimum voltage sags, fault ride-through requirements, can be accommodated in the learning perceptron classifier. However, it is important to realise that the damage factor is and must be an integral part of the final sigmoid threshold function. In our model, the output layer takes into account the total damage factor plus an offset k, as indicated in the below equation The inclusion of the damage factor in the perceptron ensures that any transient overcurrent which may result in apparatus impairment and permanent damage is well detected and classified as a destructive fault to be dealt with swiftly. Yet, less sever overcurrent can be analysed through other grid provided parameters, for instance, the maximum acceptable overcurrent. Fig. 13 illustrates distribution of 5000 randomly generated faults with maximum magnitude up to 50 p.u., with various durations from 1 ms up to 1 s. The damage factor is calculated accordingly. As seen, when the duration of the fault is infinitesimally small, damage factor is not adequate to trigger the classification, and perceptron relies on a linear combination of all inputs that are trained to recognise the problem. Each individual parameter then has the opportunity to influence the classification when necessary. For instance, an output current with 1.2 p.u. once persists enough and long before reaching the cap for damage factor is recognised as a fault. The output of the perceptron can trigger the protection system which could be the control system or CB. Some scholars have tackled the issue of mitigating the fault current by proposing better control schemes, while others suggest using more efficient breakers and even fault current limiters [39][40][41][42][43].

Conclusion
A novel mathematical model based on Lagrangian is developed to calculate the maximal fault current on DC terminals of MMC converters interfacing medium-voltage hybrid distribution network. The model is based on decomposing the key drivers of the fault current into two distinct components which interact dynamically while feeding the fault: AC grid and converter's internal energy stored in submodule capacitors. None of the existing literature has directly dealt with computation of the maximal fault amplitude. Thus, to address and investigate this unchartered area, that is to analyse the worst-case scenario, we utilised an open loop model that eliminated the intervention of the control system and employed the Lagrangian method to compute the effect of dumping the internal energy of the converter on the fault current. Although for the purpose of optimising the system design in practical applications, there is always a trade-off between the maximum fault current in worst-case scenario and the limiting impact of MMC's control and other protection schemes on the fault current, the possibility of maximal amplitude must not be ignored or simply dismissed as a transient singularity. On the contrary, our method by combining all contributing factors yields a reliable framework for calculating the maximal fault current of MMC on its DC grid side. Findings of this research are especially important where the converter is interfacing DG with high internal impedance that are typically categorised as weak AC sources. Furthermore, as the damage factor is considered a key determinant of detrimental impact of the fault on high-voltage or medium-voltage apparatus, a multi-layer perceptron is designed to implement a probabilistic classification algorithm. The algorithm is designed with adequate flexibility in mind to draw upon the damage factor and other utility determined parameters to distinguish between tolerable transients and high-impact destructive faults that shall be isolated or mitigated immediately.