Switch 2.0: A Modern Platform for Planning High-Renewable Power Systems

This paper describes Switch 2.0, an open-source modeling platform for planning transitions to low-emission electric power grids, designed to satisfy 21st century grid planning requirements. Switch is capable of long-, medium- and short-term planning of investments and operations with conventional or smart grids, integrating large shares of renewable power, storage and/or demand response. Applications include integrated resource planning, investment planning, economic and policy analyses as well as basic research. Potential users include researchers, educators, industry and regulators. Switch formulates generation and transmission capacity planning as a mixed integer linear program where investment and operation are co-optimized across sampled time series during multiple investment periods. High-resolution production cost modeling is supported by freezing investment decisions and including longer time series and more operational details. Modeling features include unit commitment, part-load efficiency, planning and operating reserves, fuel supply curves, storage, hydroelectric networks, policy constraints and demand response. Switch has a modular architecture that allows users to flexibly compose models by choosing built-in modules 'a la carte' or writing custom modules. This paper describes the software architecture and model formulation of Switch 2.0 and provides a case study in which the model was used to identify the best options for obtaining load-shifting and reserve services from batteries and demand response in a 100% renewable power system.


Introduction
Climate change mitigation requires electric power systems to achieve deep emission cuts by mid-century while serving increasingly electrified transport and heating sectors. 1,2 Power system infrastructure is long-lived, so investment choices made today will directly affect longterm sustainability. Meanwhile, the cost of wind and solar power and storage are falling below fossil fuels [3][4][5] and ubiquitous computation and increasing electrification may enable dynamic demand response to help balance high-renewable power systems. 6,7 To plan their next steps, power system stakeholders need capacity expansion models that meet three interrelated requirements: 1) high resolution in time, space, and operations to capture complexities of renewable integration; [8][9][10][11] 2) flexible resolution to manage computational complexity and adapt to diverse research, planning and policy questions; 8,9,12 and 3) transparent practices to facilitate scientific discovery, consensus building in public proceedings, and quality assurance. 10,13,14 (Also see Requirements in the Supporting Information.) High resolution. Capacity planning models need to make investment decisions during multiple periods over a multi-decade horizon-rather than considering a single investment stage-in order to avoid risking stranded assets in an evolving grid. 10 They must also model operational decisions using chronological timeseries-rather than independent timepoints-in order to consider important relationships between hours such as unit commitment (power plant start/stop decisions), minimum runtimes, storage state of charge, or inter-hour loadshifting via demand response. [8][9][10][11][15][16][17][18][19][20] Taken together, these requirements can easily lead to models that are too large to solve. Most existing capacity planning models resolve this conflict by using either multiple investment periods 8,[21][22][23][24][25][26][27][28] or hour-by-hour timeseries, 15,29-34 but not both. Switch 2.0 addresses this challenge by using multiple, probabilistically weighted timeseries per planning period. These sample timeseries can have arbitrary duration and resolution, which allows modeling representative days, load duration curves, or an 8760 hourly annual timeseries (the gold standard of operations modeling). Using sample timeseries makes it possible to capture stochastic weather and loads, inter-hour relationships, and multiple decades of investment decisions within a single computationally tractable model. Previously, Switch 1.0 2,35-40 used a similar approach, but each sample had to span exactly 24 hours. Switch 1.0 also had relatively little operational detail. Switch 2.0 adds a full treatment of unit commitment and related elements, including operating reserves and part-load efficiency, as well as numerous additional power system elements that take advantage of this framework (see Table 1).
Flexible resolution. Power system modelers must choose between detailed and simplified representations of system components, in order to balance fidelity with computational speed. 8,9,12 Switch 2.0 supports this with flexible temporal and spatial sampling. Further, Switch 2.0 introduces a novel, modular software architecture that allows users to choose among different built-in or custom "building blocks" to create models that match prior formulations from the literature or define new approaches. This contrasts with Switch 1, which used an inflexible code structure that required forking the code for every independent study. The flexibility of Switch 2.0 allows the model to be configured with the amount of detail needed for any particular question, and enables calibration runs to determine what resolution is actually needed. The modular approach also allows innovations to be readily shared across users and applications, permitting a greater degree of quality assurance and collaboration.
Transparency. Switch 2.0 is open-source software with no proprietary dependencies, which enables transparent decision-making, peer review, and advanced research and teaching by all classes of users. This supports replication of research findings and agreement among stakeholders during regulated planning processes. 10,13,14,46 It also enhances Switch's completeness, as elements developed for new studies are typically folded back into the main codebase. This paper describes Switch 2.0 and then presents a case study identifying the best options for obtaining load-shifting and reserve services from batteries and demand response in a 100% renewable power system in Hawaii. This is an example of the type of question that requires the resolution and flexibility introduced in Switch 2.0.

