A unified approach to the analysis of electric energy and fuel consumption of cars in city traffic