A diesel generator combines a diesel engine with an electrical generator to generate electrical energy. Diesel generating sets are used in places without connection to the power grid, as emergency power-supply if the grid fails, as well as for more complex applications such as peak-lopping, grid support, and export to the power grid. Sizing of diesel generators is critical to avoid low-load or a shortage of power and is complicated by modern electronics, specifically non-linear loads.