Program Architecture
Switch 2.0 is a Python package that can be used to define and solve power system expansion planning and production cost models. Switch 2.0 takes a modular approach that allows the formulation to be easily customized around the needs of each study. Users add specific components to their model by supplying a list of built-in or custom modules, which cover a variety of power system aspects with particular levels of detail. By changing the module list and input data, users can generate models with different elements or levels of detail. They can also switch easily between distinct modeling modes, such as running a sparse capacity-expansion model, followed by a more detailed production-cost assessment of the proposed portfolio.
Switch uses the open-source Pyomo 47 optimization framework to define models, load data and solve instances. Models can be solved using any optimization software compatible with Pyomo, which includes most commercial and open-source solvers.
Collaborative customization and development are supported through a GitHub portal 1 . Code developments are shared between Switch users both for new applications and for peer review. Issues and requests regarding the model may be raised, which are addressed by other members of the community. The model's source code and revision history are transparent and documented, so that it can be freely audited. Historical versions can also be installed as needed. This transparency and replicability make Switch an especially valuable tool for academic, educational and regulatory work on power systems.
The modular architecture of Switch 2.0 is designed to reflect the modularity of actual power systems, where individual elements operate independently but contribute to the system's total costs and power balance. Core modules in Switch define spatially and temporally resolved balancing constraints for energy and reserves, and an overall social cost. Separate modules represent components such as generators, batteries or transmission links. These modules interact with the overall optimization model by adding terms to the shared energy and reserve balances and the overall cost expression. They can also define additional decision variables and constraints to govern operation of each technology.
Each built-in or user-supplied Switch module is implemented by creating a Python module file that defines one or more standardized callback functions that will be called at each stage of generating and solving a model: defining and parsing command-line arguments, defining summation lists for costs or energy balance equations that are populated at runtime by all included modules, defining abstract model components (e.g. parameters, decision variables, constraints), loading data from an input directory, adjusting iterative models and testing for convergence, and performing post-solve functions such as saving results or figures to disk. These functions are detailed in the Supporting Information.
Users provide an ordered list of modules as part of the model configuration. At runtime, Switch loads each ? We had insufficient access to source code to assess this feature. a Use 1-2 blocks per non-peak day, which limits ability to model inter-hour relationships and peaks and valleys net of renewable energy b Includes gas pipeline model, but unclear whether fuel markets can be customized, e.g., for biofuel or LNG infrastructure c Accepts bids from storage or loads but does not model their intertemporal constraints directly d Duration of steps is user-defined, but each sample must span exactly one day; RESOLVE's formulation is based on Switch 1.x. e Experimental support. module and runs through definition, compilation, solution, and export stages, calling the relevant callback functions of each module in turn, starting with core modules to define the basic framework, followed by specialized modules to define custom technologies or policies.
This system is highly flexible, making it easy to add or subtract from the codebase, typically without having to modify the built-in modules. Basic extensions are simple to write, and advanced modules can perform iterative optimizations seeking convergence or define additional objectives and perform lexicographic optimization. Figure 1 presents the subpackages and modules that are currently included in Switch. The rest of this section describes the key modules and subpackages.

