Smart electric vehicle charging strategies for sectoral coupling in a city energy system

The decarbonization of city energy systems plays an important role to meet climate targets. We examine the consequences of integrating electric cars and buses into the city energy system (60% of private cars and 100% of public buses), using three different charging strategies in a modelling tool that considers local generation and storage of electricity and heat, electricity import to the city, and investments to achieve net-zero emissions from local electricity and heating in 2050. We find that up to 85% of the demand for the charging of electric cars is flexible and that smart charging strategies can facilitate 62% solar PV in the charging electricity mix, compared to 24% when cars are charged directly when parked. Electric buses are less flexible, but the timing of charging enables up to 32% to be supplied by solar PV. The benefit from smart charging to the city energy system can be exploited when charging is aligned with the local value of electricity in the city. Smart charging for cars reduces the need for investments in stationary batteries and peak units in the city electricity and heating sectors. Thus, our results point to the importance of sectoral coupling to exploit flexibility options in the city electricity, district heating and transport sectors.


Introduction
Cities are home to an increasing share of the growing global population [1]. As a consequence of this development, the demands for electricity, heating and cooling, as well as for private and public transport occur predominantly in cities and the local supply of these energy carriers will play an important role. A major challenge for city planning in the upcoming decades will be, therefore, to ensure that strategies for meeting these growing demands in the urban system are in line with efficient long-term targets to limit global warming [2]. A greater independence from electricity imports from the national power grid enables cities with rising demand for electricity to grow and expand over time in a way that puts less pressure on dependency of the long lead times typically associated with construction of new power lines connecting to the national power grid. Thus, the utilization of flexibility from storage systems, flexible demands and sectoral coupling on city scale in combination with local supply of electricity and heat is expected to be an important part of a fully decarbonized energy system. The integration between sectors and actors in the city, aided by communication technologies and infrastructure, with the overall aim to improve environmental, societal or economic performance, are collectively referred to as the Smart City [3][4][5].
Sectoral coupling has been proposed as key components of a sustainable energy system on the national and European scales [6][7][8].
Considering the synergies between sectors and technologies applicable to the city scale allows for the creation of efficient decarbonization pathways and scenarios for the urban energy transition [9][10][11]. The modularity of solar and wind power allows these technologies to be installed locally within the city energy system for the supply of carbon-neutral electricity and to increase the energy autonomy of the city. Solar PV experiences higher levels of acceptance than wind power in high-population areas due to fewer disturbances being caused. The local utilization of electricity from varying renewable electricity (VRE) technologies within the city can be increased when being integrated with battery electricity storage units or the charging of electric vehicle batteries [12][13][14][15]. High shares of VRE will result in variations in the marginal costs for electricity generation, which in turn can affect the operation of city district heating systems with combined heat and power or heat pumps, thereby increasing the value of flexible operation of the heat supply [16,17]. Power-to-heat by means of low-cost electricity can displace heating fuels in district heating systems or households [18]. The utilization of power-to-heat technologies (PtH), such as heat pumps and electric boilers, as well as thermal energy storage systems (TES), such as tank or pit storage units, has been shown to increase system flexibility to self-consume electricity from VRE [19][20][21].
To achieve decarbonization of the transport sector, electrification is considered as an essential step [22]. The term 'electric vehicle' (EV) includes a wide range of vehicle types for road, rail, water and air transport. This work studies pure battery electric vehicles (BEVs), in the forms of passenger battery electric cars (BECs) and electric public buses powered by on-board batteries (BEBs). The increased demand for electricity from emerging loads within the transport sector will have to be integrated into existing power systems. The integration of EVs has been studied on national scale [23][24][25][26][27], however, the integration into city energy systems is less well studied. Various strategies for the charging of BEVs have different implications for the power system, e.g., inflexible charging directly when being parked, smart charging that responds to incentives such as price signals or is governed by an aggregating actor, and including the option of discharging of electricity back to the grid, i. e. 'vehicle-to-grid' (V2G) [28]. Flexible charging strategies and V2G can offer services such as peak-shaving and valley-filling to the power system, thereby contributing to better integration of VRE [29][30][31]. Different market set-ups and pricing schemes are required to provide economic incentives to vehicle owners for using smart charging strategies and V2G [28,32] and thus stimulate flexibility from this sector coupling.
The synergies between solar generation patterns and the charging of BECs have been studied previously [33][34][35]. A temporal load match between charging times of BECs and solar PV generation and the possibility for PV panels to be integrated into building facades or placed on rooftops support the combined usage of BECs and PV in city energy systems [36]. Another reason for cities to incentivize a switch from internal combustion engines to EVs through policy intervention is the positive effects on local air and noise pollution levels [37][38][39]. BEBs represent an energy-efficient, low-noise and low-emission alternative for decarbonization of the public bus transport [40]. The requirement for large batteries, owing to the high electricity demand of buses, can be reduced by employing high-power opportunity charging [41], as considered in the modeling of this work.
None of the studies cited above have applied a modeling tool that includes local generation and storage of electricity and heat with an hourly time resolution, designed specifically to study decarbonization Fig. 1. Schematic of the city energy system optimization model including the representation of electricity and heating loads, the possibility to import electricity from the national power grid limited by the connection capacity, the investment and operation of local electricity and heating generation and storage and electrification of the city transport sector. Figure adapted from [42]. scenarios and sectoral coupling at the city level. Here, we develop and apply such a modeling tool, using the city energy system optimization model first introduced in [42] as a starting point, to study the interactions between BECs and BEBs and the city energy system. We model and compare BECs and BEBs in terms of the charging patterns within the city, considering three different charging strategies for BECs: i) Inflexible charging, whereby cars are charged directly upon arrival; ii) Smart charging, whereby charging is adapted to the city energy system; and iii) Smart charging with V2G. For BEBs, we apply Inflexible and Smart charging strategies. As the BEC fleet has larger electricity demand and battery capacity than the BEB fleet, the impact from a large-scale integration of BECs on the planning and operation of the city electricity and district heating sectors is delineated in more detail. Thus, this study contributes to improving current understanding of: • The implications of integrating the Smart and Inflexible charging strategies for BECs and BEBs into the city energy system and the potential for flexibility in the different charging strategies; • The ability of BEBs and BECs to exploit locally produced, low-carbon electricity and how this depends on charging strategies; and • The impact from different BEC charging strategies, combined with sector-coupling in the city energy system, on the optimal operation and design of the electricity and district heating sectors.
The focus of this work is to investigate potential synergies between electric transport and the district heating and electricity systems in the city and to study the potential to utilize local generation and storage technologies in combination with flexible charging of electric cars and buses. Thus, we do not aim to represent current energy markets but model the cost-optimized operation of the city energy system.

