A State-Space Approach to Modelling DC Distribution Systems