Timescales
This module defines three timescales for decision making: periods of one or more years where investment decisions are made, timepoints within each period when operational decisions are made, and timeseries that group timepoints into chronological sequences. Timepoints within each timeseries have a fixed duration specified in hours, and timeseries have a fixed weight that denotes how many times this type of series is expected to occur in the corresponding period. The separation of duration (hours) and weight (frequency of occurrence in a period) is necessary to describe both physical and statistical properties of the sampled timeseries.
Each timescale is important for renewable power planning. Single-period investment formulations without foresight have greater risk of stranded assets in the context of an evolving grid, 10 necessitating multi-period investment formulations to understand long-term transitions. Using numerous timeseries within each period allows representation of the range of covarying weather and loads that may occur. Using multiple sequenced timepoints within each timeseries allows modeling of intertemporal constraints on power plants, storage and demand response (e.g., minimum run times or finite daily load shifting).
This approach can represent any standard time structure: a load duration curve (many one-hour timeseries per planning period), a collection of sample days during each period (several one-day timeseries), or an 8760hour timeseries as typically used by production cost models (a single, year-long timeseries).
By default, Switch addresses timeseries edge effects by linking system conditions across the first and last timepoint of each timeseries with the assumption that each timeseries duration is whole number of days.

Financials
This module defines the objective function and financial parameters for the model. By default, Switch minimizes the net present value of investment and operational costs of the power system over the entire study.
Other modules may register fixed or variable cost components with the objective function.

Balancing
This subpackage defines load zones, geographic regions with load timeseries in which energy supply and demand must be balanced in all timepoints. Other modules may register power injections or withdrawals with the power balance constraints. An optional Unserved Load module allows imbalances with a user-specified penalty per unit of energy. This package also includes subpackages and modules for Planning Reserves, Operating Reserves and Demand Response. Operating Reserves and Planning Reserves can be applied to specific geographical regions as needed. Planning reserves allow the system to meet capacity targets that may exceed day-to-day requirements. Operating reserves consider dynamic requirements for balancing variability of load and renewable generation as well as contingencies. Switch includes generic modules representing rules that have been used in analyses of Hawaii and the Western Electricity Coordinating Council. Users may use these modules as-is, or use them as a starting point to define their own reserve modules based on local rules.
The Demand Response subpackage includes two optional components. The Simple module enables free shifting of load between timepoints within a timeseries, subject to a limit on total load reduction in each timepoint. The Iterative subpackage can incorporate an arbitrary convex demand system via Dantzig-Wolfe iteration.

Generators
This subpackage defines the set of all generation projects that have been or could potentially be built. The Core subpackage describes construction and operation constraints and decisions for all projects, and is sufficient to represent standard thermal generators or renewables without storage. Either a simple economic dispatch may be chosen through the No Commit module, or a full unit commitment formulation can be incorporated through the new Commit subpackage. Generators may be assigned a single energy source or allowed to switch optimally between fuels in order to meet targets for emissions or renewables.
Additional power sources may be implemented via optional modules in the Extensions subpackage within the Generators package. The Storage module defines a generic framework for storage technologies, such as pumped hydro, batteries, flywheels, and others. This formulation permits independent sizing of energy and power elements. The Hydro System module represents a cascading water network operating in parallel with the energy network, whereas the Hydro Simple module merely enforces average water availability for each sampled timeseries. Switch 2.0 is one of a small number of capacity planning models that include decisions about unit commitment -which plants to turn on during each timestep (Table 1). These decisions determine how much capacity is available to provide power and operating reserves. They also incorporate important operational limitations on power plants. 48 These factors will become increasingly important as power systems rely more heavily on renewable power and ramp thermal plants more intensively. [8][9][10][11]15,20,33,49 Switch 2.0 offers both linearized unit commitment and mixed-integer unit-commitment via the Commit subpackage and Commit.Discrete module. When using the Commit subpackage, users may also optionally provide affine or multi-segment heat rate curves, minimum up and down times, startup costs and other elements. Switch aggregates generators into generation "projects". These are stacks of one or more similar generating units in the same transmission zone, but not necessarily at the same site. Capacity can be added to each generation project in different years, and then portions of the available capacity are committed or dispatched as needed. This approach significantly reduces model complexity, which is essential for large capacity-expansion models. The new unit commitment code in Switch 2.0 also follows this approach. This is similar to the formulations by Stiphout et al. 33 and Palmintier and Webster. 15 Transmission Capacity expansion models for high-renewable power systems must consider the spatial distribution of resources and loads and the ability of the network to move power between them. 10,50 It is important to select a network formulation that is accurate but not so complex that it becomes computationally intractable.
Switch offers several approaches for representing network capabilities. The most basic strategy is to use a single-zone (copperplate) formulation, which ignores restrictions on spatial transfer of power. Alternatively, a transport model can be used to represent transmission capabilities in a simplified manner. 21,35,51 In a transport model, the study region is divided into zones which are internally well-connected but have constrained connections (flowgates) to neighboring zones. The size of each flowgate and the amount of power transfer are decision variables. Transport models are designed to approximate the capabilities of the network and the cost of improvements without modeling the electrical behavior of the network directly. They provide an attractive balance between granularity and tractability in expansion models, because they use only linear terms, even when network expansion is considered. Switch uses a copperplate model by default, or a transport model can be adopted by using the Transport subpackage of the Transmission subpackage.
Switch's architecture also allows use of other network models: an experimental module can provide securityconstrained AC power flow when running in productioncost mode, and future work will add "DC" power flow (a simplified version of AC power flow) when operating in capacity-expansion mode (similar to the formulation in 34 ).
The optional Local T&D module within the Transmission subpackage represents power transfers from the zonal node to customers, as well as distributed energy resources. This module enables a simplified consideration of the impact of distributed generation, efficiency or demand response on distribution network investments or losses.