City energy system optimization including BEC and BEB charging
Sectoral coupling in the city energy system and the flexibility options from electric city transport are analyzed using a linear optimization model that considers investments and dispatch within the electricity and heating sectors for one year with hourly time resolution. The model has first been introduced in [42] and is expanded in this work to include charging strategies for electric cars and buses. Fig. 1 gives an overview of the inputs and outputs of the modeling. The modeling considers the operational and investment costs for the electricity and heating sectors, whereas the investment costs for electric cars and buses are not included in the optimization. The objective function is the minimization of annualized investment and running costs over one year, as given in Eq.
(1). Electricity and heat balances, Eqs. (2) and (3), ensure that the demands of electricity and heat are met at all time steps. Electricity can be imported to the city according to an electricity price profile. The modeling includes power-to-heat technologies and combined heat and power plants, which both link the electricity and heating sectors, as well as electricity and thermal storage systems. A detailed description of the full original model set-up is given in [42].
To include electrified transport, the model is complemented with a set of equations that describe the energy balance over the vehicle batteries in the BECs and BEBs and additional constraints on the technical limitations to vehicle charging. Three charging strategies for BECs and BEBs are modeled: • Inflexible charging: A charging strategy, whereby the vehicles are charged at each stop longer than one hour, until the battery is full, or the vehicle leaves for the next drive, which offers no flexibility. • Smart charging: Charging can be postponed according to the energy system optimization, such that the total city energy system cost is minimized, while the vehicle driving demand is fulfilled at each time step. • Smart charging with Vehicle-to-Grid (V2G): Smart charging with the possibility to discharge vehicle batteries back to the city energy system, i.e. V2G. V2G is scheduled such that the city energy system cost is minimized, while the vehicle driving demand is fulfilled at each time step.
The Smart and Smart with V2G charging strategies thereby model the maximum flexibility that can be provided from BECs and BEBs, while fulfilling the driving demand and taking into consideration the times that the vehicles are parked and connected to charging infrastructure.
The electricity demand for BEC and BEB charging is included in the city electricity balance (Eq. (2)) as a fixed hourly profile for the Inflexible charging strategy, which is given exogenously to the model and is based on the vehicle driving demand and parking times. Smart charging and the possibility for V2G are included in the electricity balance as variables. Additionally, a set of constraints is added to represent the technical limitations to Smart charging and V2G (Eqs. (4)- (7)). Eq. (4) is the energy balance over vehicle batteries, which ensures that batteries are charged enough to fulfill the driving demand at each time step. Eqs. (5) and (6) restrict Smart charging and V2G by the maximum charging power and the number of vehicles being parked at each hour. Eq. (7) limits the maximum storage level in the vehicle batteries.
We model the driving demand as an aggregate for different vehicle categories, one category for BECs and four BEB categories (for details, see Section 2.5). Thereby, in each category a share of the vehicle fleet is driving and a share is parked. The impact from aggregating vehicle profiles as compared to modeling individual profiles has been investigated in [43], where an aggregated profile has been found to be sufficient when charging possibilities are not restricted to home-charging.
We investigate the local marginal cost of electricity in the city energy system, i.e. the marginal value of the electricity balance (Eq. (2)) at each time step as an indicator of the value of electricity over time in the city energy system. Today's retail prices usually do not reflect a time-varying electricity price nor any geographical variations within the established price areas (there are four price areas in Sweden). Thus, the local marginal costs are used here to study how the value of electricity within the city energy system differs at times from the wholesale market price due to local generation in the city and congestion to the surrounding system, and are not meant to represent today's market set-ups. However, retail prices that reflect the local marginal cost of electricity can incentivize a city energy system operation that makes use of sectoral coupling and flexibility similar to our modeling. The price profile on imported electricity is given as an input to the model and represents the wholesale market price in the market region. The local marginal cost can differ from the wholesale market price in cases where there is an abundance of low-cost, local generation of electricity within the city or because of congestion in the grid infrastructure for the import of electricity to the city energy system.

