def battery_lifetime(lifetime_cycles, total_energy_stored,
                     depth_of_discharge):
    """Compute the lifetime of a battery in energy terms

    Arguments
    =========

    lifetime_cycles
    total_energy_stored
        size of battery (kWh)
    depth_of_discharge
        the depth of discharge for which lifetime_cycles is defined
        (0 <= DoD <= 1)

    Returns
    =======
        battery_lifetime in energy terms - units: kWh"""

    lifetime = lifetime_cycles * total_energy_stored * depth_of_discharge
    return lifetime