Analysis of the Reduction of CO2 Emissions in Urban Environments by Replacing Conventional City Buses by Electric Bus Fleets: Spain Case Study

The emissions of CO2 gas caused by transport in urban areas are increasingly serious, and the public transport sector plays a vital role in society, especially when considering the increased demands for mobility. New energy technologies in urban mobility are being introduced, as evidenced by the electric vehicle. We evaluated the positive environmental effects in terms of CO2 emissions that would be produced by the replacement of conventional urban transport bus fleets by electric buses. The simulation of an electric urban bus conceptual model is presented as a case study. The model is validated using the speed and height profiles of the most representative route within the city of Madrid—the C1 line. We assumed that the vehicle fleet is charged using the electric grid at night, when energy demand is low, the cost of energy is low, and energy is produced with a large provision of renewable energy, principally wind power. For the results, we considered the percentage of fleet replacement and the Spanish electricity mix. The analysis shows that by gradually replacing the current fleet of buses by electric buses over 10 years (2020 to 2030), CO2 emissions would be reduced by up to 92.6% compared to 2018 levels.


Introduction
Global warming continues to be one of the main problems the planet is facing, and transport is one of the most damaging sectors. According to reports by the International Energy Agency (IEA), in 2015, 32,250 MtCO 2 were emitted by combustible fuel throughout the planet (44.9% by coal, 34.6% by oil, 19.9% by gas, and 0.6% by other fuels [1]). Of these emissions, the transport sector is the second largest producer, contributing 24% of the total, only behind the electricity and heat sector, which contributes 42%. Table 1 provides a breakdown of the various types of transport that contribute to CO 2 emissions, which clearly highlights road transport as the largest contributor, with 5800 MtCO 2 [2, 3]. Road transport emissions cause two fundamental problems: (1) local order, since transport causes high levels of noise and pollution in urban areas (PM 10 , PM 2.5 , NOx, HC, CO), and (2) the global emissions of CO 2 into the atmosphere.
Despite the introduction of increasingly rigorous regulations aimed at controlling polluting emissions from conventional vehicles (powered by Internal Engine combustion (ICE) to diesel and gasoline), the underlying problem is the failure to consolidate already proposed policies to achieve a fundamental change in the use of alternative technologies. For example, the European Union (EU), looking at Horizon 2020, ruled on April 23, 2009 to implement the "DIRECTIVE 2009/28/EC OF THE The electric vehicle concept consists of it being charged using the electric grid, meaning it is important to estimate the emissions they cause. The national energy matrix is one of the principal sectors involving a country's social and economic development. Electric energy is an energy vector generated using primary resources (coal, oil, gas, wind, waste, solar, etc.), recorded in real-time from energy power stations. Electric power sources must have the following features: supply safety, quality, and diversification, so that its structure produces various types of electric power sources in order to minimize its impact on the environment. Furthermore, electric energy should allow economic competitiveness with suitable costs. Currently, there are important considerations and commitments in accordance with the Paris COP 21 [27] as well as the European Union energy strategy (2020 climate and energy package) [28], which aims to reduce greenhouse effect gas emissions with the aim of minimizing harmful changes to the planet.
The Spanish electricity mix has electrical power stations including coal; fuel/gas combined cycle, which uses non-renewable resources (coal, natural gas, liquefied petroleum gas, petroleum, and derivatives); nuclear power stations (uranium-based); and electric power stations using renewable energy such as hydraulic, wind, photovoltaic solar (PV), thermal solar, biogas, and biomass. Renewable energies (excluding hydraulic that existed previously) have been implemented based on a legal framework that provided incentives for their introduction, with the aim was not being exclusively energy dependent on non-renewable sources. Table 3 shows the nominal installed power values for each type of power station and their electric energy contribution in 2017. Table 3. Electric power sources in Spain at the Iberian Peninsula [29,30].

Technology of Generator
Power (MW) Electricity Generation (GWh) The Spanish electricity mix is quite diverse as there are 12 types of power station. This has occurred because Spain was one of the pioneers in the inclusion of alternatives energies in the national energy mix, with 104 GW total currently installed, of which 98.87 GW is produced on the Iberian Peninsula in Spain. The energy demand covered in 2017 was 248.4 TWh, of which 33.7% was met using renewable energies, whereas 66.3% was using conventional energy.

Renewable Energies
A controversial issue related to electric vehicles is the life cycle of batteries and how it affects CO 2 emission intensity. The battery lifespan leads to comparison with several technologies, mainly diesel and petrol vehicles. Studies in which the complete life cycle of an electric vehicle has been analysed showed that contamination by lithium batteries is only 13% of the vehicle's total CO 2 emission intensity [31].
A strength of the electric vehicle in comparison to traditional technologies is that it depends the electricity mix of a country. In the European Union, the Polish have the highest emission factor (650 g CO 2 /kWh). Despite this, if electric vehicles are incorporated into this electricity mix, their CO 2 emission intensity is 25% less polluting than a light diesel vehicle. As the average emission factor is 300 g CO 2 /kWh, the European Union goal to reach 200 g CO 2 /kWh by 2030 further supports the use of electric vehicles.
Having viewed the current situation in relation to electric vehicles and its application in urban buses, this paper aims to characterise, via simulation, a conceptual model with this type of powertrain. The parameters and specifications are set to those determined for this type of vehicle. To estimate Energies 2019, 12, 525 5 of 31 the energetic behaviour, the city of Madrid urban route is used as a reference, specifically the C1 circular line, which is considered as the most representative. The company charged with managing this transport is Madrid Municipal Transport Company (EMT), which has 2050 buses and 209 routes. Its importance in the city's transport system is so significant that it carried 430 million passengers in 2016 [32].
The proposed approach for an urban bus with a large high-capacity battery pack is based on EMT's intent to gradually electrify its fleet (strategic plan 2017-2020 [33]), where 15 electric buses with characteristics like the proposed conceptual model have recently been acquired. The current percentage of the fleet with vehicles of this type is 1.76%, corresponding to 36 units.
The electric urban bus completes a traditional working day (16-18 h), then the electric energy consumed is recharged to complete a new working day. As a conceptual framework, this type of vehicle should be charged using the electric grid, so that the search for primary energy sustainability can be recommended. The current Spanish electricity mix has a representative contribution of renewable energies and the night time is a good time for the vehicles to be connected to the electric system.
The final part of this paper considers the gradual replacement of the fleet and its effect on the reduction of CO 2 emissions.