Indicators for electrified transport
We formulate three results indicators: i) The average number of full battery cycles; ii) The amount of postponed charging; and iii) The amount of V2G. These are utilized to compare the different charging strategies for electrified transport and their interactions with the city energy system. The number of annual full battery cycles (FC C ), which gives an indication of how heavily the car and bus batteries are utilized over one year, is given by: where EV Ch c,t is the sum of the annual charging, and EV Cap c is the total battery capacity. A high number of full battery cycles causes cyclingdependent battery degradation, which in turn can influence the useful lifespan of the vehicle battery. With the method applied in this study to model the aggregated BEC and BEB fleets we can calculate FC C for the average vehicle of the fleet. Within the categories for BEBs, individual vehicles are expected to experience very similar cycling patterns (given that they are not employed in different categories with different driving intensities on different days). Within the BEC fleet, the individual travel patterns are much more diverse and the deviation from the average FC C value is expected to be larger for individual vehicles in the BEC fleet than in the BEB fleet (see [44] for a comparison of the FC C values of individual cars).
The share of postponed charging (PC c ) indicates how flexible the BECs and BEBs are in terms of adapting their charging patterns to the city energy system, with a Smart charging strategy as compared to an Inflexible charging strategy and is calculated as follows: where PC c,t is the postponed charging each hour t, EV Inflexible charging profile, and EV ChSm t is the Smart charging profile, which is scheduled after city energy system optimization. This indicator considers only how much of the charging is postponed, and not the time period over which it is postponed.
V2G is defined as discharging from the EV batteries electricity that is not used to fulfill the vehicle driving demand and that instead can be discharged to the city energy system. We calculate the V2G discharge (V2G c ) as the share of the total electric discharge (both to the driving and the grid) from the vehicle battery that is allocated to V2G as follows: where EV V2G c,t is the electricity discharged through V2G and EV dem c,t is the vehicle driving demand.

Input data for the case study Gothenburg
The model is applied to the energy system of the city of Gothenburg, Sweden. We use the existing electricity and district heating systems as a starting point and model a scenario with net-zero CO 2 emissions from the electricity and heating supplies within the city in Year 2050. We assume that BECs comprise 60% of today's private car fleet and that electrification of the inner-city bus traffic in Gothenburg is 100%. These assumptions are in line with estimations on the future carbon-neutral private car fleet in Sweden [45] and the measures designed to meet the City of Gothenburg's goals to reduce carbon emissions from road transport by at least 80% up to Year 2030, as compared to the corresponding levels in Year 2010 [46]. Table 1 summarizes the annual electricity and heating demands, as well as the assumptions applied to the additional demand from electrified transport, and provides an overview of the different technologies that are available for dispatch and investment in the electricity and heating sectors in the model. We approximate the city boundaries within the modeling to the area covered by the Gothenburg distribution grid and assume a 50% increase in the city electricity and heating demand as compared to the Year 2012 levels. The increase in demand is to represent growth of the city through urbanization and the electrification of industrial processes; population growth in Gothenburg is expected to accelerate over the upcoming decades [47]. We maintain the connection capacity to the national power grid for electricity import at the Year 2019 level, with no investments in new connection capacity (for details, see [42]). Thus, the assumptions on demand growth and connection capacity are to investigate how an increased demand for electricity can be met within the city borders using the technologies listed in Table 1, and we examine the impacts that BECs and BEBs can have on the city energy system. The hourly price profile for electricity import is based on the output from the dispatch modeling of the national power system in Sweden in [27].

Private passenger electric vehicle data
The travel patterns for BECs in this study originate from a GPS measurement campaign [48,49] conducted in the western Sweden region (Västra Götaland region), in which the City of Gothenburg is located. The campaign monitored 770 randomly selected gasoline-and diesel-powered cars, each for a different period of 1-3 months between the years 2010 and 2012. The traveling pattern and distance driven by the measured cars are used to calculate the corresponding electricity demands, if provided by electric cars. The preparation of electricity demand profiles for driving, as well as the extrapolation of the demand profiles and the times that the vehicles are parked, to represent a full modeling year, have been performed as described in [43]. Fig. 2 shows the aggregated profiles for the driving demand of BECs corresponding to 60% of today's car fleet (Fig. 2a) and the share of the fleet that is parked and connected to the charging infrastructure at each hour (Fig. 2b), both for the first 6 weeks of the modeled year. We assume that vehicles are connected to the charging infrastructure at all stops longer than one hour. Under this assumption, more than 70% of the BEC fleet is connected during most of the hours. Technical assumptions made regarding the electrification of private passenger vehicles are summarized in Table 2.
A profile for Inflexible charging, which corresponds to immediate charging at all stops longer than 1 h until the battery is full or until the start of the next trip, is calculated for each car in the dataset and subsequently aggregated and scaled up to represent the BEC fleet in the whole city. Since the original driving data are acquired from non-electric vehicles, not all the original driving can fully be covered by BECs with the assumptions made in this study. Due to the driving distances, lengths of intermediate parking periods, battery sizes, and assumptions made regarding charging power, only about 96% of the driving demand can be supplied through the Inflexible charging profile. This difference between driving demand and charging profile is not evident in the modeling of smart charging and V2G, owing to the aggregated electricity balance for BEC batteries (Eq. (4)) used for these charging strategies. The aggregation implies that there is always sufficient total battery capacity to cover all of the driving demand.