Energy Sources
This subpackage defines fuel and non-fuel energy sources. Fuel costs can be either represented by a Simple flat cost per period or through a Markets module which supports supply curves and regional markets which may or may not be interconnected. These are important for power systems that may need to switch to new energy sources such as biofuels or LNG in order to meet strict targets for renewables or emissions

Policies
This subpackage defines investment and operational policies. Current modules include enforcing a Simple RPS (Renewable Portfolio Standard) and Carbon Policies, such as carbon taxes and caps. Investment or production cost credits can be modeled by adjusting fixed or variable costs.

Regional modules
In some cases users may want to include specific regulations and characteristics that are unique in their region, and that are not considered in the main Switch model. In these cases, specific sub-packages with new modules may be added to ensure that region-specific modules do not conflict with other regional or core modules. For example, the Hawaii sub-package contains both prototype and region-specific modules such as electric vehicles integration, specific dispatch rules for local cogeneration plants, a more complex RPS, and a hydrogen energy storage module, among others.

Testing
Switch uses an automated testing framework to support quality assurance and control as users develop code. The testing framework includes a mix of unit, integration, and regression tests. The testing framework scans all modules for embedded Python doctests, scans the testing directory for custom unittest modules, and executes all available examples to check for errors and changes in objective function values. This testing framework greatly simplifies and speeds up the process of debugging and quality control . In particular, it helps ensure that changes to the model formulation don't introduce bugs that break existing models.
Each of these modules is described in further detail in the Supporting Information, and source code may be inspected in the model repository.

Mathematical Formulation
This section provides an overview of the core equations used by Switch 2.0. The precise formulation is determined by the set of modules included in a given run.
For a complete formulation including all possible modules and components, please refer to the Supporting Information.
In our equations, decision variables (values chosen by the model) are typeset using roman capital letters, parameters (input data) use roman lower-case and sets use calligraphy capitals.

Objective Function
The objective function minimizes the net present value of all investment and operation costs: Function (1) sums over sets of fixed costs C fixed and variable costs C var . Each fixed cost component c f ∈ C fixed is a Pyomo object, indexed by investment period and specified in units of $/year. This object may be a variable, parameter or expression (calculation based on other components). The term c f p is the element with index p from component c f , i.e., a fixed cost that occurs during period p. Each variable cost component c v is indexed by timepoint (t) and specified in units of $/hour. Modules add components to the fixed and variable cost sets to represent each cost that they introduce. Hence, the exact equation will depend on which modules are selected by the user.
In most runs, fixed costs in C fixed include capital repayment for investments at a fixed financing rate over the lifetime of each asset, sunk costs from existing infrastructure, as well as fixed operating and maintenance (O&M) costs. Variable costs in C variable typically include fuel costs and variable O&M. The weight factor w year t scales costs from a sampled timepoint to an annualized value. The discount factor d p converts annualized costs from future periods to net present value.

