def aggregate_power(sim):
    """ Calculate the time series of aggregate power of all EVSEs within a simulation.

    Args:
        sim (Simulator): A Simulator object which has been run.

    Returns:
        np.Array: A numpy ndarray of the aggregate power at each time. [kW]
    """
    return sim.network._voltages.T.dot(sim.charging_rates) / 1000