Public bus load profiles
The BEB driving demand is based on the Year 2016 timetables of the public, inner-city bus-lines in Gothenburg. The technical assumptions regarding electrification of the bus system are listed in Table 2, and it is assumed that high-power charging infrastructure exists at the turnaround stop for each bus. In contrast to BECs, the number of vehicles is calculated for the BEB fleet so as to fulfill the entire driving demand for both the Inflexible and Smart charging strategies. We consider buses of 18 m in length for lines with high passenger travel intensities, and 12-m buses for less heavily trafficked lines; the 18-m buses are characterized by larger battery capacity and higher charging power than the 12-m buses ( Table 3). The vehicle sizes are based on the vehicle sizes in the current bus-lines. Thus, for both the Inflexible and Smart modeling cases, 47.2% of the fleet is 18-m buses and 52.8% is 12-m buses (for more details on the calculation of the BEB load profile, see Appendix D).
In contrast to the BECs, a large share of the BEB fleet is on the road and driving at the same time during traffic rush hours. In the bus fleet, some of the vehicles also drive for long time periods with only a short time slot for charging. So as not to overestimate the flexibility for postponing charging with the BEB Smart charging strategy in the model with aggregated vehicle profiles, we categorize the BEB fleet according Table 1 Overview of the Gothenburg energy system, including the modeling assumptions for increased demand and electrification of the transport sector, as well as the technologies considered in the modeling of the city electricity and heating sectors.

Energy system data and technology options
Data on the city energy system modeled Annual electricity demand (excl. demand for electric cars and buses) 6.1 TWh (incl. an assumed 50% increase) Annual district heating demand 6.2 TWh (incl. an assumed 50% increase) Annual electricity demand for electric cars 1 294 GWh Annual electricity demand for electric buses 2 53 GWh Technology options considered within the city energy system Electricity only Solar PV, Peak power gas turbines Heat only Heat-only boilers (HOB) run on different fuels Power-to-heat (PtH) Heat pumps, Electric HOBs Combined heat and power (CHP) CHP plants Stationary storage systems Stationary batteries (Li-Ion), Tank storages (TTES), Pit storages (PTES) 3 1 assuming the electrification of 60% of the private car fleet. 2 assuming the electrification of all inner-city buses. 3 considering PTES with and without connected heat pumps, i.e., suitable for medium and seasonal storage. to driving intensity into: Peak (BEBs that operate only during day-time peak hours); Intermediate (BEBs that have at least a 4-h break between end-of-day and start-of-day operation); and Base buses (BEBs with close to constant operation and breaks of less than 4 h between end-ofday and start-of-day operation). Table 3 gives the electricity demand for BEB charging in each of these categories. Some bus-lines are not amenable to categorization, as some individual buses would be scheduled in multiple lines to create an efficient bus network. As this is not possible in the method used to create the bus load profiles (see Appendix D) and in order not to overestimate the flexibility for postponing charging in the BEB fleet, the charging in these lines is listed as 'Uncategorized' in Table 3 and is modeled as an inflexible charging load without the option for smart charging. Buses in the Base category are also modeled with an inflexible charging profile and are not considered for smart charging, due to their almost constant operation and, consequently, their low potential for charging flexibility. Fig. 3 shows the driving demands for the BEB categories and the shares of buses in the Peak and Intermediate categories that are connected to the charging infrastructure over a period of 1 week. We assume the same weekly profiles for the BEB driving demand during all the weeks of the modeled year. The driving demand for Base buses increases slightly during the weekend, as more buses fulfill the criteria for the Base category during this period, whereas buses in the Peak category are idle over the weekend. The total driving demand of the BEB fleet decreases during the weekend. Table 4 provides details on the modeling cases. We model one case without EVs, three cases for BECs with Inflexible and Smart charging with and without V2G, respectively, and two cases for Inflexible and Smart charging of BEBs, respectively. Table 1 reveals that BECs impose a larger 1 See Appendix D for details. 2 Installed battery capacity; for the modeling of BEBs, 80% of the installed battery capacity is assumed to be usable (100% of the battery is assumed to be usable for BECs). 3 Charging at turnaround stops; charging at the depot is possible at 50 kW per bus.  additional demand for electricity on the city energy system than do BEBs, and they introduce a larger storage capacity through vehicle batteries. As BECs, therefore, have a stronger impact on the city energy system, we chose to model BECs and BEBs in separate cases, so as to investigate their respective linkages to the city energy system in detail.