Methodology
Experimental data obtained from real drive conditions were used as a starting point. These routes were selected from the three most significant clusters; the routes correspond to the 27, 63, and C1 ( Figure 1) bus lines in the city of Madrid [34], which were chosen because they resemble 53% of bus routes in the urban area that circulate in Madrid. Our work is based on previous studies [34][35][36][37][38] developed by the University Institute for Automobile Research, Technical University of Madrid (INSIA) and applied to the EMT bus fleet, where 30 lines were tested using on-board equipment. These conditions allowed us to mimic reality, including all sources of variability, such as environmental conditions and traffic, driver behaviour, highly transitory operation, and the variable operating conditions of the vehicles.  The measurements were recorded when the bus was in service; movement cycles and stop periods can be distinguished and these periods are called kinematic micro-cycles. The movement cycles are characterised by variables such as total time, constant speed times, acceleration and deceleration process times, and average acceleration and deceleration times.
The data obtained from the C1 circular line (Figure 2) were chosen and the speed and height profile are depicted in Figures 3 and 4, respectively. This driving cycle is variable and best represents the different operational conditions within the city's urban environment. The route was divided into an outgoing itinerary (route 1) and an incoming itinerary (route 2). Table 4 provides a summary of the data obtained from the trials.

Design of the Propulsion System
The configuration of the system is shown in Figure 5. The powertrain was composed of: energy storage unit or batteries, electric machines, DC-DC converters, DC-AC inverter, auxiliary systems, and final transmission ratio. The optimal design of the powertrain depends, to a large extent, on the correct analysis of the longitudinal vehicular dynamics [39,40]. To calculate the tractive effort necessary for the movement of the vehicle, the resistant forces that must overcome were analysed ( Figure 6), including: rolling resistance, aerodynamic drag, gravitational resistance, and resistance to inertia. Applying Newton's second law and the Euler equation, we have: where m is gross mass, is longitudinal acceleration, is the mass factor, is the tractive effort developed by a traction motor on driven wheels, is rolling resistance, is aerodynamic drag, and is gravitational resistance. So, the tractive effort is equal to:

Design of the Propulsion System
The configuration of the system is shown in Figure 5. The powertrain was composed of: energy storage unit or batteries, electric machines, DC-DC converters, DC-AC inverter, auxiliary systems, and final transmission ratio. The optimal design of the powertrain depends, to a large extent, on the correct analysis of the longitudinal vehicular dynamics [39,40]. To calculate the tractive effort necessary for the movement of the vehicle, the resistant forces that must overcome were analysed ( Figure 6), including: rolling resistance, aerodynamic drag, gravitational resistance, and resistance to inertia. Applying Newton's second law and the Euler equation, we have: where m is gross mass, a x is longitudinal acceleration, γ m is the mass factor, F T is the tractive effort developed by a traction motor on driven wheels, R r is rolling resistance, F xa is aerodynamic drag, and R g is gravitational resistance. So, the tractive effort is equal to: γ m is estimated by the following expression: where I r is the moment of inertia of the masses that turn with the wheels with respect to their rotary axes, I t is the moment of inertia of the transmission components, r is the kinematic radius equivalent to the radius of the wheel under a load, and ξ j is the final transmission ratio. Alternatively, the tractive effort (F T ) can be calculated once the powertrain has been dimensioned through the following expression: where M ME is the moment of inertia of the masses that turn with the wheels with respect to their rotary axes, η j is the moment of inertia of the transmission components, and r e is the radius under load (effective radius of the driven wheels).
where is the moment of inertia of the masses that turn with the wheels with respect to their rotary axes, is the moment of inertia of the transmission components, is the kinematic radius equivalent to the radius of the wheel under a load, and ξ is the final transmission ratio.
Alternatively, the tractive effort ( ) can be calculated once the powertrain has been dimensioned through the following expression: where is the moment of inertia of the masses that turn with the wheels with respect to their rotary axes, is the moment of inertia of the transmission components, and is the radius under load (effective radius of the driven wheels).   where is the moment of inertia of the masses that turn with the wheels with respect to their rotary axes, is the moment of inertia of the transmission components, is the kinematic radius equivalent to the radius of the wheel under a load, and ξ is the final transmission ratio.
Alternatively, the tractive effort ( ) can be calculated once the powertrain has been dimensioned through the following expression: where is the moment of inertia of the masses that turn with the wheels with respect to their rotary axes, is the moment of inertia of the transmission components, and is the radius under load (effective radius of the driven wheels).

Performance criterion
For heavy vehicle applications, particularly in relation to human transport in urban environments, we complied with the following general and specific conditions for this study case: The drive cycles are normally repeated using the same pattern: cycles between one and three minutes as a maximum, with speeds below 60 km/h (Figure 7).

2.
Numerous stops are used that reduce the average power used during traction; however, there is an increase in the number of accelerations and decelerations.

3.
There are high autonomy needs given that the service duration tends to be around 18 h, the working day is from 5:30 a.m. to 11:30 p.m., meaning the window of connection to the electric grid is limited to between 12:30 and 4:30 a.m., considering time losses due to logistics.