Operational constraints
Power balance Power injections and withdrawals in each load zone in each timepoint must be balanced at all times. The power balance equation in (2) is expressed as an equality between two summations over dynamic sets of components that inject or withdraw power: P inject and P withdraw . As with the objective function, modules add Pyomo objects to P inject and P withdraw to show the amount of power injected or withdrawn by each system component during each timepoint. Consequently the exact equation will depend on which modules are included. Objects in P inject and P withdraw are each indexed by load zone and timepoint and specified in units of MW.
Typically, the list of injections P inject includes power output P g,t for every generation project g located in load zone z and inward transmission flows into that load zone, F in z ,t . The list of withdrawals P withdraw typically includes customer loads l z,t and outward transmission flows F out z ,t .

Dispatch
The core dispatch module defines fundamental components such as dispatched power P g,t and fuel consumption. It registers variable O&M with the objective function, but leaves it to other modules to model unit commitment and constrain fuel consumption to meaningful values.
The no commit module constrains dispatch based on installed capacity K G g,p (in MW) and an availability factor η g,t : For firm generators, η g,t is time invariant and reflects average outage rates. For intermittent generators, η g,t also reflects the renewable availability timeseries. No Commit constrains fuel requirements based on dispatch and the generator's full load heat rate.
As an alternative to No Commit, the Commit subpackage constrains dispatch P g,t based on committed capacity: ∀g ∈ G, ∀p ∈ P, ∀t ∈ T p (4) ∀g ∈ G, ∀t ∈ T (5) ∀g ∈ G, ∀t ∈ T Eq. (4) limits committed capacity W g,t to available capacity (possibly multiple identical units) as defined by (3). Eq. (5) limits dispatch P g,t based on the generator's minimum dispatch fraction d min g and committed capacity. Eq. (6) defines startup and shutdown statetracking variables (U g,t and V g,t ) as the change in committed capacity over time. Commit also registers onetime startup costs (fuel and O&M) per MW brought online. Ongoing fuel costs are determined by dispatch level and an optional piecewise linear incremental heat rate curve as described in Supporting Information. An optional Discrete unit commitment module constrains committed capacity W g,t to discrete values based on the generator's unit size.
Transmission power flows receive similar treatment. The Transport subpackage limits flows F ,t through a line based on available capacity K L ,p adjusted by the derating factor η L , as showed in Eq. (7). 0 ≤ F ,t ≤ η L K L ,p , ∀ ∈ L, p ∈ P, ∀t ∈ T p (7)

Minimum up and down times
Commit implements minimum up and down times rules by requiring that all capacity that was started up during a look-back window (equal to minimum up-time) is still on-line, and that capacity that was shutdown during the downtime look-back window remains uncommitted.
∀g ∈ G, ∀t ∈ T (8) whereτ g is the number of prior timepoints to consider.
To account for end-effects, Switch uses circular indexing for time series, so that t = −1 refers to the last timepoint in the same time series. This imposes a requirement that the system state at the end of each timeseries matches its starting state, which is equivalent to modeling each timeseries as an infinitely long sequence of identical series. This approach is best-suited for time series with a duration of a whole number of days.

Investment constraints
Power system construction K L ,p = p ∈P∪{p0}:p ≤p B L p ,k , ∀ ∈ L, ∀p ∈ P (12) Eqs. (10) and (12) define cumulative installed capacity for generation projects K G g,p and transmission lines K L ,p as of period p as the sum of previous capacity additions B G g,p and B L ,p , including existing infrastructure. For generation projects, the set P on g,p lists all periods when capacity of type g could have been built and still be in service in period p. Eqs. (11) and (13) fix the investment decisions of some generation projects and transmission lines over some periods P G g and P L with predetermined values specified in input files (e.g. existing, planned, or preordained capacity).

Maximum investment
Eq. (14) constrains cumulative capacity for resourceconstrained generators; generators where k G g is defined.