Results
We first present the charging patterns of the BECs and BEBs, modeled separately and taking into consideration the different charging strategies, and their integration into the city energy system with respect to the electricity mix and costs for charging. As BECs add a much larger electricity demand and larger battery capacity to the city than BEBs, their impact on the city energy system is much stronger, therefore Sections 3.2 to 3.4 focus on the interactions between BECs and the city electricity and heating sectors. Fig. 4 shows a comparison of the charging duration curves of BECs and BEBs for the two charging strategies Inflexible and Smart, and the charging duration curve in the BEC V2G case, all of which were obtained from modeling the BEC and BEB cases separately. We plot each charging event of the modeling year and sort them by amount of electricity charged. As can be seen, there is a substantial difference in the electricity demands for charging for BECs and BEBs (y-axes in Fig. 4), which explains the stronger impact that the BEC fleet has on the city energy system. This is due to the higher number of vehicles in the BEC fleet than in the BEB fleet. The total level of electricity charged in the BEC V2G case is around 3-fold higher than in the other BEC cases, since electricity is not only used for driving but also for V2G discharge to the grid. Fig. 5 shows the Smart and Inflexible charging patterns for BECs and BEBs for one modeling week and the battery storage levels of the aggregated BEC and BEB fleets with Smart charging. In Fig. 4 and Fig. 5, it becomes clear that the difference between the Inflexible and Smart charging strategies is much smaller for BEBs than for BECs. This is because the bus fleet is utilized more efficiently and fewer vehicles are idle at each time step. Consequently, buses have a low potential, limited by the time available for grid connection, to provide flexibility in postponing charging with a Smart charging strategy while still meeting the timetable and the driving demand. Given the applied categorization of the BEB fleet, only the Peak and Intermediate categories, which account for about 34% of the annual driving, can postpone their charging.

BEC and BEB charging
The possibility to charge less frequently when using a BEC Smart charging strategy, as compared to BEBs, is also evident from the battery storage levels (Fig. 5, b and d). BEBs can only postpone their charging within the same day, while the comparatively large battery capacity and low utilization times enable the aggregated BEC fleet to postpone charging for up to a week and to concentrate a large fraction of the smart charging to certain hours. Modeling individual car batteries, as compared to the aggregated BEC fleet considered in this study, could result in a need for additional charging within the same week for some vehicles with high driving demands. Fig. 5 exemplifies the ability of the BEC fleet to postpone charging over several days. During other periods of the year, the BEC fleet charges more frequently, especially during the summer in connection with the availability of surplus electricity from local solar PV. The pattern for postponed charging and the aggregated storage level of BEC batteries in Fig. 5b are in line with results from the modeling of the Swedish electricity system using individual driving patterns by [26]).
Peaks from smart charging reach much higher absolute values for the BECs than for the BEBs (Fig. 4), due to the large number of private passenger cars in the city. An uncoordinated smart charging of BECs can, therefore, create unwanted peaks in the electricity demand from charging and these peaks are sufficiently large to influence the marginal value of electricity in the city energy system. It should be noted that even Table 4 Modeling cases considered in this study. though the BEC Smart charging peaks are up to 7-fold higher than the BEC Inflexible charging peaks, the Smart charging pattern is a result from the city energy system optimization and thereby represents the charging pattern that best matches electricity supply and demand in the energy system. Table 5 presents the indicators for electrified transport (described in 2.3) as applied to the modeling results. BECs with and without the option for V2G cycle their batteries noticeably less frequently than all the BEB categories, due to their lower average driving distance in relation to their battery size. Buses in the Peak category experience the lowest number of full cycles in the BEB fleet and show the highest level of postponed charging. We do not assume any V2G for the BEBs. For the BEC fleet, the level of V2G discharge corresponds to 67.6% of its total discharge in the BEC V2G case. Thus, BECs charge 3-times more electricity over a year in the BEC V2G case than in the BEC Smart case. The aggregated modeling method is likely to overestimate somewhat the potential for V2G in the BEC fleet, due to limitations associated with individual car travelling patterns, which are not represented in the aggregated profile. The number of annual full cycles is an average for the fleet; individual vehicles in the BEC fleet are likely to experience diverse cycling patterns, reflecting differences in individual driving demands.
Smart charging of BECs results in almost 62% solar PV in the  electricity mix for charging, as compared to 24% for BEC Inflexible charging, and in turn involves a lower share of imported electricity in the electricity mix for charging ( Table 6). As stated previously, BEBs have a lower potential to postpone their charging compared to BECs, which means that there is a lower impact from the charging strategy on the charging electricity mix. However, the BEB driving demand is more concentrated to day-time travel, as compared to the driving demand of the BEC fleet. The Inflexible charging pattern for BEBs, therefore, correlates well with the pattern of electricity generation from solar PV, which leads to a larger share of PV in the electricity mix for Inflexible charging of BEBs than of BECs. The marginal costs of electricity within the city energy system in the modeling give an indication of the local value of electricity in the city over time. We calculate the difference in the costs of charging between the Smart and Inflexible charging strategies for BECs and BEBs, respectively, considering the local marginal costs in the city as the hourly costs of charging. The differences between the Smart and Inflexible charging costs are 34% for BECs and 4% for the BEB fleet (Table 5). This indicates that a charging costs scheme that takes into consideration the local value of electricity within the city can provide cost savings to BEC owners, when charging is postponed in accordance with the city energy system. Low marginal costs of electricity often coincide with high levels of generation from low-cost, local solar PV. Thus, the larger PV share in the electricity mix of the BEC Smart case, as compared to the BEC Inflexible case, results in lower costs for charging.