4.
There is high energy consumption from auxiliary systems, so when sizing the energy storage system, attention should be paid to this variable.
is an increase in the number of accelerations and decelerations. 3. There are high autonomy needs given that the service duration tends to be around 18 hours, the working day is from 5:30 a.m. to 11:30 p.m., meaning the window of connection to the electric grid is limited to between 12:30 and 4:30 a.m., considering time losses due to logistics. 4. There is high energy consumption from auxiliary systems, so when sizing the energy storage system, attention should be paid to this variable. Performance criteria are limited to the speed requirements in urban areas, where buses rarely reach speeds of 60 km/h given the short distances between stops, as well as other factors such heavy traffic and speed restrictions. The criteria that were considered when designing the powertrain were: maximum speed, acceleration, and maximum slope [41][42][43]. Table 5 shows the urban bus conceptual model specifications. The power can be estimated under the aforementioned criteria. The tractive power required for the maximum speed is determined using the following equation: Performance criteria are limited to the speed requirements in urban areas, where buses rarely reach speeds of 60 km/h given the short distances between stops, as well as other factors such heavy traffic and speed restrictions. The criteria that were considered when designing the powertrain were: maximum speed, acceleration, and maximum slope [41][42][43]. Table 5 shows the urban bus conceptual model specifications. The power can be estimated under the aforementioned criteria. The tractive power required for the maximum speed is determined using the following equation: where P t vel is the tractive power for the maximum speed, g is the gravity acceleration, f r is the rolling resistance coefficient, C x is the aerodynamic drag coefficient, ρ is the air density, A f is the frontal area, and v max is the maximum speed. The tractive power required for acceleration is considered the acceleration time from zero up to a specified speed (65 km/h). Equation (6) states this as: The tractive power required for acceleration (P t ace ) in this equation is applied to a specific acceleration standard, where t a is the acceleration time employed, which is 28 s in this case. t a is defined based on how long it takes the vehicle to reach its maximum speed from its initial speed equal For the tractive power required for a maximum slope (18%), the speed at which this section is travelled (15 km/h) is considered. In this case, the aerodynamic resistance can be ignored as the progress along elevated inclines occurs at reduced speeds. The equation is set as: where θ is the angle of the slope to be overcome and V b is the speed the bus must travel to overcome the slope (base speed in this application). The results show that the tractive power required for maximum speed (P t vel ) is 52 kW for an acceleration (P t ace ) of 142 kW and for a maximum slope (P t sl p ) of 132 kW.

Vehicle Transmission
The vehicle transmission regulates the transfer of power (torque and speed) from the electric machine to the wheels. For this, a gear system is normally used, and for electric vehicles, a single gear change may be necessary. However, this depends on the torque and speed of the vehicle. If the constant power range is large, it may provide enough high torque at low revolutions; otherwise, a multiple gearbox should be used.
The size of the electric machine in nominal power terms is linked to the mechanical power and efficiency. These are obtained based on the nominal efficiency minimum requirements, which should comply with IE2 efficiency levels as of June 16, 2011 in accordance with the European Commission [44]. The efficiency for this type of motor is around 94%. The following equation determines the electric power of the machine: where P EM, el is the electrical power, P EM mec is the mechanical power, η EM is the efficiency of the electric machine, P t ace is the tractive power required for acceleration, and η j is the drivetrain efficiency. The maximum motor torque characteristic is described via the correlations between the output torque, the output power, and the angular speed. The motor output torque is calculated using the following expression: where M EM out is the output torque, ω EM is the angular motor speed, ξ j is the final transmission ratio, ω re is the angular speed of the wheel, V re is the linear vehicle speed, r is the nominal radius of the driven wheels, and i is the longitudinal sliding (0.1-0.3).
The above calculations determine that the electric machine power should be around 157 kW and the required torque should be 152 Nm. To complete the simulation, the characteristics of two motors connected to each rear wheel were chosen. The nominal power of each was 85 kW with a nominal torque of 220 Nm. The total nominal power was 170 kW and 440 Nm total nominal torque. The characteristic curve of this motor can be seen in Figure 8, where the torque and maximum power are 530 Nm and 150 kW, respectively, for each motor, which cover the full range of requirements. Table 6 shows the details of the characteristics of this component. the required torque should be 152 Nm. To complete the simulation, the characteristics of two motors connected to each rear wheel were chosen. The nominal power of each was 85 kW with a nominal torque of 220 Nm. The total nominal power was 170 kW and 440 Nm total nominal torque. The characteristic curve of this motor can be seen in Figure 8, where the torque and maximum power are 530 Nm and 150 kW, respectively, for each motor, which cover the full range of requirements. Table  6 shows the details of the characteristics of this component.  The energy consumption estimates for the auxiliary components (interior and exterior lighting, refrigeration pump, electrical steering, air conditioning, pneumatic brakes) are of great importance because the vehicle energy is limited, and recharging can take a long time. As the vehicle is in constant operation throughout the day, the energy consumption of the auxiliary systems may be high, from 20 to 40 kWh/100 km for this type of vehicle according to the IEA [46].
Gao et al. estimated the energy consumption of the auxiliary systems as 3980.2 kJ and 4812.1 kJ (1.1 kWh and 1.33 kWh, respectively) for two different types of powertrains for urban routes in China according to the China Typical Bus Driving Cycle CTBDC), which has an approximate time of 1300 seconds. However, during these tests, operation of air-conditioning was not included [47,48].
According to Miranda et al., the instant peak power of all the auxiliary systems together did not exceed 10 kW on an 11-km-long urban bus route in Brazil. The vehicle consumed 17.6 kWh of net  The energy consumption estimates for the auxiliary components (interior and exterior lighting, refrigeration pump, electrical steering, air conditioning, pneumatic brakes) are of great importance because the vehicle energy is limited, and recharging can take a long time. As the vehicle is in constant operation throughout the day, the energy consumption of the auxiliary systems may be high, from 20 to 40 kWh/100 km for this type of vehicle according to the IEA [46].
Gao et al. estimated the energy consumption of the auxiliary systems as 3980.2 kJ and 4812.1 kJ (1.1 kWh and 1.33 kWh, respectively) for two different types of powertrains for urban routes in China according to the China Typical Bus Driving Cycle CTBDC), which has an approximate time of 1300 s. However, during these tests, operation of air-conditioning was not included [47,48].
According to Miranda et al., the instant peak power of all the auxiliary systems together did not exceed 10 kW on an 11-km-long urban bus route in Brazil. The vehicle consumed 17.6 kWh of net energy with the auxiliary systems consuming 2.46 kWh for 1250 s during the route. These values represented 14% of the total energy consumption of the system, with a total consumption ratio of the vehicle of 1.6 kWh/km [49].
Gao et al. estimated the power of auxiliary systems on series and parallel hybrid buses as being 2.29 kW [50], with 3.75 kW for electric buses [51], as opposed to Göhlich et al., who found power consumption of 6 kW for the auxiliary systems [52].
Based on the literature, a value of 5 kW of power is proposed for the auxiliary systems. For the model to be more accurate, we decided that the power will be constant during the full journey, so that it will represent extreme energy consumption in the simulation model.