Case Studies Battery and Reserve Options in Oahu
In 2015, Hawaii adopted legislation requiring its electric utilities to reach 100% renewable power by 2045. Switch has taken a central role in planning to meet this target. Hawaiian Electric Company (HECO) used a proprietary model with a formulation based on Switch 1.x to develop its first Power Supply Improvement Plan (PSIP) 52 after the RPS was adopted, and stakeholders used Switch 2.0 to evaluate and critique this plan and offer alternatives. [53][54][55] Here, we use Switch 2.0 and the Hawaii datasets to study the potential benefits of obtaining operating reserves from several different types of battery and/or demand-side response. This is an important question for engineers and policymakers planning the transition to a 100% renewable power system, and can be addressed directly using the combination of long-term modeling, chronological daily modeling, unit commitment, operating reserves and storage offered in Switch 2.0.
This study relies on technology profiles and fuel and equipment price forecasts that HECO developed for the PSIP, 52 and uses renewable resource profiles that were developed for Switch 2.0 for the stakeholder review process (HECO also used these on an aggregated basis for the PSIP). The datasets used for this case study are available from ref. 56 In the PSIP, HECO profiled four types of lithiumion batteries: contingency-oriented batteries can make 10 deep cycles per year, but have no inter-hour loadshifting ability; regulation-oriented batteries can make up to 15,000 shallow cycles per year, but also have no inter-hour load-shifting ability; load-shifting batteries can provide 4 or 6 hours of energy storage and complete up to 365 cycles per year. The PSIP also reported that peak demand could be reduced up to 10% via demand response. However, HECO did not try to optimize the selection or configuration of these options.
In this case study, we use Switch 2.0 to answer several questions about these resources. (1) If load-shifting batteries could provide contingency reserves while charging or discharging, how much money would that save?
(2) If load-shifting batteries can provide regulating reserves while charging or discharging, how much would that save? (3) How much money could be saved per household by implementing demand response as a simple load-shifting service? (4) How much more could be saved if demand response also provided contingency and regulating reserves? Questions 1 and 2 arise from the observation that the optimized, high-renewable designs for Hawaii generally include large amounts of load-shifting batteries, which spend most of the day charging intensively and then discharge during non-daylight hours, typically at a slower rate than their peak power rating (which is sized for rapid charging at mid-day). Consequently, these batteries always have spare upward capacity -they can reduce charging during the day if solar production drops off, or they can increase output at night if a thermal plant trips offline. Further, this spare capacity could be used to provide reserves without imposing extra cycles on the batteries, since the reserve service would be provided by modulating the flow of power into or out of the battery, without changing the direction.
These comprise Switch's core formulation, plus components that force generators to be built in discrete sizes, define detailed unit-commitment behavior, model two-way flow for batteries, model regional fuel markets, and define spinning reserve requirements and provision. A command-line argument was also used to instruct the spinning_reserves_advanced module to use a Hawaiispecific rule for regulating-reserve requirements, based on the amount of wind and solar power installed. The formulation of these modules (and the Hawaii reserve rule) are detailed in the Supporting Information. We also used several modules from the hawaii subpackage, to define options for fuel-market expansion, demandresponse, electric-vehicle charging and operating rules for some individual generators. The complete model configuration and all data used for this case study are available from ref. 56 For this case study, we used Switch's scenario-solving system to define five scenarios: (1) "battery bulk": loadshifting batteries only provide bulk inter-hour loadshifting, not reserves; there is no demand response (DR), and electric vehicles (EVs) charge at businessas-usual times; (2) "battery bulk and conting": same as "battery bulk", but load-shifting batteries can also provide contingency reserves; (3) "battery bulk and reg": same as "battery bulk and conting", but load-shifting batteries can also provide regulating reserves; (4) "DR bulk": same as "battery bulk and reg" plus DR can provide bulk load-shifting (i.e., the model can move up to 10% of demand from each hour to any other hour, provided it doesn't raise demand by more than 80% in any hour), and EVs charge at optimal times each day; no reserves from DR or EVs; (5) "DR bulk and reg": same as "DR bulk", but DR and EVs can also provide up and down contingency and regulation reserves equal to the difference between the amount of load scheduled each hour and the minimum and maximum allowed loads.
These scenarios draw on three different input datasets, in which load shifting batteries were configured to be able to provide contingency and/or regulating reserves as noted above. Command-line arguments specify whether the DR and EV modules should provide load-shifting and/or reserves.
We then used Switch to select the optimal investment plan for each of the five scenarios, with investment decisions made every five years from 2020 through 2045. For these scenarios, we considered 12 sample days during each period, using weather from the 23rd day of each month in 2008 (these dates were chosen because they had mean values for load, wind and solar production that were close to the two-year mean for 2007-2008, and also exhibited a typical range of variation in these values). Costs are scaled as if each sample day were repeated 152 times, filling out the five-year period. Figure 2 shows the optimal generation and storage portfolios selected in the five scenarios. Table ?? shows the levelized cost per kWh of power delivered over the 2020-2049 period, as well as the discounted total cost of power, per customer, during this period. It also shows the savings per customer in each scenario, relative to the "Battery bulk" baseline. From these outputs, we can draw several useful conclusions: (1) Obtaining contingency reserves from load-shifting batteries is not likely to provide large savings (only about $225 per customer); this is because contingency batteries make up only a small share of the system's assets, and are relatively inexpensive per MW of capacity.
(2) Obtaining regulating reserves from load-shifting batteries appears to be a financially attractive option (additional $615 savings per customer). These savings occur because this control strategy eliminates the need to build large amounts of expensive, dedicated batteries for regulation (see Figure 2).
(3) Inter-hour load shifting via demand response (e.g., in response to real-time pricing) could also provide significant benefits. In this case study, it saved an additional $1,850 per customer on an NPV basis. It is likely to be inexpensive to tap into this resource (around $200/customer for smart meters, and possibly around $10-$100 per appliance for smart controllers), so it will probably be cost-effective to deploy this capability. Note that in this scenario, some dedicated regulating batteries are needed in the early years, because demand response replaces load-shifting batteries that would otherwise provide regulating reserves.
(4) Providing regulation and contingency reserves from demand response saves only a modest amount of money -an additional $159 per customer (NPV). The savings come mainly from a small reduction in the need for regulating batteries. This effect is weak because the times when reserves are scarce are also times when energy is scarce, so flexible demand is not scheduled during those hours, and is therefore unable to provide "up" reserves by offering to decrease load further. Consequently, it may not be cost-effective to tap into the demand side to provide operating reserves, unless this service is easy to "piggyback" on the price-based response.

Other Current Applications
Switch 2.0 has been designed as a flexible tool to answer a wide range of urgent policy questions. Several projects are already underway using beta versions of Switch 2.0, and advances from those projects have been incorporated into the Switch 2.0 codebase. We note some of these efforts here, as examples of questions that can be addressed with Switch.

Renewable Expansion in Chile
Switch 2.0 is being used to investigate optimal expansion of renewables in Chile's relatively high-hydro power system. The study includes 5 four-year periods, from 2020 to 2039, each with 4 representative days with hourly resolution. The system is represented by 20 load zones, 23 transmission corridors, and 107 generation projects. Hydroelectric networks and cascading hydro are fully represented and multiple water inflow scenarios are included through a stochastic optimization extension.

Demand Response
Work is underway to assess the effect of improved timing of electric vehicle (EV) charging on the design and operation of high-renewable power systems. 57 As part of this effort, Switch 2.0's production-cost capability was benchmarked against the industry-standard GE MAPS model and found to agree closely for 18 renewable adoption scenarios in Oahu and Maui. 58 To support the EV analysis, an advanced demand-response module has also been added to Switch, which allows integration of complex and non-linear demand systems. That module has also been used for novel research on the welfare benefits of using real-time pricing to tap into demand-side flexibility in a high-renewable power system. 59,60 Acknowledgement The authors thank researchers who have used prior versions of Switch, whose discussions, collaborations and support have inspired continued work on this platform. Portions of the work reported here were funded by grants from the US Department of Transportations University Transportation Centers Program, Research and Innovative Technology Administration (PO#291166), the National Science Foundation (#1310634), and the Ulupono Initiative.

Supporting Information Available
The following files are available free of charge.
• Supporting Information.pdf: supporting information for this paper, including the complete formulation of all standard modules of Switch 2.0, a discussion of requirements for capacity expansion models for high-renewable power sys-tems, and instructions for installing and running Switch 2.0.