BEC charging strategies and the operation of the city energy system
The flexibility to postpone the charging of a substantial fraction of the electricity demand using the Smart charging strategy for BECs and the high battery capacity available in the BEC fleet within the city fosters the interaction between the electrified transport sector and the operation of the city energy system (Fig. 6). It is noticeable that the storage levels of the BEC batteries follow the patterns of PV generation in the BEC Smart and BEC V2G cases. V2G discharging events in the BEC V2G case occur at the same times as the discharge of stationary batteries in the BEC Smart case (e.g., the gray-shaded segments marked 'I' in Fig. 6, a  and b). Charging in the V2G case is utilized to take advantage of the large local PV supply or low prices for imported electricity (the latter of which is seen in, for example, Segment II in Fig. 6, b and c), which is a role that stationary batteries fill in the city energy system in the modeling cases without V2G. Smart charging in the modeling is scheduled during times of high generation from solar power (e.g., Segment III in Fig. 6, a and b). However, in the BEC Smart case, the electricity can only be used to fulfill the driving demand in the BECs and it cannot be discharged back to the city energy system. Therefore, less electricity is charged at once in the BEC Smart as compared to the BEC V2G case.
The differences in the profiles of marginal costs of electricity in Fig. 6c indicate that charging and V2G in the BEC fleet can affect the marginal value of electricity within the city. For this to affect the actual prices, time-varying electricity pricing has to be implemented. The modeling reveals examples of how high electricity demand for charging in the BEC V2G case leads to higher marginal costs within the city, as compared to the Smart or NoEV cases (Segment IV in Fig. 6, b and c). Likewise, there are examples of time steps during which the V2G discharge coincides with lower local marginal costs, as compared to the Smart and NoEV cases, which often coincide with hours of lower levels of electricity import (e.g., Segment V in Fig. 6). Fig. 7 shows that V2G leads to an overall lower level of electricity import to the city energy system and a higher number of hours with zero imports, as compared to the other modeling cases.

City energy system design under different BEC charging strategies
The electrification of private passenger cars and the choice of charging strategy affect the profitability of investments in the electricity and district heating sectors and, thereby, influence the energy system composition. Fig. 8 shows the new investments in electricity and heat generation technologies and in the stationary short-term and mid/longterm storage within the city energy system, as obtained from the modeling of the NoEV case and the three BEC cases. Regardless of the charging strategy used, the increased electricity demand from BECs  4 Charging costs determined after the hourly local marginal costs of electricity within the city. 5 For the complete BEB fleet, i.e. all categories combined, the postponed charging amounts to 13.0%. results in higher investments in solar PV compared to the NoEV case. However, as inflexible charging offers no flexibility to exploit the added electricity from solar generation, additional stationary battery systems are required. In the BEC Smart case, the need for stationary batteries is instead reduced compared to the NoEV case, and in the BEC V2G case the need for stationary batteries is completely eliminated. Solar PV employment is greatest in the BEC V2G case, where the BEC battery capacity can facilitate the highest levels of local PV generation.

Synergies with the district heating sector
A clear connection between the electricity and district heating  Fig. 7. Import duration curves for the electricity imported to the city in the NoEV and the three BEC cases.
sectors is seen in the utilization of power-to-heat technologies, together with thermal storage systems and the operation of combined heat and power plants, all of which are affected by the different BEC charging strategies, as is evident in Fig. 8 (see also Fig. A2 in Appendix A, which gives the annual generation from the different technology groups). The Inflexible and Smart charging strategies lead to lower PtH investments and higher investments in CHP units, as compared to the NoEV case. The higher electricity demand associated with BECs is only partially covered by the increased investments in solar PV, so additional electricity generation by CHP units is needed. This is especially prominent during winter months with high electricity (and heating) demand and low PV generation. In the NoEV case, all the surplus electricity from solar PV generation is utilized for PtH (and charged into stationary batteries to shift the electricity usage), which explains the higher level of PtH utilization in the NoEV case. In all three investigated BEC cases, a portion of the surplus electricity from PV generation is used to fulfill the driving demand for the electrified cars, instead of only being used by the PtH technologies. The more-extensive employment of solar PV capacity in the BEC V2G case, as compared to the three other cases, leads to investment in seasonal PTES together with PtH. As a consequence, lower CHP and HOB (serving as expensive peak heat generation) capacities are needed in the BEC V2G modeling case. Furthermore, the investment in tank storage systems, used for thermal energy storage in the short term (hours up to a few days), is lowest with the V2G charging strategy. Thus, the availability in BECs of a large battery pool, which has a direct connection to the electricity system and can provide short-term flexibility, is likely to have a strong impact on the total system composition with clear sectoral linkages. The operational profiles of the different TES technologies over the whole modeled year are shown in Fig. A3 in Appendix A.