Battery Model
The battery power should be in excess or equal to the electric machine's power (P EM ) plus the auxiliary system's power (P aux ), meaning the battery power should be at least 175 kW. The following equation estimates the above: The output power on the battery terminals during the running of the routes is calculated using the following equation: The first term represents the power necessary for traction, which is equal to the resistance power over the loss of power in transmission and the electric machine, represented by their efficiencies η j and η EM , respectively. The second term represents the power of consumption of the auxiliary components, which is considered constant in this model. The regenerative braking power during the driving cycle at the battery terminals can be expressed as: where the slope, acceleration, or even both are negative; λ (0 < λ < 1) it is the regenerative braking factor, which is an applied braking effort function of the design and control of the braking system in a way that allows the estimate of the braking percentage to be recovered when using the electric machine. The energy supplied by the battery during the driving cycle is determined using the following equation: The first term represents the energy necessary for traction and the energy consumed by the auxiliary systems, whereas the second term is the energy recovered by the regenerative braking effect. For the analysis of this model, a battery capacity of 324 kW was determined, which is within an acceptable range for this type of vehicle (Table 2).
Lithium-iron phosphate batteries were proposed during the design. The energy density oscillates between 80 and 130 Wh/kg with peak power between 200 and 300 W/kg [53]. With a capacity of 324 kWh, the battery power is between 747 and 810 kW, allowing the maximum power requirement to be covered at all times.
The state of charge (SOC), which is the current energy capacity held by the battery (expressed as a percentage, where 100% means full and 0% means empty), is determined as: where SOC is the state of charge, P BAT, out is the battery discharge power for the traction and accessories, P BAT, in is the battery charge power from regenerated kinetic energy, and E BAT is the battery's energy storage capacity. Table 7 summarizes the design parameters chosen in the powertrain.

Model Simulation
Once the design parameters were established, AVL Cruise software (Version 2017, AVL, Graz, Austria) was used. This program has specific routines to calculate energy consumption of conventional, hybrid, and electric vehicles [43]. The model proposed can be seen in Figure 9, where the parameters and design specifications explained in previous paragraphs are depicted, including the speed and height profiles of the C1 circular line. The two routes have a total distance of 17.52 km over 6216 s' running time (1 h, 43 min, and 36 s), including two stops over 240 s at the end of each route, which represents a short rest period for the driver or a personnel change. The objective is for the software to determine the electric energy consumption of the conceptual model proposed.
Mechanical power of the electric machine (EM) 148 kW -