Implementing electric transport and charging infrastructure in cities
A substantial electrification of the private passenger vehicle fleet introduces a large amount of battery capacity and new electricity demand for charging to the city energy system. We have shown that charging profiles for BECs offer a significant potential to be operated in a flexible way that is beneficial to the city energy system and that fosters the utilization of local electricity generation. We assume the availability of smart charging infrastructure with the possibility for V2G at all charging locations, and thus, our study gives an indication on the potential flexibility that electric transportation can provide to city energy systems and at which times flexibility from charging is most valuable to the system. The placement of charging infrastructure should also consider the location of the electricity demands for EV charging and the capacity restrictions within the local grid need, which has not been the focus of the present study. Charging that is geographically and temporally close to the peaks in residential, commercial or industrial electricity demand could increase capacity-related strain within the local grid. Nonetheless, controlled smart charging of EVs and charging geographically close to sources of local electricity generation, such as solar PV, can reduce the stress on the local distribution grid. Therefore, both the geographic and temporal distributions of charging should be considered during the planning of charging infrastructures in cities.
We model BECs connected to the charging infrastructure for all parking periods longer than 1 h. A comparison of charging at all parking events longer than 1 h and BEC charging that is limited to only the home location has been carried out on the national scale in [43]. That work has concluded that especially in connection with a high share of generation from solar PV, the possibility to charge outside the vehicle's home location, i.e., often during day-time hours concomitant with solar PV generation, increases V2G in BECs, and decreases the investment in stationary batteries. This is in line with findings in the present work and highlights the importance of placing charging infrastructure with the possibility for V2G in proximity to solar PV installations and at locations where private vehicles are parked during day-time hours.
Our study demonstrates a clear difference in battery cycling between electric car and bus batteries and between charging strategies that allow for V2G and those that do not (Inflexible or Smart charging without V2G). This illustrates the expected differences in the choice of battery size and charging infrastructure for the different applications. Bus batteries are adapted to shorter driving distances between charging, and the charging infrastructure is widespread in the city, while private passenger car batteries are often sized for longer travel distances, and thus, can continue without charging for longer periods in the daily use case. However, the usage of private passenger cars in the future is highly uncertain. Increased deployment of car-sharing systems and the introduction of autonomous vehicles may alter decisively the car driving demand profiles and should, therefore, be discussed for long-term decarbonization plans for city transport.

Benefits through cooperation in the city energy system
The method to model decarbonization strategies in several energy system sectors in the present study demonstrates the benefits from a cooperation between electricity, heating and transport sectors in cities. Thus, such sector coupling should be of importance as a means to establish Smart Cities. While the coordinated planning of decarbonization strategies in different sectors of the city energy system can increase cost-and resource efficiency, a functioning communication and collaboration between various stakeholders is a requirement. Cities and municipalities have the opportunity to take on a key role in joining expertise and ideas from different actors and different sectors to facilitate an efficient urban energy transition. The implementation of local technologies for generation and storage present a swift option to supply growing cities with electricity and heat and increase local energy autonomy -thus, an alternative to expanding the connection capacity to the national grid, projects that often involve long planning horizons.
We have modeled the interactions between BECs and BEBs and the electricity and district heating sectors using the example of Gothenburg, Sweden. Similar conclusions can be drawn for other cities that have a comparable technology mix and that have or aim for considerable solar PV generation capacities in the city energy system. Our findings on the synergies with the district heating system are only translatable to cities with similar seasonality patterns for their heating demand.
Economic incentives such as time-varying retail prices that take into account the local value of electricity in the city energy system should be easiest to realize if there is only one local energy utility that covers a large part of or the whole area of the city, as is the case in the city of Gothenburg.

Conclusions
We model the integration of passenger battery electric cars (BECs) and battery electric public buses (BEBs) into a city energy system through three different charging strategies and analyze their potential for charging flexibility. In the BEC fleet, we find that there is potential to postpone 85% of the charging when using a Smart charging strategy coordinated with the city energy system, as compared to an Inflexible charging strategy in which cars are charged directly upon arrival. With respect to the electricity generation mix for charging, the combination of a Smart charging strategy and local large-scale employment of solar PV can allow for a more than doubling of the share of solar PV in the charging electricity mix for BECs, as compared to an Inflexible charging strategy. To unlock this potential benefit from flexibility in BEC charging to the city energy system and facilitate the uptake of local generation, it is essential to provide charging infrastructure that allows for smart charging and V2G, and to communicate to car owners/users the times of the day when charging of EVs is advantageous for or detrimental to the city energy system. Our modeling shows a difference between the local marginal cost for electricity within the city energy system, i.e. a result of the energy balance in the model, and the price of electricity imported to the city, which is explained by: i) periods of surplus local electricity generation in the city; and ii) congestion in the connection from the national grid into the city, an issue that several Swedish cities have identified as crucial to be resolved in the near future. Our modeling also shows that BEC Smart charging often occurs around hours with high generation from local solar PV, especially when the option for V2G exists for electric cars. This indicates that there is much to win from scheduling flexible BEC charging so it matches the local marginal costs of electricity (rather than matching prices on the electricity spot market) or the forecasted generation profile for solar PV.
Comparing the Inflexible and Smart charging strategies for BEBs, we find that there is limited potential to postpone charging, as they are associated with long periods of operation and short stops for charging. In a categorization of the public bus fleet, we identify buses that are operated during times of peak and intermediate transport demand (accounting for about 34% of the demand for electricity in BEBs) as being suitable for a smart charging strategy. However, we show the daily peaks in public transport demand correlate well with the pattern of local generation from solar PV, as expected due to their day-time operation, which leads to a 32% share of PV in the electricity mix for both Inflexible and Smart charging of BEBs. Electrification as a decarbonization strategy for the public bus system, therefore, is particularly suited to cities that aim to increase simultaneously local generation of electricity through the installment of solar PV.
Our findings indicate that electrification of the private car fleet and the prevailing charging strategy for BECs can influence both the operation of and the investments in the city electricity and district heating sectors. We show a reduced or even eliminated need for stationary batteries in the city energy system when a charging infrastructure exists that allows for V2G in a large share of the BEC fleet. Smart charging of BECs with and without the option for V2G reduces the capacity requirements for peaking units in the electricity and the district heating systems. Thus, an energy strategy that coordinates measures in the electricity, heating and transport sectors of the city energy system is essential for resource-and cost-efficient decarbonization at the city scale.

Declaration of Competing Interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
The frequencies and magnitudes of the charging (and V2G) events in the aggregated BEC fleet differ between the three charging strategies investigated, as shown in Fig. A1 for the BEC Inflexible, Smart and V2G cases. The peaks for charging in the BEC Smart and V2G cases are up to 7-times higher than the peaks for an Inflexible charging strategy; V2G is utilized more during summer-time than winter-time, and this occurs concomitant with higher levels of generation from solar PV.
In Fig. A2 the annual generation from the different technology groups and modeling cases is given.  The annual operations of short-term TTES, medium-term PTES, and seasonal PTES are plotted for the BEC V2G case in Fig. A3.

Appendix B. Sensitivity analysis: assumptions made regarding demand growth in relation to connection capacity
In a sensitivity analysis, we test the assumptions related to growth in the city electricity and heating demand made in the modeling of the BEC cases. We compare the 50% increase in electricity and heating demand from the 2012 levels that have been presented in the Results section of the paper (here called the Base: 1.5 Growth case) to cases that assume a 20% increase in demand (1.2 Growth) and cases with no increase in demand (ZeroGrowth), for the modeling of NoEV, BEC Smart and BEC V2G. The connection capacity to the national power grid is considered to be identical in all the modeling cases. The sensitivity analysis allows us to assess the impacts on the results of the assumptions made regarding the relationships between import capacity to the city and inner-city electricity and heating demand, and make the results generalizable to other cities.
We find the same trends for investment in electricity, heating and storage technologies as presented in the Results section, as presented in Fig. A4. For the 1.2 Growth and Zero Growth cases, seasonal PTES is cost-efficient also for the NoEV and BEC Smart cases. The largest seasonal PTES investments are found in the V2G cases. The BEC indicators on postponed charging and V2G discharge are similar in all cases with different assumptions made regarding growth. We calculate the relationship between PTES and TTES and find it to be highest in the V2G cases for all the different assumptions made regarding growth.   A4. Results of the sensitivity analysis assessing the impacts of the assumptions made regarding growth in the city electricity and heating demands, with new investments in electricity and heating (a), short-term storage, (b) and mid-/long-term storage technologies (c), and indicators for the ratio between pit and tank thermal storage, PTES/TTES, the share of V2G of the total discharge and the share of postponed charging, PC (d). Table A1 gives the investment and variable costs as well as technical input data for electricity and heat generation technologies and for electricity storages, assumed for the modeling year 2050. Cost and technical assumptions are based on data from the Danish Energy Agency [50,51] and on the International Energy Agency World Energy Outlook 2019 [52]. Table A2 gives costs and technical data for thermal storages, based on [19,51,53]. Data on fuel costs per MWh and emissions associated to each fuel type in the modeling tool are presented in Table A3. Fig. A5 gives the profiles of electricity and heating demand used in the modeling for the City of Gothenburg and the electricity price assumed for electricity imported to the city. Electricity and heating demands are based on data for Gothenburg for Year 2012 including assumptions made on a 50% demand increase to represent city growth through urbanization and the electrification of industrial processes in the city (see Section 2.3). The electricity price profile for imported electricity stems from the dispatch modeling of the national power system including a high share of VRE and BECs in Sweden [27].

Table A1
Cost and technical data for local electricity and heat generation and electricity storages in the city modeling, Year 2050, (S, M and L correspond to small, medium and large units). a For the PV generation, a solar profile based on the geographical area limits the output per kW installed for each hour. b For the energy content in the fuel, lower heating value has been used, which is matched with a higher value for the efficiency. c Variable costs for electricity charged into and discharged from Li-Ion batteries are captured by integrating charge and discharge into the electricity balance in the optimization.

Table A2
Cost and technical data for the different thermal storage systems.   Fig. A5. a) Electricity and heating demand (excl. demand for PtH and electric transport, incl. assumptions made on 50% demand increase as compared to 2012) and b) electricity price for imported electricity, both used as input to the modeling. Figure adapted from [42].