Model Simulation
Once the design parameters were established, AVL Cruise software (Version 2017, AVL, Graz, Austria) was used. This program has specific routines to calculate energy consumption of conventional, hybrid, and electric vehicles [43]. The model proposed can be seen in Figure 9, where the parameters and design specifications explained in previous paragraphs are depicted, including the speed and height profiles of the C1 circular line. The two routes have a total distance of 17.52 km over 6216 seconds' running time (1 hour, 43 minutes, and 36 seconds), including two stops over 240 seconds at the end of each route, which represents a short rest period for the driver or a personnel change. The objective is for the software to determine the electric energy consumption of the conceptual model proposed. Figure 9. Electric urban bus model. Figure 9. Electric urban bus model.
The software calculates the resistance forces via various models. We used the physical model that estimates resistant forces (R a ) on the vehicle plant (block one) using the following equation: where k v,add,trac is the forces due to additional traction and k v,add,push is the forces due to additional push. Rolling resistance (R r ) is calculated separately on each tyre (blocks 4-7), where the transient model is defined. When this model is activated, the rolling resistance is calculated using a detailed resistance model: where R r, stab is the Steady-state rolling resistance, k W, emp is the empirical rolling resistance coefficient, T W,act is the actual tire temperature, and T W,stab is the stabilized tire temperature. The electric machine (blocks 12 and 13) may function as an electric motor or generator that has characteristic curves for each modality. The block has two components included: a DC-AC inverter and the electric motor. To calculate losses of power and torque, a model is used with an efficiency characteristic map. The motor electric power is calculated as: P EM, el = P EM mec + P EM loss (20) which is an alternative expression to Equation (8) that uses AVL Cruise and where P EM loss represents lost power due to losses in iron, copper and those caused by friction. Considering the signs convection, if P EM, el > 0, the motor operates in motor mode to propel the vehicle, whereas if P EM, el < 0 the motor operates in generator mode, recovering part of the kinetic energy produced by the decelerations. The mechanical power can be obtained using Equation (10) as: The mechanical power depends strictly on angular velocity (ω EM ), motor torque (M EM out ), and the efficiency depending on the motor's characteristic map, which is a function of these three parameters. The efficiency map of the electric machine is shown in Figure 10. The battery (block 17) was treated as a model that consists of a source of power and resistance. The resistance model allowed us to consider the complex internal processes of the battery (Figure 11). Two optional resistor-capacitor (RC) elements were added to describe the concentration overvoltage and the transition over-voltage [54]. The dependence on temperature in resistance can be activated as an option. Individual cells may be modelled as well as combinations thereof, meaning any module may be constructed. A thermal model describes the batteries thermal behaviour. Here, heat caused by losses and cooling caused by convection were considered. This model allows the use of "the temperature and SOC-dependent" option. As such, the resistance and capacitances are dependent on temperature T QH and the charge status SOC QH . The equation concerning output voltage on a battery cell (U QH, terminal ) is: where U QH, idle is the idle voltage of a cell, T QH is the actual temperature of the battery, SOC QH is the state of charge of a cell, I QH, ohmic is the actual current through the cell, R QH is the internal resistance, Q QH, conc is the charge of the capacitance for concentration overvoltage, C QH, conc is the capacitance concentration overvoltage, Q QH, trans is the charge of the capacitance for transfer overvoltage, and C QH, trans is the capacitance transfer overvoltage.
temperature and SOC-dependent" option. As such, the resistance and capacitances are dependent on temperature ( ) and the charge status where , is the idle voltage of a cell, is the actual temperature of the battery, is the state of charge of a cell, , is the actual current through the cell, is the internal resistance, , is the charge of the capacitance for concentration overvoltage, , is the capacitance concentration overvoltage, , is the charge of the capacitance for transfer overvoltage, and , is the capacitance transfer overvoltage. The SOC curve (Figure 12) of the battery pack was loaded into the simulation tool, which is dependent on the chosen battery technology. The auxiliary systems are defined in the model as consumers of electricity. They are symbolised by a single block (block 16) that represents an ohmic resistance where there are losses in electric current, meaning there is power consumption. The software allows setting the resistance value as constant, or via characteristics curves. In the model concerned, we used constant resistance, where , is the idle voltage of a cell, is the actual temperature of the battery, is the state of charge of a cell, , is the actual current through the cell, is the internal resistance, , is the charge of the capacitance for concentration overvoltage, , is the capacitance concentration overvoltage, , is the charge of the capacitance for transfer overvoltage, and , is the capacitance transfer overvoltage. The SOC curve (Figure 12) of the battery pack was loaded into the simulation tool, which is dependent on the chosen battery technology. The auxiliary systems are defined in the model as consumers of electricity. They are symbolised by a single block (block 16) that represents an ohmic resistance where there are losses in electric current, meaning there is power consumption. The software allows setting the resistance value as constant, or via characteristics curves. In the model concerned, we used constant resistance, The auxiliary systems are defined in the model as consumers of electricity. They are symbolised by a single block (block 16) that represents an ohmic resistance where there are losses in electric current, meaning there is power consumption. The software allows setting the resistance value as constant, or via characteristics curves. In the model concerned, we used constant resistance, considering an average working power during the complete cycle. The instant current can be calculated using the following equation: where I X is the current, U X, net is the net voltage, and R X, act is the actual internal resistance. The model shows supplementary components, such as the final drive (blocks 2 and 3), that represent the final transmission ratio of the vehicle. The vehicle's brakes (blocks 8-11) are described using braking data and dimensions as well as a specific braking factor. The cockpit (block 14) is the component charged with connecting the driver to the vehicle; connections form using the data bus. The ASC (block 15) represents the component that controls the individual wheel friction coefficients. If a friction coefficient exceeds the maximum transferable value, the accelerator position will vary. The DC-DC converter (block 18) is a component that is used to transform, in a highly efficient manner, continuous current voltages. Its function in this model was to set the voltage for the auxiliary systems, allowing the correct flow of energy in the data bus system. The eDrive control system (block 19) and eBrake and mBrake unit (block 20), are functions defined by the user, with its programming using C language. The eDrive function corresponds to control of the electric motor and the eBrake function acts on regenerative braking control.
The monitor (block 21) allows viewing certain calculation results while the simulation is running. Finally, block 22 provides the constants, where the values are defined and may be used by other blocks using the data bus.

Determination of CO 2 Emission for Electric Urban Buses by the Grid Power Generation
The emission component to be measured was CO 2 ; there was no database for the emission factors of the other power generation components [12,13]. To determine the CO 2 emissions of an electric vehicle, the electric generation should be considered. For this case, we studied the emission factors (FE) of the Spanish electricity mix. The emission factor of each power station must be associated with its contribution in terms of energy for the electric grid. The emission factors of the various power stations according to the Electric Grid of Spain (REE) [29] is shown in Table 8. The intensity of the CO 2 emission due to charging in relation to the electricity mix was established using the following equation: where EI veh is the CO 2 emission intensity (gCO 2 /km), FE mix is the electricity mix emission factor (gCO 2 /kWh), and C mix is the required electric charge from the electricity mix (kWh/km). The electricity mix emission factor (FE mix ) depends on the type of power stations. The efficiency of each component of the electric grid and the vehicle charging system should be considered (Table 9). These items make up the complete energy transport process, from the generation at the power stations up to the electric bus batteries. C mix is calculated using the following equations: where WSER is the wall-socket electricity requirement, η WTT is the well-to-tank efficiency, η trans is the efficiency of transmission, η dist is the efficiency of distribution, η charged is the efficiency of the charger (connector-battery), and η BAT Ch is the battery efficiency when charged. Table 9. Global efficiency of the components of the system when charged [55,56].

Definition of Scenarios
A gradual replacement of the fleet was considered, then we estimated the CO 2 emissions for the base year (2018) and those in 2020 (phase 1), 2022 (phase 2), 2026 (phase 3), and 2030 (phase 4). For the analysis, various data were obtained from scientific literature, OEMs, and EMT reports. For energy consumption and the intensity of the CO 2 emissions, the fleet of buses were taken as a start point in previous studies [57][58][59], where the estimates were calculated based on an analysis of the well-to-tank (WTT) and tank-to-wheel (TTW). The number of daily routes per vehicle was 20, with an occupation rate of 60% [60], energy consumption of each technology related to the fleet was considered constant in time, and the vehicles were grouped in four categories based on the EMT (compressed natural gas (CNG), diesel, hybrid, electric) [60]. Finally, the Spanish electricity mix data from 2017 were used, which were updated by the REE [29].
However, a change in the electricity mix is expected, which will allow the decarbonization of the electricity sector until 2030, which includes the sustainable contribution of renewable energy sources. According to expert reports, in 2030 under the DG2030 scenario, the contribution of electricity generation from renewable energies will be 62%, while that of non-renewable energies will be only 38%. This argument is analysed in results section, considering the changes that will occur in the electric mix under the 2030 distributed generation scenario, proposed by the Ten-Year Network Development Plan 2018 [61]. This is a baseline scenario upon which most of the electrical simulation exercises were based. Table 10 shows the installed power sources in the electric mix until the year 2030, whereas Table 11 forecasts the generation of electric power until the year 2030 foreseen under the DG2030 scenario.  The fleet includes vehicles with various technologies, which the EMT calls the Green Park Fleet: CNG buses, diesel buses with Euro V and VI standards, pure electric buses, as well as CNG hybrid buses, while the rest of the fleet are classified as diesel buses that comply with the EURO III and IV standard. Figure 13 shows the makeup by technology of the EMT's current fleet.
Phased replacement means there must be a gradual transition in technology change. Figure 12 shows that there is a large section of new buses as well as buses that are almost 15 years old. The phases are detailed as: Phase 1: Corresponding to the year 2020. In this phase, all diesel buses with a standard below EURO V are replaced, as well as diesel buses registered before 2010 and CNG-diesel vehicles. In this first phase, 644 buses are replaced, corresponding to 31.42% of the total fleet.   Figures 14a and 15a show the simulation of the electric consumption of the urban bus throughout the C1 line route. The electric energy exclusively from the battery during the journey of route 1 was 12.48 kWh, whereas for route 2, it was 3.79 kWh. In Figures 14b and 15b, the instant power provided by the battery pack during the journey with the maximum peak power was up to 136 kW for traction and 180 kW for regenerative braking in route 1, whereas for route 2, it was 142 kW for traction and 135 kW for regeneration.

Simulation Results
In Figures 14c and 15c (for routes 1 and 2, respectively), the electric and mechanical power in the electric machine are depicted. As expected, there were power losses P EM loss caused by friction and iron and copper losses. Power losses occurred due to efficiency of the DC-AC inverter, which, in this model, is included in the electric motor, shown in blocks 12 and 13 of Figure 9).
The SOC curves during routes 1 and 2 can be seen in Figures 14d and 15d, respectively. For route 1, the SOC was reduced by 3.83%, whereas in route 2, the SOC was reduced by 1.28%. The explanation for the higher energy consumption on route 1 is connected to the journey orography, the route starts at 628 m a.s.l. (metres above sea level) and finishes at 725 m a.s.l. (an increase of 97 m). The elevation difference for route 2 is a decrease of 97 m, starting at 725 m a.s.l. and finishing at 628 m a.s.l. This can be observed in Figures 3 and 4.
Finally, in Figures 14e and 15e, the total energy consumption during both routes is shown. For route 1, a total of 17.35 kWh was consumed, 12.48 kWh was provided by the battery (energy discharge), and 4.87 kWh through the regenerative braking (total input energy). For route 2, the total energy consumption of the system was 11.98 kWh, of which 3.79 kWh was from the battery itself, and 8.19 kWh from regenerative braking. The total energy used by the battery pack during a cycle was 16.27 kWh. Table 12 summarizes the data obtained from the simulations.  Figures 14a and 15a show the simulation of the electric consumption of the urban bus throughout the C1 line route. The electric energy exclusively from the battery during the journey of route 1 was 12.48 kWh, whereas for route 2, it was 3.79 kWh. In Figures 14b and 15b, the instant power provided by the battery pack during the journey with the maximum peak power was up to 136 kW for traction and 180 kW for regenerative braking in route 1, whereas for route 2, it was 142 kW for traction and 135 kW for regeneration.

Simulation Results
In Figures 14c and 15c (for routes 1 and 2, respectively), the electric and mechanical power in the electric machine are depicted. As expected, there were power losses ( ) caused by friction and iron and copper losses. Power losses occurred due to efficiency of the DC-AC inverter, which, in this model, is included in the electric motor, shown in blocks 12 and 13 of Figure 9). The SOC curves during routes 1 and 2 can be seen in Figures 14d and 15d, respectively. For route 1, the SOC was reduced by 3.83%, whereas in route 2, the SOC was reduced by 1.28%. The explanation for the higher energy consumption on route 1 is connected to the journey orography, the route starts at 628 m a.s.l. (metres above sea level) and finishes at 725 m a.s.l. (an increase of 97 m). The elevation difference for route 2 is a decrease of 97 m, starting at 725 m a.s.l. and finishing at 628 m a.s.l. This can be observed in Figures 3 and 4.
Finally, in Figures 14e and 15e, the total energy consumption during both routes is shown. For route 1, a total of 17.35 kWh was consumed, 12.48 kWh was provided by the battery (energy discharge), and 4.87 kWh through the regenerative braking (total input energy). For route 2, the total energy consumption of the system was 11.98 kWh, of which 3.79 kWh was from the battery itself, and 8.19 kWh from regenerative braking. The total energy used by the battery pack during a cycle was 16.27 kWh. Table 12 summarizes the data obtained from the simulations.

Determination of CO 2 Emissions from Power Generation
The most relevant result from this analysis is the energy consumed by the electric urban bus, once the working day has been completed (Electrical Consumption*). This value is known as the wall-socket electricity requirement (WSER), which is the energy discharged by the battery during the working day. In order for the bus battery pack to return to the fully charged state, the energy consumed must be recharged (162.7 kWh). To estimate the energy when connecting the bus to the electric grid, additional losses that exist due to the efficiency of each of the electric grid systems components must be considered, such as transmission (η trans ), ad distribution (η dist ), the recharging efficiency of the battery η charged , and the battery charging efficiency (η BAT Ch ), applying Equation (25) and considering the efficiencies in Table 9. We calculated that the energy provided by the electric grid for a full charge of the bus after a working day is 213.3 kWh in the worst case scenario, and 191.8 kWh in the best case scenario. In this study, an average efficiency was considered, meaning that the energy provided by the grid is approximately 200 kWh.
The fast charge systems for this type of application has a minimum power of 50 kW [46]. For this case, we used a charging power of 60 kW [65], meaning that complete charge occurred in 3 h 20 min. As the grid connection window is short, we considered connecting as of 12:30 a.m., which is when the bus has finished its working day, and the logistics waiting time has elapsed. As shown in Figure 16, positive factors are associated with this connection timetable, such as a larger contribution of renewable energies, especially wind power, corresponding to the valley section of the grid energy demand curve, along with a lower CO 2 rate compared with the daily average.

Determination of CO2 Emissions from Power Generation
The most relevant result from this analysis is the energy consumed by the electric urban bus, once the working day has been completed (Electrical Consumption*). This value is known as the wallsocket electricity requirement (WSER), which is the energy discharged by the battery during the working day. In order for the bus battery pack to return to the fully charged state, the energy consumed must be recharged (162.7 kWh). To estimate the energy when connecting the bus to the electric grid, additional losses that exist due to the efficiency of each of the electric grid systems components must be considered, such as transmission ( ), ad distribution ( ), the recharging efficiency of the battery , and the battery charging efficiency ( ), applying Equation (25) and considering the efficiencies in Table 9. We calculated that the energy provided by the electric grid for a full charge of the bus after a working day is 213.3 kWh in the worst case scenario, and 191.8 kWh in the best case scenario. In this study, an average efficiency was considered, meaning that the energy provided by the grid is approximately 200 kWh.
The fast charge systems for this type of application has a minimum power of 50 kW [46]. For this case, we used a charging power of 60 kW [65], meaning that complete charge occurred in 3 h 20 min. As the grid connection window is short, we considered connecting as of 12:30 a.m., which is when the bus has finished its working day, and the logistics waiting time has elapsed. As shown in Figure  16, positive factors are associated with this connection timetable, such as a larger contribution of renewable energies, especially wind power, corresponding to the valley section of the grid energy demand curve, along with a lower CO2 rate compared with the daily average.    Figure 17 shows the analysis of the Spanish electricity mix emission factor (FE mix ) based on the demand curves every day during 2017. The emission factor during a connection between 12:30 and 3:50 a.m. (FE prom ) and the average on the Iberian Peninsula in Spain (FE, REE* ) in all cases (except January) are lower than the average Spanish electricity mix emission factor FE, REE . This corresponds to a reduction of more than 10% in the annual emissions compared to FE prom ; however, with respect to the FE,REE*, the reduction is only 1.2%, as shown in Table 13.
Energies 2019, 12,525 25 of 32 Figure 17 shows the analysis of the Spanish electricity mix emission factor (FEmix) based on the demand curves every day during 2017. The emission factor during a connection between 12:30 and 3:50 a.m. (FEprom) and the average on the Iberian Peninsula in Spain (FE,REE*) in all cases (except January) are lower than the average Spanish electricity mix emission factor FE,REE. This corresponds to a reduction of more than 10% in the annual emissions compared to FEprom; however, with respect to the FE,REE*, the reduction is only 1.2%, as shown in Table 13.    310  255  188  202  283  320  313  276  280  327  348  284  284  FE, REE*  287  229  157  169  254  294  286  245  250  301  327  260  257  FE prom  322  231  155  173  243  296  271  225  234  291  332  272 Table 14 shows a summary of the main results obtained for the urban electric bus, such as the route length, the WSER, the energy charge from the electricity mix, energy consumption and the electric charge requirement from the electricity mix (C mix ), while Table 15 shows the CO 2 emission intensity from the urban bus for the years 2018, 2020, 2022, 2026, and 2030, which is the factor of emission from well-to-tank (WTT) for the electric bus that is used to determine the emissions saved compared to vehicles in the current fleet. It should be noted that the change in the Spanish electricity mix must be considered (Tables 10 and 11), which is what is expected to be agreed on in the horizon 2030 under scenario DG2030. To estimate the CO 2 emissions in the various fleet replacement phases, we considered previous studies [57][58][59] that analysed the life-cycles of various types of bus in the EMT fleet. For the TTW section, we used values obtained from the trials on the 15.5 km EMT route. Information was obtained in real-traffic situations based on tests with on-board equipment and subsequent modelling [34].
The results in Table 16 show that the energy consumption in electric buses is less than the other technologies, being six times less than diesel buses, close to eight times less than CNG buses, and five times less than hybrid buses. This is due to the high energy conversion efficiency of the electric vehicles. The emission intensity related to CO 2 emitted during the well-to-wheel (WTW) analysis shows that an electric bus is five times less polluting than a diesel bus, four times less than a CNG bus, and three times less than hybrids. In the coming years the CO 2 emission intensity will even be lower than currently, which is even more favourable for the electric vehicle.  Figure 18 shows the reduction in CO 2 emissions produced by the total implementation of a fleet of electric buses over a 10-year period with the current Spanish electricity mix (constant until 2030). The 2018 fleet was taken as a reference, having estimated emissions of 116.8 ktCO 2 for that year. During phase 1, forecast for 2020, the replacement of 31.42% of the fleet exclusively involves diesel buses. We estimated that emissions will be reduced to 82.4 ktCO 2 , which is 29.41% less than 2018. In phase 2, forecast for 2022, the replacement of 21.37% of the fleet (2.93% corresponding to the remaining diesel buses, 17.66% of CNG buses, and 0.78% of the renewal of electric buses from 2007 and 2008), we estimated a reduction of 44.71% in relation to 2018, which is 64.6 ktCO 2 . During phase 3, the forecast for 2026, 19.79% of the fleet is replaced (18.91% of CNG and 0.88% of CNG hybrid buses). We estimated that emissions will be reduced to 48.2 ktCO 2 , which is 58.70% less than in 2018. Finally, in 2030, where the whole fleet is 100% electric, replacing the remaining 27.41% of the fleet (24.97% CNG buses, 1.46% hybrid buses, and 0.98% renewal of electric buses), emissions will be reduced to 26.7 ktCO 2 , which is 77.14% less than the emissions for 2018. Figure 19 assumes the same previous conditions but with Spanish electricity mix of the horizon 2030 under the DG2030 scenario, with an emission factor of 82 gCO 2 /kWh, emissions can be reduced by up to 92.6% compared to 2018. Finally, Figure 20 compares the CO 2 emissions between the two scenarios. * includes all diesel buses, ** includes all hybrid buses, *** includes all CNG buses, and **** corresponds to the value simulated in AVL Cruise. Figure 18 shows the reduction in CO2 emissions produced by the total implementation of a fleet of electric buses over a 10-year period with the current Spanish electricity mix (constant until 2030). The 2018 fleet was taken as a reference, having estimated emissions of 116.8 ktCO2 for that year. During phase 1, forecast for 2020, the replacement of 31.42% of the fleet exclusively involves diesel buses. We estimated that emissions will be reduced to 82.4 ktCO2, which is 29.41% less than 2018. In phase 2, forecast for 2022, the replacement of 21.37% of the fleet (2.93% corresponding to the remaining diesel buses, 17.66% of CNG buses, and 0.78% of the renewal of electric buses from 2007 and 2008), we estimated a reduction of 44.71% in relation to 2018, which is 64.6 ktCO2. During phase 3, the forecast for 2026, 19.79% of the fleet is replaced (18.91% of CNG and 0.88% of CNG hybrid buses). We estimated that emissions will be reduced to 48.2 ktCO2, which is 58.70% less than in 2018. Finally, in 2030, where the whole fleet is 100% electric, replacing the remaining 27.41% of the fleet (24.97% CNG buses, 1.46% hybrid buses, and 0.98% renewal of electric buses), emissions will be reduced to 26.7 ktCO2, which is 77.14% less than the emissions for 2018. Figure 19 assumes the same previous conditions but with Spanish electricity mix of the horizon 2030 under the DG2030 scenario, with an emission factor of 82 gCO2 / kWh, emissions can be reduced by up to 92.6% compared to 2018. Finally, Figure 20 compares the CO2 emissions between the two scenarios.

Conclusions
From the simulations we completed for an electric bus conceptual model using the AVL Cruise software using a speed and height profile for the most representative bus line route in Madrid and gradually replacing the conventional fleet for electric buses over a period of 10 years, we conclude the following: An electric bus is more efficient as it has fewer losses in the powertrain. The results have shown that the energy consumption of electric urban buses is representatively less than the remaining technologies, six times less than conventional diesel buses, close to eight times less than CNG buses and five times less than hybrid buses.

Conclusions
From the simulations we completed for an electric bus conceptual model using the AVL Cruise software using a speed and height profile for the most representative bus line route in Madrid and gradually replacing the conventional fleet for electric buses over a period of 10 years, we conclude the following: An electric bus is more efficient as it has fewer losses in the powertrain. The results have shown that the energy consumption of electric urban buses is representatively less than the remaining technologies, six times less than conventional diesel buses, close to eight times less than CNG buses and five times less than hybrid buses.

Conclusions
From the simulations we completed for an electric bus conceptual model using the AVL Cruise software using a speed and height profile for the most representative bus line route in Madrid and gradually replacing the conventional fleet for electric buses over a period of 10 years, we conclude the following: An electric bus is more efficient as it has fewer losses in the powertrain. The results have shown that the energy consumption of electric urban buses is representatively less than the remaining technologies, six times less than conventional diesel buses, close to eight times less than CNG buses and five times less than hybrid buses.
Electric buses are less contaminating than the remaining technologies as the CO 2 emission intensity is lower, using a Well-To-Tank (WTT ) and Tank-To-Wheel (TTW) analysis it shows that an electric bus with the current Spanish electricity mix is five times less contaminant than a diesel bus, four times less than a CNG bus and three times less than a hybrid bus, as well as not emitting pollutant gases such as: NOx, CO, HC, PM 10 , and PM 2.5 , which are harmful for health.
With a Spanish electricity mix towards the horizon 2030 and under the DG2030 scenario, an electric urban bus can become representatively less contaminating than other technologies: 15 times less contaminating than a diesel bus, 13 times less than a CNG bus, and 10 times less than a hybrid bus.

•
The previous studies completed by this research group have proven that by replacing the current fleet with CNG buses, despite reducing NO x by 31.5% and completely eliminating PM, the CO 2 emissions increase by 5.1%, the HC by 307%, and CO 2 by 94.3%. This means that the most viable option, in our opinion, is the inclusion of electric urban buses if a city wishes be to radically eliminate GHG and pollution.

•
Although there are still controversies about electric vehicles due to the issue of environmental impact in their manufacturing and the recycling of batteries, there are studies that show that only 13% of the CO 2 emission intensity depends on the batteries. Another factor equally important is the electricity mix that is intended to charge the vehicle. The connection of the electric vehicle to an electricity mix, such as the Spanish mix, is sustainable since 33.7% of the electric power is generated from renewable energies, which results in a lower emission factor than the average of the European Union. All these positive factors allow us to think that, in a life cycle analysis, electric vehicles are much less polluting than diesel or gasoline vehicles.
Author Contributions: E.R.G. developed the simulation model, analysed data and wrote the paper. J.M.L.M. supervised the results, reviewed, and helped write the paper.
Funding: This work was partially supported by the following research projects: PCBBUS.