Aude Pommeret
email: aude.pommeret@univ-smb.fr

Katheline Schubert

Ias Mier

Fabien Prieur

Optimal energy transition with variable and intermittent renewable electricity generation

Keywords: Energy transition, regime switching, uncertainty. JEL codes: Q43, Q54, C61, Q42

We propose one of the first dynamic models of the optimal transition from fossil fuels to renewables in electricity generation that takes into account the variability and intermittency of renewable energy sources as well as storage. We take as an example solar energy, which is variable (no sun at night) and intermittent (few or no sun at day when there are clouds). We show that when the clouds phenomenon is not too severe, intermittency can be safely ignored and the planner just needs to take into account the deterministic variability of the renewable source. In this case, the optimal transition consists in using fossil fuels at day and night and complement them by solar electricity at day while investing to build up solar capacity; then abandoning fossils at day and keeping them for night electricity generation only; then, when solar capacity is large enough, starting to store electricity; and finally abandoning totally fossils when the carbon budget is exhausted. However, if the cloud problem is severe, intermittency matters a lot and precaution requires to start storage earlier, before fossils have been abandoned at day. We show that renewable electricity generation and storage are complement: absent storage devices, the long run solar capacity is smaller, and so is electricity consumption. We finally provide a quantitative illustration for the case of the Spanish energy transition. We show that in Spain intermittency can be safely ignored. We compute the carbon value corresponding to a 2 • C carbon budget, the dates at which storage starts, and the path of investment in solar capacity.

Introduction

The production of electricity has to be decarbonized in the near future (see IPCC, 2018), and producing energy by renewable sources seems to be the best option to do so,1 before nuclear fusion becomes eventually available. The production of electricity by renewable sources has grown rapidly in recent years. At the end of 2020, the estimated renewable energy share in global electricity production is 27%, of which 15.6% is hydropower, 5.8% wind power, and 3% solar PV (IEA, 2020a). However, hydropower has limited expansion possibilities, and the combined shares of solar and wind power is still very small. It is a long way to the total elimination of the 73% share of non-renewable electricity that is left. In the short/medium term, renewables cannot be deployed at a large scale to replace coal and other fossil fuels in electricity generation. Indeed, on the one hand they are still more costly on average than fossil fuels, and, on the other hand, they are non-dispatchable and are not continuously available.

Contrary to what was the dominant view a few years ago, the cost is not the main obstacle to a larger penetration of renewable sources in the electric mix. The investment cost for wind and solar plants has already been widely reduced, due to technical progress and learning effects in production and installation, and the decrease is expected to continue, until a limit lower bound is reached. For instance, according to the International Energy Agency in its 2020 World Energy Outlook, "With sharp cost reductions over the past decade, solar PV is consistently cheaper than new coal-or gas-fired power plants in most countries, and solar projects now offer some of the lowest cost of electricity ever seen" (IEA, 2020b).

The serious problem is posed by the fact that wind and solar energy are not continuously available: they are both variable and intermittent. We define variability as being predictable: it follows a natural pattern such as the alternation of day and night, or of seasons. We consider intermittency as being stochastic, due to unpredictable weather events like cloud formation. [START_REF] Sinn | Buffering volatility: A study on the limits of Germany's energy revolution[END_REF], discussing the German energy transition, stresses that in Germany in 2014 the installed wind power production capacity was 35.92 GW and the average production 5.85 GW, that is 16.3% of the capacity; for solar the corresponding figures are 37.34 GW of capacity, and a production of 3.7 GW, that is 9.9% of the capacity. Without solutions to handle variability and intermittency, renewable sources cannot be considered as good substitutes for conventional fossil sources [START_REF] Joskow | Comparing the costs of intermittent and dispatchable generating technologies[END_REF], Laskano et al., 2017). However, at the moment, issues posed by variability and intermittency are not satisfactorily solved. Practical solutions are the backup of renewables by fossil fuel-fired power plants (the German double structure strategy, see [START_REF] Sinn | Buffering volatility: A study on the limits of Germany's energy revolution[END_REF], the diversification of sources associated to a dense transmission network, storage-from the classic hydro-pumped storage to new solutions like modern batteries, compressed air storage, flywheels etc., and demand side management. [START_REF] Heal | Notes on the Economics of Energy Storage[END_REF] offers an overview of these solutions and possible lines of modelling.

There is a long tradition of macro-dynamic partial equilibrium models à la Hotelling considering renewable energy as a "backstop technology". It consists in an abundant and steady flow available with certainty, at a unit cost higher than the unit extraction cost of fossil energy. Early path-breaking papers in this tradition are [START_REF] Hoel | Depletion of Fossil Fuels and the Impacts of Global Warming[END_REF], [START_REF] Tahvonen | Fossil fuels, stock externalities, and backstop technology[END_REF], and [START_REF] Chakravorty | A Hotelling Model with a Ceiling on the Stock of Pollution[END_REF] within the carbon budget approach. In the simplest version of this representation of the energy transition, the price of the fossil fuel, sum of the unit extraction cost and the scarcity rent, rises over time by a Hotelling effect, and the switch to the clean renewable energy occurs when this price reaches the cost of the backstop. Useful as it may have been, this representation is not accurate for the actual energy transition problem.

First, this standard representation overlooks the fact that the relevant cost to be taken into account as far as renewables are concerned is the cost of the investment in capacity rather than the variable operating cost, which is very low. Seminal papers introducing investment in capacity and adjustment costs are [START_REF] Tsur | On the Dynamics of Competing Energy Sources[END_REF] and [START_REF] Amigues | Equilibrium Transitions from Non-renewable Energy to Renewable Energy under Capacity Constraints[END_REF]. [START_REF] Coulomb | Optimal transition from Coal to Gas and Renewable Power under Capacity Constraints and Adjustment Costs[END_REF] also study the energy transition with capacity constraints and adjustment costs. Second, the standard Hotelling-like literature ignores the variable and intermittent nature of renewable sources, which is the main obstacle to their penetration in the electric mix. An exception is [START_REF] Helm | Subsidizing Renewables but Taxing Storage? Second-Best Policies with Imperfect Carbon Pricing[END_REF], who build a dynamic model with a fossil fuel, a variable renewable source and a storage technology. Their aim is to study the optimal subsidies for the renewables and the storage capacity when a carbon tax cannot be put in place. However, they do not account for intermittency.

Another strand of literature is composed of static partial equilibrium models that are not directly interested in energy transition, but focus on the design of the electric mix when intermittency is taken into account, with or without storage devices. Ambec andCrampes (2012, 2019) and [START_REF] Helm | On the Efficient Market Diffusion of Intermittent Renewable Energies[END_REF] are representative of this literature. They study in a static framework the optimal electric mix with intermittent renewable sources, and contrast it with the mix chosen by agents in a decentralized economy where the retailing price of electricity does not vary with its availability. They examine the properties of different public policies and their impacts on renewable penetration in the electric mix: carbon tax, feed-in tariffs, renewable portfolio standards, demand-side management policies.

The survey on the economics of solar electricity by [START_REF] Baker | The Economics of Solar Electricity[END_REF] emphasizes the lack of economic analysis of clean energy provision through renewable sources. We intend to contribute to fill this lack by putting together the two strands of the literature mentioned above, in order to make macro-dynamic models more relevant for the study of the energy transition. Indeed we believe that the energy transition is by essence a dynamic problem, which cannot be fully understood through static models. On the other hand, dynamic models are so far unable to take into account properly variability and intermittency, with the need for storage they create. Our aim is to propose a simple and tractable dynamic model incorporating these features, to be able to study the extent to which they actually constitute a serious obstacle to energy transition.

In a first step we tackle the variability issue alone. We build a stylized deterministic dynamic model of the optimal choice of the electric mix (fossil and renewable), where the fossil energy, let us say coal for the purpose of illustration, is abundant but CO 2 -emitting, and the renewable energy, let us say solar, is variable and clean. The originality of the model is that electricity produced when the renewable source of energy is available, and electricity produced when it is not, are considered two different goods: day-electricity and nightelectricity in the case of solar energy that we use for illustration. Considering that there are two different goods allows us to take into account intra-day variability. These two goods are produced by potentially different technologies: day-electricity can be produced with coal and/or solar, whereas night-electricity can be produced with coal, or by the release of day-electricity that has been stored to that effect. Storage is costly due to the loss of energy during the restoration process. The two goods are also potentially valued differently by consumers, who, at each period of time, derive utility from the consumption of these two goods: consumers may prefer to consume electricity at day, in which case solar is at peak, or at night, in which case solar is off-peak.

We show that with a low initial solar capacity it is optimal to first use fossil fuels during night and day, then use fossil fuels during night only and finally go for no fossil fuels at all, when the carbon budget is exhausted. Investment in solar panels is not necessarily monotonous. Storage only starts when fossil fuels have been abandoned at day and the solar capacity is large enough. In the long run, we obtain that off-peak sun -a situation known as the Californian duck2 -requires larger storage capacities. Finally we show in the case of the Spanish transition that a more stringent climate policy or technological improvements (more efficient solar panels or storage) speed up the transition but have no permanent effect. Moreover, a decrease in the investment cost leads to higher long run solar capacity and day and night-electricity consumptions, at lower prices.

In a second step, we introduce intermittency in addition to variability, and study the design of the power system enabling to accommodate it. With intermittency, day-electricity generation by solar power plants becomes uncertain. We consider that there is only partial generation if solar radiations are too weak due for instance to the cloud system, which occurs with a given probability.

We exhibit two very different situations. If the cloud problem is not too severe, we show that intermittency does not matter so much, rejoining the empirical result of [START_REF] Gowrisankaran | Intermittency and the Value of Renewable Energy[END_REF]. The energy transition follows the same succession of phases as under variability only. On the contrary, if there may be very few sun during the day, the transition is very different as fossil fuels are abandoned later while storage starts earlier. We show that renewable electricity generation and storage are complement: absent storage devices, the long run renewable capacity is smaller, and so is electricity consumption. We obtain quantitatively that during the transition, intermittency requires to maintain less thermal capacities, though for a longer time. In addition, once the electricity sector is decarbonized, intermittency requires a larger capacity of solar electricity-generating equipment, that is, in some sense, overcapacity.

The structure of the paper is the following. Section 2 sets up the framework, solves the model and studies the sensitivity of the solution to the main parameters in the case where variability only is taken into account. In Section 3, we introduce intermittency, examine under what circumstances it qualitatively changes the previous solution, and wonder whether in the presence of intermittency renewable capacity and storage are substitute or complements. In Section 4 we calibrate the model to the Spanish case and perform a quantitative analysis of the sensitivity of the optimal Spanish energy transition to key parameters. Section 5 concludes.

Optimal energy transition with a variable renewable source

Electricity may be produced with fossil-fired power plants and with renewable sources, and the climate constraint imposes to make the transition from the first to the second. In this context, as explained above, the originality of our model is that it allows to handle in a very simple way the variability of renewables. To do so, we exploit the fact that the concept of variability supposes the existence of a predictable pattern. Solar energy is the most convincing example, and we will use it throughout the paper. It can be harnessed at day but not at night, and this is clearly predictable: we have a pattern here.3 Then, we treat day and night-electricity as two different goods. They are different because they are not produced with the same technology as day-electricity may be produced using fossil and solar whereas night-electricity cannot be produced by solar, and also because the consumer may value them differently, since they are not available at the same time.

Electricity of solar origin is supposed to be abundant and carbon-free. Its production is constrained by the installed capacity, which is assumed to be initially small. Costly investment allows to increase solar capacity. There are no variable production costs. Fossil sources, let us say coal, are supposed to be abundant as well4 but they are carbon-emitting: the issue with coal extraction and consumption is not scarcity but climate change. To focus on the variability issue, we neglect extraction costs and suppose that a large fossil capacity exists at the beginning of the planning horizon, so there is no need of investing to build new fossil-fired power plants. Climate policy takes the form of a carbon budget that society decides not to exceed, to have a good chance to maintain the temperature increase at an acceptable level -typically 2 • C. This carbon budget is consumed when coal is burned. At day, when solar is available, coal and solar are perfect substitutes in electricity generation.

Finally, there exists a storage technology that allows to store imperfectly electricity from day to night at no monetary cost but with a physical loss. 5 The way we model storage is clearly specific. We only consider short-term storage, like batteries. Such a focus may be justified by the current development of batteries to store electricity, as it is getting more cost-efficient (see Comello and Reichelstein, 2019). In the Sustainable Development Scenario of the International Energy Agency, utility-scale storage capacity worldwide increases from 173 GW in 2019 to 2,100 GW in 2070, most of which is provided by batteries with an average discharge duration of five hours (IEA 2020c). 6 Overall, it allows avoiding an additional state variable that would make it possible to store over many days but at the cost of analytical untractability.

Our objective is to determine the optimal electricity mix during the energy transition, the path of investment in renewable capacity, and the optimal storage policy.

Optimality problem

The social planner seeks to maximize the discounted sum of the net surplus of the economy. Instantaneous net surplus is the difference between the utility of consuming day and nightelectricity and the cost of the investment in solar capacity. Day-electricity can be produced by coal-fired power plants and/or solar plants. A fraction of the electricity of solar origin can be stored to be released at night, with a loss. 7 Therefore, night-electricity can be either fossil or produced by the release of solar electricity stored during the day.

The social planner's programme reads: max Y is solar capacity. ζY is the corresponding production during the considered timeframe, absent clouds. 8 φ < 1 measures the efficiency of solar electricity generation, accounting for clouds. Hence φζY is the actual production obtained during the day from an installed capacity Y . 9 I is the investment in solar capacity. C(I) is the investment cost function, increasing and strictly convex to reflect adjustment costs. a ∈ [0, 1] is the share of solar electricity produced at day that is stored to be released at night. The efficiency of the storage technology is represented by the parameter k ∈ [0, 1]. Conversely, 1 -k is the leakage rate of this technology. ρ is the discount rate, strictly positive.

x d ,xn,a,I ∞ 0 e -ρt [u (e d (t), e n (t)) -C(I(t))] dt (1) e d (t) = x d (t) + (1 -a(t))φζY (t) e n (t) = x n (t) + ka(t)φζY (t) Ẋ(t) = x d (t) + x n (t) Ẏ (t) = I(t) 0 ≤ a(t) ≤ 1 X(t) ≤ X x d (t) ≥ 0, x n (t) ≥ 0 X 0 ≥ 0, Y 0 ≥
8 Do note that we assume that solar equipment is used at full capacity when there is sun. Alternatively, solar electricity production could be explicitly constrained by the capacity ζY (t). The programme would then include an additional first order condition stating that at the optimum the opportunity cost of the capacity constraint must equal the marginal benefit from solar energy consumption. As this is the main insight it conveys, we abstract from such a presentation in order to save on notations.

9 The analytical part of the paper does not require to distinguish between the two parameters ζ and φ. We keep them both for calibration purposes in the numerical part.

The current value Hamiltonian associated to the social planner's programme (1) reads, dropping the time index:

H = u x d + (1 -a)φζY, x n + kaφζY -C(I) -λ (x d + x n ) + µI
where λ is the shadow price of carbon, that is the carbon value, and µ is the shadow price of the solar capacity. Introducing Lagrange multipliers for the different inequality constraints allows us to write the Lagrange function as:

L = H + ω a a + ω a (1 -a) + ω d x d + ω n x n + ω X X -X with obvious notations.
The first order optimality conditions are:

u d (e d ) = λ -ω d (2) u n (e n ) = λ -ω n (3) φζY (u d (e d ) -ku n (e n )) = ω a -ω a (4)
C (I) = µ (5) λ -ρλ = -ω X (6) μ -ρµ = -φζ ((1 -a)u d (e d ) + kau n (e n )) (7)
The complementarity slackness conditions read:

ω a a = 0, ω a ≥ 0, a ≥ 0 ω a (1 -a) = 0, ω a ≥ 0, 1 -a ≥ 0 ω d x d = 0, ω d ≥ 0, x d ≥ 0 ω n x n = 0, ω n ≥ 0, x n ≥ 0 ω X X -X = 0, ω X ≥ 0, X -X ≥ 0
and the transversality conditions are:

lim t→∞ λ(t)X(t) = 0, lim t→∞ µ(t)Y (t) = 0
Our problem is an optimal control problem with control and state constraints. It satisfies Assumption 2 in [START_REF] Boucekkine | Optimal Regime Switching and Threshold Effects[END_REF]. Indeed, the objective function and the constraints functions are continuously differentiable and are concave functions of the control variables, and it is easy to show that the maximized Hamiltonian of each sub-problem is concave in the states X and Y , for any dates of the switch between the different sub-problems (before or after the ceiling is reached, with or without solar generation at night, with or without storage). This warrants that the [START_REF] Arrow | Public Investment, the Rate of Return, and Optimal Fiscal Policy[END_REF] conditions are met, and the sufficiency of the first order conditions.

Optimal path

We now describe the optimal energy transition path, identifying how much fossil should be burnt and when, how much solar capacity should be built and according to what timing, and what the optimal storage policy is. Proposition 1 summarizes the results.

Proposition 1 In the case where only variability of renewable energy is taken into account and the initial solar capacity is low, the optimal solution consists of four phases:

(1) Production of day and night-electricity with fossil fuel-fired power plants complemented at day by solar plants, no storage, investment in solar panels to increase solar capacity. Consumptions decrease whereas the electricity price, the same at day and night, increases over time, following the Hotelling rule.

(2) Production of day-electricity with solar plants only, use of fossil fuel-fired power plants at night while proceeding with the building up of solar capacity, no storage. Day and nightelectricity consumptions and prices are decoupled: night-electricity consumption decreases and its price increases over time, while the reverse applies for day-electricity.

(3) Production of day-electricity with solar plants only, use of fossil fuel-fired power plants at night while proceeding with the building up of solar capacity, progressive increase of storage.

Consumptions decrease over time. The price at day is only a fraction of the price at night. Both increase, following the Hotelling rule.

(4) Production of day and night-electricity with solar plants only, storage of electricity at day to be released at night, and investment in solar panels to increase capacity, up to a steady state. Electricity consumptions and prices only depend on the installed solar capacity, and prices decrease.This last phase begins when the carbon budget is exhausted.

Remember that we have supposed that the initial solar capacity is low, which is the most relevant assumption from an empirical point of view. A small enough initial solar capacity ensures that demand cannot be satisfied by solar electricity alone and therefore fossil fuel is used night and day at the beginning of the planning horizon. This allows us to avoid the multiplication of different cases that do not bring much to our purpose.

Eq. ( 5), together with Ẏ = I, yields:

Ẏ (t) = I(t) = C -1 (µ(t)) (8)
According to the properties of the investment cost function (C is strictly increasing), this equation shows that investment in solar panels, that is the accumulation of solar capacity, is an increasing function of the shadow price of solar capacity.

Before the exhaustion of the carbon budget, X < X and ω X = 0. Then FOC (6) reads λ/λ = ρ, i.e.:

λ(t) = λ(0)e ρt (9)
The carbon value follows a Hotelling rule as long as fossil fuel is used.

The other optimality conditions allow us to analyze the different successive phases characterizing the energy transition.

Phase (1)

The first phase is a phase where fossil fuel is used night and day. Then, 3), ( 4) and ( 7) may be written as:

ω d = ω n = 0. FOC (2), (
u d (e d ) = λ (10) u n (e n ) = λ (11) Y (1 -k)λ = ω a -ω a (12) μ -ρµ = -((1 -a) + ka) φζλ (13)
The marginal utilities of consumption of day and night-electricity are the same in this phase, and equal to the carbon value. It implies that e d = u -1 d (λ) and e n = u -1 n (λ). We will say that sun is "at peak" if u -1 d (λ) > u -1 n (λ), meaning that for a given price λ demand is higher at day, when sun shines, than at night, when it does not. Sun will be "off-peak" in the opposite case. Whether sun is at peak or off-peak will prove (see Figure 1) to have important consequences on the design of the transition to solar energy.

In this phase, day and night-electricity consumptions and prices are only driven by the carbon value, that is by climate policy. The reason is that we have assumed away variable costs, of extraction for coal, of production for solar, so that the only variable cost that remains is the social cost of carbon. Consumptions decrease whereas the electricity price, the same at day and night and equal to the carbon value, increases over time, following the Hotelling rule. As long as the carbon value is not too high it is optimal to use fossil for night and day electricity production and not to store solar electricity from day to night, as it implies a loss, due to the less than one round-trip efficiency of batteries. 10 Since solar capacity increases and there is no storage, fossil energy uses at day and night decrease, with the former falling faster than the latter, which allows saving some fossil resources for the night.

This phase ends at the date T when the use of fossil for day-electricity production stops:

x d (T ) = 0. Indeed, as there is no storage, x n = 0 is impossible: according to the properties of the utility function, it would require λ → +∞. Therefore this first phase is followed by a second phase where fossil fuel has been dropped for the production of day-electricity, and is only used in the production of night-electricity.

Phase (2)

For storage to start, the wedge between the price at night and the price at day must be sufficient to cover the storage loss i.e. ku n ≥ u d must be satisfied (see equation ( 4)). Phase (2) starts with u n = u d , implying that storage is not immediately optimal. Hence it is a phase where solar capacity supplies the whole demand at day and there is no storage. FOC (2), ( 3), ( 4) and ( 7) may be written as:

u d (φζY ) ≤ λ (14) u n (x n ) = λ (15) u d (φζY ) ≥ kλ (16) μ -ρµ = -φζu d (φζY ) (17)
Eqs. ( 8) and ( 17) yield a saddle-path dynamic system in (µ, Y ). At the steady state of the system, the shadow price of solar capacity and solar capacity itself are:

µ * = C (0), Y * * = 1 φζ u -1 d ρµ * φζ (18)
In the presence of storage possibilities, this steady state where fossil fuel use is strictly positive at night will never be reached because of the carbon budget constraint, which imposes that this phase comes to an end in finite time.11

In this phase night-electricity consumption is still driven by the carbon value only, and its price increases, but during daytime, electricity consumption, of solar origin, only depends on the installed solar capacity. Then day-electricity consumption increases with the accumulation of solar capacity and its price decreases. Day and night-electricity consumptions and prices are decoupled. The wedge between the price at day and the price at night increases, such that ku n ≥ u d is eventually satisfied, triggering phase (3) where storage takes place (see equation ( 4)).

According to Eqs. ( 14) and ( 16), we must have kλ ≤ u d (φζY ) ≤ λ, which gives the boundaries of this phase. It begins at date T characterized by:

u -1 d (λ(T )) = φζY (T ) (19)
and ends at date T i defined by:

u -1 d (kλ(T i )) = φζY (T i ) (20)
As the demand function u -1 d is decreasing, Eqs. ( 19) and ( 20) show that as soon as storage implies a loss (k < 1) T i > T : this phase is not reduced to a single date. If on the contrary k = 1, this phase does not exist.

Phase (3)

In this phase, solar is used at day, fossil fuel at night, and storage is introduced (0 < a < 1). FOC ( 2), ( 3), ( 4) and ( 7) now read:

u d ((1 -a)φζY ) ≤ λ (21) u n (x n + kaφζY ) = λ (22) u d ((1 -a)φζY ) = kλ (23) μ -ρµ = -kφζλ (24)
Eq. ( 23) yields:

a(t) = 1 - 1 φζY (t) u -1 d (kλ(t)) (25)
As λ and Y are increasing during this phase, a is increasing as well, from a(T i ) = 0 to a(T ) > 0, where T denotes the date at which this phase ends.

Eqs. ( 22) and ( 23) yield:

x n (t) = u -1 n (λ(t)) + ku -1 d (kλ(t)) -kφζY (t) (26)
This phase ends when fossil use stops and the carbon budget is exhausted:

x n (T ) = 0and X(T ) = X.
Thus date T is defined by:

u -1 d (kλ(T )) + 1 k u -1 n (λ(T )) = φζY (T ) (27)
and the total quantity of fossil fuel burned from the origin to date T is equal to the carbon budget:

T 0 (x n (t) + x d (t))dt + T i T x n (t)dt + T T i x n (t)dt = X (28)
A comparison of Eqs. ( 20) and ( 27) confirms that T > T i .12

In this phase, storage creates a link between day and night-electricity consumptions, which are not decoupled anymore. Due to storage, it is again only the climate constraint that determines electricity consumption and price at each period. The price at day is only a fraction k of the price at night, hence the more efficient the storage technology the closer the two prices. Both increase, following the Hotelling rule.

Phase (4)

The last phase, starting at date T , is a clean phase where no fossil fuel is used: the energy transition is achieved. FOC ( 2), ( 3), ( 4) and ( 7) now read:

u d ((1 -a)φζY ) ≤ λ (29) u n (kaφζY ) ≤ λ (30) u d ((1 -a)φζY ) = ku n (kaφζY ) (31) μ -ρµ = -kφζu d ((1 -a)φζY ) (32)
Eq. ( 31) implicitly gives the storage rate a(t) as a function of solar capacity Y (t). The solution exists and is unique as soon as the marginal utilities tend to infinity when consumption tends to zero.13 Then, Eqs. ( 8) and ( 32) yield a saddle-path dynamic system in (µ, Y ). At the steady state, the shadow price of solar capacity and solar capacity itself are defined by:

µ * = C (0), (1 -a(Y * ))Y * = 1 φζ u -1 d ρµ * kφζ (33)
In this phase, when electricity production is totally carbon-free, electricity consumptions and prices only depend on installed solar capacity, and quantities increase while prices decrease.

The global dynamics of the model is explained and a global phase diagram is provided in Appendix A. Figure 1 shows the electricity consumption and price paths in the case where sun is at peak, that is where the preference for day-electricity is higher than the preference for night-electricity. Day-electricity consumption is W-shaped, and its price inverted W-shaped, whereas night-electricity consumption is V-shaped, while its price follows the opposite pattern.

The lessons to be drawn from the model are the following. First, when the initial solar

p d (t
T T i T p * d p * n p d (t) p n (t)
Figure 1: Day and night consumptions and prices, sun at peak capacity is low, it is always optimal to begin installing solar panels immediately and to use them to complement fossil energy at daytime. Second, there is simultaneous use of fossil fuel and renewable energy from the beginning of the planning horizon.14 Third, it is never optimal to begin storage immediately. Storage would allow saving fossil energy at night, but at the expense of more fossil at day to compensate for the solar electricity stored; it would also cause a physical loss of electricity. Even if the storage technology is available, as it is the case in the model, storage must only begin after fossil has been abandoned at day because the installed solar capacity has become high enough and solar energy accounts for a significant fraction of electricity generation. Then, storing electricity becomes optimal, and storage increases to accompany the penetration of solar in the electric mix. Notice that this timing implies that there is fossil overcapacity during daytime, in the sense that fossil-fuel power plants are maintained for night use only.

Investment dynamics

The shape of the investment in solar panels over time deserves a closer look. In particular we wonder whether it is necessarily monotonous, as two forces are at play, discounting, that makes the society willing to postpone the effort, and adjustment costs, that makes it willing to smooth the effort over time.

Proposition 2 Investment in solar panels may be always decreasing, or may exhibit a bell shape in the first phase and be decreasing thereafter. The increasing part of the bell shape is all the longer since the initial solar capacity is small, the carbon budget is large, the solar energy conversion is poor and the discount rate is high.

According to Eq. ( 8) investment is only determined, besides the parameters of the cost function, by the shadow value of solar capacity, and İ(t) has the same sign as μ(t). Looking at the shape of the investment path thus amounts to looking at the evolution of the shadow price of solar capacity.

In phase (1), as there is no storage, Eq. ( 13) simplifies into:

μ -ρµ = -φζλ (34)
which can be integrated into:

µ(t) = e ρt µ(0) -φζλ(0)t Then μ(t) = e ρt ρµ(0) -φζλ(0)(1 + ρt)
implying that μ(t) is strictly positive if and only if t < T I , defined by:

T I = µ(0) φζλ(0) - 1 ρ (35)
Therefore in the first phase investment in solar panels increases during a time interval all the longer since the initial shadow value of solar capacity µ(0) is high, reflecting a small initial capacity and/or small adjustment costs, the initial carbon value λ(0) is small, reflecting a lenient climate constraint, solar energy conversion φζ is poor and the discount rate ρ is high, reflecting an impatient society. T I may be negative, in which case investment in solar capacity decreases in the first phase. At the opposite, it could in principle be possible that T I is higher than the date T at which the first phase comes to an end. We show below that this cannot be the case. Hence investment in solar capacity either decreases or is bell-shaped during the first phase.

As solar capacity cannot decrease, we necessarily have in phase (2) Y (T ) < Y * * . Therefore, along the saddle path, investment in solar panels and the shadow price of solar capacity are decreasing, while solar capacity is increasing (see Figure 3 in Appendix A).

According to Eq. ( 17), we have in phase (2) μ(t) = ρµ(t) -φζu d (φζY (t)). At the date of the switch between phases (1) and (2) µ, λ and Y are continuous, and Eq. ( 19) shows that λ(T ) = u d (φζY (T )). Therefore μ is continuous at T . As in phase (2) the shadow price of solar capacity µ is strictly decreasing over time and so is investment, we conclude that investment is decreasing in phase (1) when t approaches T . Therefore T I > T is not possible.

In phase (3), integrating Eq. ( 24) yields as in phase (1):

µ(t) = e ρ(t-T i ) µ(T i ) -kφζλ(T i )(t -T i ) Then μ(t) = e ρ(t-T i ) ρµ(T i ) + ρkφζλ(T i )T i -kφζλ(T i )(1 + ρt)
implying that μ(t) is strictly positive if and only if t < T I , with:

T I = T i + µ(T i ) kφζλ(T i ) - 1 ρ (36) If T I < T i investment in solar panels is decreasing; it is bell-shaped if T i < T I < T , and increasing if T < T I .
With the same continuity argument as for T I , it is possible to show that the only possible case is the first one. Investment in solar panels is decreasing during this phase.

Along the saddle path in phase (4), investment in solar panels and the shadow price of solar capacity are decreasing, while solar capacity is increasing (the argument is the same as in phase (2)).

More results with isoelastic utility and quadratic investment cost

To go further in the characterization of the optimal solution, we proceed by specifying the utility and investment cost functions. These specifications will be used in the remainder of the paper.

For the instantaneous utility function, day and night-electricity consumption are in a first step aggregated with a CES function. Then, in a second step, the utility derived from this consumption bundle is supposed to be isoelastic. Finally, we make the assumption that the intertemporal elasticity of substitution of consumption and the elasticity of substitution between day and night-electricity are the same, and we denote this elasticity σ. Under these assumptions, the instantaneous utility reads:

u(e d , e n ) = A 1 -1 σ αe 1-1 σ d + (1 -α)e 1-1 σ n , 0 < α < 1, σ > 0, σ = 1 (37) or u(e d , e n ) = A (α ln e d + (1 -α) ln e n ) , 0 < α < 1 ( 38
)
where A is a scale parameter.

The investment cost function is classically supposed to be quadratic:

C(I) = c 1 I + c 2 2 I 2 , c 1 , c 2 > 0 (39)
We are then able to obtain explicitly from Eqs. ( 23) and ( 31) the storage rate in phases ( 3) and (4):

Phase (3) a(t) = 1 - Aα kλ(t) σ 1 φζY (t) (40)
Phase ( 4)

a(t) = a * = a(T ) = (1 -α) σ k 1-σ α σ + (1 -α) σ (41)
The storage rate increases in phase (3), from 0 to its maximal value a * . It is constant in phase ( 4) at the level a * .

Eq. ( 8) reads:

Ẏ (t) = 1 c 2 (µ(t) -c 1 ) (42)
and the evolution of the shadow value of solar panels in the four phases is (see Eqs. ( 34), ( 17), ( 24), ( 32) and ( 49)):

Phase (1) μ(t) = ρµ(t) -φζλ(t) Phase (2) μ(t) = ρµ(t) -Aα(φζ) 1-1 σ Y (t) -1 σ Phase (3) μ(t) = ρµ(t) -kφζλ(t) (43) Phase (4) μ(t) = ρµ(t) -A(kφζ) 1-1 σ k 1-σ α σ + (1 -α) σ 1 σ Y (t) -1 σ
Dates T , T i and T are given by:

λ(T ) = Aα φζY (T ) 1 σ (44) λ(T i ) = Aα k(φζY (T i )) 1 σ (45) λ(T ) = A k 1-σ α σ + (1 -α) σ kφζY (T ) 1 σ (46)
Finally, fossil fuel use, storage, total electricity consumption and prices in each phase are given in Table 1. Using these results, it is possible to compute the share of solar electricity Phase (1)

x d (t) = Aα λ(t) σ -φζY (t) x n (t) = A(1-α) λ(t) σ a(t) = 0 e d (t) = Aα λ(t) σ e n (t) = A(1-α) λ(t) σ p d (t) = λ(t) p n (t) = λ(t) Phase (2) x d (t) = 0 x n (t) = A(1-α) λ(t) σ a(t) = 0 e d (t) = φζY (t) e n (t) = A(1-α) λ(t) σ p d (t) = Aα (φζY (t)) 1 σ p n (t) = λ(t) Phase (3) x d (t) = 0 x n (t) = A σ (k 1-σ α σ +(1-α) σ ) λ(t) σ -kφζY (t) a(t) = 1 -Aα kλ(t) σ 1 φζY (t) e d (t) = Aα kλ(t) σ e n (t) = A(1-α) λ(t) σ p d (t) = kλ(t) p n (t) = λ(t) Phase (4) x d (t) = 0 x n (t) = 0 a * = (1-α) σ k 1-σ α σ +(1-α) σ e d (t) = (1 -a * )φζY (t) e n (t) = a * kφζY (t) p d (t) = Aα ((1-a * )φζY (t)) 1 σ p n (t) = A(1-α) (a * kφζY (t)) 1 σ
Table 1: Day and night consumptions, prices and storage rate in the variability case in the electric mix that triggers storage:

φζY (T i ) e d (T i ) + e n (T i ) = φζY (T i ) φζY (T i ) + x n (T i ) = α σ α σ + ((1 -α)k) σ (47)
It is all the higher since the preference for day-electricity is high and the storage technology inefficient, which is intuitive. It is independent of the efficiency of solar generation φ, which is not.

We now examine more precisely the long term of this economy, when the transition to clean energy has been achieved. The results are easily deduced from Table 1.

Proposition 3 With our specifications, solar capacity at the steady state is:

Y * = A ρc 1 , for σ = 1, or Y * = A ρc 1 σ k 1-σ α σ + (1 -α) σ (kφζ) 1-σ , for σ < 1 (48)
The storage rate at the steady state is:

a * = 1 -α, for σ = 1, or a * = (1 -α) σ k 1-σ α σ + (1 -α) σ for σ < 1 (49)
Day and night-electricity consumptions are respectively :

e * d = Aαφζ ρc 1 σ and e * n = A(1 -α)kφζ ρc 1 σ .
The price of day-electricity is p * d = ρc 1 /(φζ), and the price of night-electricity is

p * n = p * d /k.
The long term solar capacity is all the higher since the discount rate and the marginal investment cost are low and, for σ < 1, since the efficiency of the solar panels and storage technologies are poor. The impatience and cost effects are conform to intuition. The effect of the efficiency of the technology is a compensation effect: more capacity is needed to obtain the same amount of day and night-electricity with less efficient technologies. The role played by the preference parameter is less straightforward. It is necessary to consider simultaneously the effect of a change in this parameter on long run electricity consumption, storage and solar capacity. We see easily that e * d is an increasing function of α, e * n a decreasing function of α, and e * d > e * n ⇐⇒ α > (1 -α)k, that is if and only if the preference for day-electricity is higher than the preference for night-electricity corrected for the loss due to storage. On the other hand, a * is always a decreasing function of α. Then, when α increases, less solar capacity is required to ensure that consumption increases at day; but on the other hand more solar capacity may be necessary to ensure that consumption does not decrease too much at night. Overall, solar capacity decreases (resp. increases) if and only if α > (resp. <) (1 -α)k, that is, solar capacity decreases if consumption at day is higher than consumption at night. It is in particular the case when sun is at peak (α > 1/2). On the contrary, when sun is off-peak and the storage technology efficient enough, a higher preference for day-electricity leads to increase long run solar capacity.

The link between the long run storage rate and the preference parameter deserves some additional comments. If α > 1/2, consumers prefer consuming at day, when there is sun. This means that peak time consumption coincides with the availability of solar electricity. This is obviously the most favorable case for solar penetration, and in this case the storage rate is smaller than 1/(1 + k 1-σ ). If on the contrary α < 1/2, sun is shining at off-peak time, which requires to store in the long run more than half the electricity produced at day. This would correspond to the case that gives rise to the Californian duck documented by CAISO 15 and recently analyzed by Fowlie 16 and Wolfram: 17 in California, there has been more and more solar generation during day in the recent years, while consumption is mainly in the evening, meaning that sun shines off-peak. These dynamics generate a daily net generation (i.e. electricity generation net of electricity consumption) profile that evolves to look like a duck. What we show here is that in addition off-peak sun implies the need of large storage capacities, corresponding to more than half the daily production of electricity.

Accounting for intermittency

We now account for the fact that solar electricity generation is not only variable but intermittent as well, i.e. some of its variations are not predictable. During the day, solar radiations can be fully harnessed if there is sun, but can only be partially harnessed if there are clouds.

Variability, intermittency and storage

Very simply, we suppose that during the day the weather is sunny with a probability q and solar panels are then producing electricity at full capacity (production is ζY ), and that with a probability (1 -q) the weather is cloudy and solar panels only produce φζY , with 0 < φ < 1. With intermittency, the sequences of storage, solar panel accumulation and electricity consumptions are decided at the beginning of the program, accounting for the fact that weather will be uncertain. Do note that the fact that we only account for intra-day storage does restrict its usefulness to tackle intermittency as it rules out the possibility of using storage as an insurance against clouds the next day. e u denotes electricity consumption when the sun is shining, while it is noted e l when there are clouds. The social planner's programme becomes:

max ∞ 0 e -ρt qu (e u d (t), e u n (t)) + (1 -q)u e l d (t), e l n (t) -C(I(t)) dt (50) e u d (t) = x d (t) + (1 -a(t))ζY (t), e l d (t) = x d (t) + (1 -a(t))φζY (t) e u n (t) = x n (t) + ka(t)ζY (t), e l n (t) = x n (t) + ka(t)φζY (t) Ẋ(t) = x d (t) + x n (t) Ẏ (t) = I(t) 0 ≤ a(t) ≤ 1 X(t) ≤ X x d (t) ≥ 0, x n ≥ 0, X 0 ≥ 0, Y 0 ≥ 0 given
Do note that the objective we consider is consistent with a risk neutral agent and makes sense for a social planner. The decentralized counterpart of this model would require to consider private agents who invest in solar electricity capacity and are risk averse. Decentralizing the optimum using an optimal carbon tax would then be a complex task.

Obtaining a complete analytical solution of the model is now beyond reach. Nevertheless, we are able to obtain a number of analytical results with an isoelastic utility function and a quadratic investment cost. They are gathered in Proposition 4, Corollary 5 and Proposition 6. The proofs are relegated to Appendices B and C.

In the comparison between this model and the one with variability only, we impose in the variability only case φ = q+(1-q)φ : the efficiency of solar panels in the variability only case is equal to their expected efficiency in the case where intermittency is taken into account. Let us denote φ the real positive and smaller than 1 root of the following equation:

φ 1+ 1 σ - 1 -kq k(1 -q) φ 1 σ - 1 -k(1 -q) kq φ + 1 = 0 (51)
The characteristics of the optimal solution are then the following.

Proposition 4 When the intermittency of renewable energy is taken into account and the initial solar capacity is low, there exist two different types of optimal solution:

(1) For φ > φ defined in equation ( 51), the optimal solution under intermittency and variability exhibits the same succession of phases as under variability only;

(2) For φ < φ, the optimal solution under intermittency and variability significantly differs from the one under variability only: storage optimally begins before fossil has been abandoned at day.

Proposition 4 shows that when the cloud problem is not too bad, (φ is high enough), the optimal solution when intermittency is taken into account is qualitatively the same as when it is not. The planner does not make a big mistake by ignoring intermittency. At the limit, when φ → 1, we obtain exactly the variability-only solution for φ = 1. However, if the cloud problem is bad (φ is small), the optimal solution is very different. It is characterized by a reluctance of the planner to abandon fossil at day in case of the occurrence of the bad event, because this bad event is now actually very bad.

Intuition runs as follows. There are two different methods to satisfy night-electricity demand under a climate constraint that prevents to use as much fossil as desired. The first one is to abandon fossil at day to "save" fossil for night when solar capacity is high enough, to ensure that day-electricity needs are satisfied. The second one is to transfer electricity from day to night through storage, at the expense of a loss. With variability only, and with intermittency characterized by a small cloud problem (φ is high, corresponding to case (1) in Proposition 4), it is optimal to use the first method first, that is to begin storage after fossil has been abandoned at day, to avoid incurring the loss. With intermittency characterized by a severe cloud problem (φ is low, corresponding to case (2) in Proposition 4), the second method is used first, in spite of the loss. Fossil is abandoned at day later, to make sure that, in the case of no or few sun, day-electricity consumption can be satisfied. To compensate for the smaller quantity of fossil left available for night, a part of day-electricity production by solar panels is stored.

It is possible to study more precisely the determinants of the cutoff value φ.

Corollary 5 φ is an increasing function of k, meaning that the more efficient the storage technology is, the smaller is the range of φs for which intermittency may be safely ignored. φ is a symmetric and concave function of q, the no-clouds probability, tending to zero when q tends to 0 or 1, and reaching its maximum value for q = 1/2.

The interpretation of the first result is the following: the more efficient the storage technology is, the less costly it is to take intermittency into account, therefore the larger the range of φs for which the planner will adapt its decisions accordingly. The intuition for the second result is that when q is very close to 0 or to 1, there is actually little uncertainty; then intermittency does not matter a lot, and the range of φs for which the planner can ignore it is large.

Finally, the following proposition characterizes the long run of the economy.

Proposition 6 Solar capacity at the steady state is:

Y * i = A ρc 1 σ q + (1 -q)φ 1-1 σ σ (k 1-σ α σ + (1 -α) σ ) (kζ) 1-σ
for φ > 0. When σ = 1, it is the same as when intermittency is ignored. When σ < 1, it is higher: the planner ignoring intermittency underinvests in solar capacity in the long run.

In the extreme case where φ = 0, it becomes:

Y * i,0 = A ρc 1 σ q σ (k 1-σ α σ + (1 -α) σ ) (kζ) 1-σ < Y * i
If clouds do not fully prevent solar electricity generation, taking into account intermittency leads to invest more in solar capacity in the long run (Y * i ≥ Y * ). This is consistent with the concern often expressed in the public debate that solar capacities shall be larger when accounting for the risk of solar shortage. Do note that the smaller σ, that is, the more reluctant the central planner is to subsitute electricity consumption between day and night, the larger the investment.

In the limit case where there is no sun at all at day with a strictly positive probability (1 -q), we have Y * i,0 = qY * < Y * (where Y * is computed for φ = q). Then, the optimal long run solar capacity is all the smallest since this probability is large. The intuition supporting this result is that it is not possible to abandon fossil at day completely -fossil consumption tends to zero asymptotically, and less solar capacity is required.

Dealing with intermittency without storage

As storage is suspected to play a major role in tackling variability and intermittency, we appraise its importance by comparing the general model with variability, intermittency and storage analyzed above with a model with variability, intermittency but no storage possibilities.

In this last case, the social planner program reads:

max ∞ 0 e -ρt qu (e u d (t), e n (t)) + (1 -q)u e l d (t), e n (t) -C(I(t)) dt e u d (t) = x d (t) + ζY (t) e l d (t) = x d (t) + φζY (t) e n (t) = x n (t) Ẋ(t) = x d (t) + x n (t) Ẏ (t) = I(t) X(t) ≤ X x d (t) ≥ 0, x n (t) ≥ 0 X 0 ≥ 0, Y 0 ≥ 0 given
We show in Appendix D that only two phases appear when 0 < φ < 1. In phase (1), coal is used night and day, whereas it is used only during night in phase (2). The equations characterizing these two phases are formally the same as the equations characterizing the phases with fossil night and day, no storage, and fossil night only, no storage in the general model with a storage technology. But now phase (2) lasts forever: it is never possible to abandon fossil completely at night as there is no way of transferring daytime solar electricity towards the night. Therefore electricity generation is never carbon-free and night consumption (that is equal to fossil fuels use) asymptotically tends towards zero as it is driven by the climate constraint.

Phase (2) is a saddle path leading to a steady state characterized in the following proposition:

Proposition 7 Absent storage possibilities, solar capacity at the steady state is:

Y * ns = Aα ρc 1 σ q + (1 -q)φ 1-1 σ σ ζ 1-σ
We have:

Y * i Y * ns = 1 + (1 -α) σ k 1-σ α σ > 1
Solar capacity at the steady state is higher with storage: solar electricity generation and storage are complements.

Thanks to storage, it is possible to transfer electricity generated at day using solar capacity towards the night. Benefits from solar generation are therefore higher with storage, which explains that long run solar capacity is higher. It is all the higher since the preference for night electricity (1 -α) is high and, when σ < 1, the storage technology inefficient (k small), to compensate for this inefficiency. Notice that having a very inefficient storage technology is drastically different from having no storage technology at all.

The complementarity of solar capacity and storage is not a totally intuitive result. Indeed, without storage, it could have been optimal to invest more in solar to produce more renewable electricity and be able to save coal for the night-electricity generation. In this case, solar capacity and storage would have been substitutes. It may be the case that this effect appears in the short run, but this is impossible to check analytically.

Application: energy transition with solar in Spain

We now apply our model to a practical case to complete our analysis of the energy transition with solar generation. Due to its high sunlight, Spain is a good candidate in Europe and the model is therefore calibrated on Spanish data. We are then able to fully characterize the transition of Spain towards solar electricity generation. Comparative dynamics exercises are performed, and the role of intermittency (compared to variability) and storage are investigated.

Calibration

Our calibration is mainly based on data from Red Electrica de Espana (REE)18 for 2017.

Let us first calibrate the parameters relative to solar generation. REE provides daily solar generation. Using their 2017 data, we identify the highest generation per hour. We adopt the convention that days when generation is at least 80% of the maximum generation over the year are sunny days when production is ζY, while the other days are cloudy days, with a smaller production φζY . The proportion of sunny days is our probability of sun, q = 0.24. We then compute the two average generations on sunny and cloudy days. Their ratio provides φ = 0.527. This allows us to compute the loss in efficiency due to changes in the weather: q + (1 -q)φ = 64%. We finally need to calibrate ζ, the full load hours parameter.

It is defined as the number of hours in the year times a coefficient of efficiency of the solar panels, ratio of the full effective capacity to the full nominal capacity of the panels, absent any clouds. Indeed in case solar panels were used at their full nominal capacity during the whole day, the full load hours would be 365 * 12 = 4380 h. As the loss in efficiency due to the cloud problem is of 64% (see above), accounting for the cloud problem would lead to full load hours equal to 4380 * 64% = 2803 h. If we apply these full load hours to the existing capacity, namely 7 GW according to REE, this leads to an annual electricity generation equal to 2803 * 7 = 19, 622 GWh. However, according to REE, only 13, 747 GWh have been generated in 2017, that is 70% of 19, 622 GWh. This allows us to compute ζ as: ζ = 4380 * 70% = 3066 h. To summarize, there have been 1964 full loads hours in Spain in 2017, that decompose into 4380 h in a year, with solar panels used at 70% of their capacity, and losing in addition 64% of their efficiency because of clouds.

Let us now turn to the calibration of the cost function. We need to calibrate c 1 and c 2 . We first express c 1 as a function of c 2 , using the average investment cost for 2010 that amounts to 1,150 M¿/GW while investment was 0.443 GW that same year (Enerdata, 2015). As we have specified the cost function as C(I) = c 1 I + c 2 2 I 2 , using the 2010 data, this leads to c 1 = 1150 -0.2215c 2 expressed in M¿. Second, c 2 is chosen such that our full model reproduces Spanish investment in solar electricity for 2018 (0.262 GW). This leads to c 1 = 575 M¿/GW, and c 2 = 2, 596 M¿/GW 2 .

To calibrate the utility function parameters, we use REE data that provide hourly data during one year (2017) of electricity consumption and compute the average consumption during day (6am-5pm) and night (6pm-5am). The ratio between average consumption at day and total average consumption provides α = 0.5232. The intertemporal elasticity of substitution is set to σ = 1 (log utility function), absent any relevant empirical information on this parameter. The discount rate is set to ρ = 0.04, which is standard in the literature. Finally we set the scale parameter in the utility function A to 2, 630M¿, such that the current solar generation capacity (7 GW according to REE) represents 6 to 7% of its steady state level (as in 2017, solar capacity represented 6.7% of total electricity capacity).

To calibrate the carbon budget for electricity generation in Spain in 2017, we start with the world carbon budget in 2011 from which we deduce the Spanish carbon budget in 2011 using the share of Spanish emissions in total emissions. Removing Spanish emissions from 2012 to 2017 then leads to the Spanish carbon budget in 2017. Therefore we first compute the world carbon budget for energy generation in 2011. According to WRI 19 , it is 31.27% of total carbon budget, that is 1000 GtCO 2 eq for the 2 • C pathways (66% of model simulations according to IPCC, 2014). This leads to a world carbon budget for energy generation equal to 312.7 GtCO 2 eq in 2011. Then, the share of world energy generation emissions due to energy generation coming from Spain is 0.691% in 2011 according to WRI. 20 We therefore obtain a Spanish carbon budget for energy generation in 2011 equal to 2,162.2 MtCO 2 eq. Finally, data on emissions due to electricity generation in Spain between 2012 and 2016 come from the United Nation Climate Change 21 and for 2017, we take the same value as for 2016 as an estimate. These emissions are then subtracted from the 2011 budget to get the 2017 budget, which is then 1,680.52 MtCO 2 eq. The emission coefficient for Spain is computed as the ratio between CO 2 eq emissions and non-renewable electricity generation, using data from REE. 22 We observe from the data that the total generation of electricity is 262,306 GWh for 2017, from which 67.8% is nonrenewable. Therefore total generation of non-renewable electricity amounts to 177,843 GWh, while CO 2 eq emissions are 74.5 MtCO 2 for that same year. This leads to an emission coefficient equal to: 74,5 tCO 2 /177,843 GWh = 0.418697 10 -3 MtCO 2 /GWh. 23 Using this emission coefficient, we can compute the carbon budget in terms of quantity of electricity generated with fossil fuels, i.e. X =1680.52/0.418697 10 3 =4012.44 10 3 GWh.

Finally, the round-trip efficiency parameter is taken as the lower bound of the values provided by [START_REF] Irena | Electricity Storage and Renewables: Costs and Markets to 2030[END_REF] 19 https://www.wri.org/resources/data-sets/cait-country-greenhouse-gas-emissions-data, tables "GHG emissions" and "CO2 emissions energy sub sectors" for 2011.

20 https://www.wri.org/resources/data-sets/cait-country-greenhouse-gas-emissions-data table "CO2 emissions energy sub sectors" for 2011.

21 https://unfccc.int/documents/64855 22 https://www.ree.es/en/statistical-data-of-spanish-electrical-system/ statistical-series/national-statistical-series#, tables "balance of electrica energy", "generation mix", and "CO2 emissions associated to the power generation'.

The Spanish transition

Using the optimality conditions (see Appendix B) of programme (50), one can fully characterize the energy transition with solar for Spain when both intermittency and variability are accounted for. As shown on Figure 2, where date 0 represents the year 2017, Spain should exhaust its 2 • C carbon budget and reach full solar electricity generation in 2069 with a 114 GW solar capacity in the long run. The initial carbon value is 26¿/tCO 2 and reaches 190¿/tCO 2 in 2069. Investment reaches a peak at 0.5 GW (i.e. about twice the current level) in 2062. In 2050, fossil fuel is already abandoned for daytime electricity generation and storage starts in 2069. Such a timing is consistent with the European objectives for zero net emissions corresponding to a 2 • C increase in temperature. Night-time electricity prices will reach a peak in 2069 where they will be more than 8 times their current level. Day-time peak occurs at about the same time when they will be multiplied by 5 compared to their 2017 levels.

Variability versus

Using the calibration in Table 2 and equation ( 51), one can first compute φ, the threshold value for φ that will determine whether intermittency matters, compared to variability. We obtain φ = 0.1827. Therefore, the ratio between solar generation when the weather is cloudy and when it is not, is too high in Spain (φ = 0.527) for intermittency to play a large role.

However, considering intermittency instead of variability means accounting for uncertainty.

As expected, introducing uncertainty induces a lower rate of investment in solar capacity, and an increased share of consumption of fossil fuels (available with certainty and thus benefiting from a comparative advantage with respect to the uncertain renewable alternative) for electricity generation (see 24 Figure 5 in Appendix E). However, the latter being lower under intermittency, even if the share of fossil fuel-produced electricity is higher under intermittency, the amount of fossil fuel used at each point in time is smaller. Hence, intermittency induces a slower transition with a higher initial carbon value, then increasing at the same discount rate, corresponding to a carbon budget that is depleted more slowly.

Our results contribute to the current debate on the back-ups that are necessary when intermittent renewable energy develops. We have obtained analytically that once the electricity sector is decarbonized, intermittency requires a larger capacity of solar equipment. We now show numerically that during the transition, intermittency does require to maintain less thermal capacities, though for a longer time.

Unsurprisingly intermittency does not have a large welfare cost. Indeed, agents would only need to be compensated 1.5% of their consumption each period to be as well-off under intermittency as they are under variability only. This result that intermittency is relatively innocuous for energy transition compared to variability in sunny countries is consistent with the empirical findings of [START_REF] Gowrisankaran | Intermittency and the Value of Renewable Energy[END_REF]. They estimate the social costs of largescale solar energy by calibrating for southeastern Arizona a theoretical model based on the work of [START_REF] Joskow | Reliability and Competitive Electricity Markets[END_REF]. They find that the social costs of 20% solar generation are $138.40 per MWh of which variability accounts for $46 per MWh while intermittency accounts for only $6.10 per MWh.

The extreme case where clouds fully prevent solar generation provides an interesting fictive case where the qualitative behavior of variables along the transition are affected by intermittency (see Figure 6 in Appendix E). In particular, to be able to face days without sun at all, it is necessary to keep some fossil fuel forever, hence the clean generation occurring only asymptotically and electricity prices that are skyrocketting in the long run. The phase with increasing storage is now infinite, compared to about 10 years under variability only. Recall that it is due to the fact that under a severe cloud problem (φ < φ), night electricity demand is satisfied thanks to storage, rather than thanks to fossil that would have been "saved" during day. It can also be noticed that long run solar capacity is 76% less. Last but not least, the compensating variation now reaches 25.3% of each period consumption, implying that intermittency does really matter.

Next subsection that deals with comparative dynamics by analyzing the effect of shocks on keys parameters will concentrate on the model with variability only as intermittency does not play a significant role in sunny countries like Spain.

Sensitivity analysis

We now inspect the sensitivity of the results with respect to important parameters, like those governing the stringency of climate policy, investment costs or technological improvements. Whereas the model is too complex to allow for a full analytical comparative dynamics analysis, 25 some results may be obtained by direct inspection of the equations in Table 1. Some additional insights are provided numerically by running the model with variability only in the Spanish case, as intermittency can be safely abstracted from (see previous subsection).

Proposition 8 The energy transition and the steady state are affected by the key parameters of the model as follows:

A more stringent climate policy or technological improvements (more efficient solar panels or storage) speed up the transition but have no permanent effect.

A decrease in the investment cost leads to higher long run solar capacity and day and night-electricity consumptions, at lower prices.

Let us first examine the effect of a more stringent climate policy. It can be shown numerically that strengthening climate policy translates in a higher initial carbon value λ(0), which is consistent with the very meaning of the carbon value, that is, the shadow price of the climate constraint. Then, fossil and total energy consumptions at day and night are smaller, and prices are higher. Fossil is dropped at day earlier. 26 Storage occurs earlier, and the switch to clean energy is brought forward. 27 We obtain numerically that the shadow value of solar panels µ(0) increases as well. Indeed, with a smaller carbon budget, solar capacity becomes more valuable. Investment in solar panels is then higher and solar capacity is larger in the short/medium run. But long term solar capacity as well as storage are unaffected by climate policy, as soon as there actually exists a climate policy (Proposition 3). We may conclude that climate policy has a timing effect on solar capacity accumulation, but not a permanent effect.

Let us now turn to the effect of a decrease in the investment cost. We have seen (Proposition 3) that it leads to higher long run solar capacity and day and night-electricity consumptions, at lower prices. Contrary to a direct climate policy, the effects of a subsidy to solar are permanent. For Spain, a 20% subsidy on the linear part of the investment cost leads to 25 To be very precise, let us say that we are able in the variability case to compute analytically all the variables as functions of the two initial shadow prices, namely λ(0), the initial carbon value, pinned down by climate policy, and µ(0), the initial solar capacity value, pinned down by the initial solar capacity Y 0 . But the computation of λ(0) and µ(0) remains out of reach.

26 Proof: According to Eq. ( 44), Y (T )

1 σ e ρT = α/(φλ(0)); as the left-hand side member of this equation is an increasing function of T , a larger λ(0) translates in a smaller T .

27 Proof along the same line as above, using Eqs. ( 45) and ( 46). a 25% increase in the long term solar capacity and electricity consumption. The relevant question now is whether it induces more fossil fuel consumption in the short run. This is the case in our quantitative exercise, but the effect is limited in size (2% max).

Finally, let us examine the effects of technological improvements in the form of more efficient solar panels (higher φ) and better storage technology (higher k). Changes have been calibrated such that their welfare gains are similar (about 3%). This amounts to an increase in full load hours from 1964 to 2134 h, and an increase in k from 0.6 to 0.85. Globally, and unsurprisingly, these technological improvements are favorable. With more efficient storage technology, the beginning of storage and the switch to clean energy are brought forward.

The peaks in the price of electricity at night and day occur seven years earlier and the one at night is reduced by about one fourth (the one at day is less affected). There is slightly more solar capacity accumulation in the relatively short run with about 10% more investment at the 40-year horizon, the steady-state solar capacity remaining unchanged. With a more efficient solar technology, effects are qualitatively the same. However, the size of the effects on night electricity peak and investment in solar is smaller. On the contrary, day electricity peak is about 10% smaller than without the technological improvement.

The value of storage

We have proved analytically that storage and solar electricity generation are complements: absent storage, there is less incentive to generate during the day an electricity that cannot be stored for the night. Solar capacity is therefore lower at each period. In the Spanish case, long run solar capacity absent storage is 48% less than with storage. Fossil fuel for daytime generation is abandoned about five years later than if storage were available. The value of storage evaluated through the compensatory variation corresponds to 12.5% of current consumption.

Finally, when it may happen that there is no sun at day (φ = 0), long run solar capacity absent storage and with storage are very low, the second one being still 48% less than the first one, and the value of storage is now equal to 1.2% of each period consumption. Storage does not matter that much in countries affected by the risk of days without solar generation.

These results show that storage becomes less critical when intermittency worsens, which is counter-intuitive. It can be explained first by the complementarity between storage and solar generation. Second, less storage has a positive effect on welfare through the reduction in investment it induces, thus reducing investment costs. Finally, the value of storage may be very different with a modelling that allows to store electricity generated during a sunny day and release it in case of clouds.

Conclusion

The bulk of the literature dealing with energy transition from a macroeconomic perspective models renewable energy as a "backstop technology", costly but abundant and available with certainty anytime. We claim that this representation may be misleading, as it puts the main emphasis on variable costs, overlooking the fact that the relevant cost to be taken into account in the case of renewables is the investment cost, and, more importantly, as it ignores the variable and intermittent nature of renewable sources. We provide in this paper an alternative representation of the energy transition, that deals with these issues while remaining simple and tractable.

In the case where renewable energy is only variable, we are able to obtain an almost complete analytical resolution of the model -almost in the sense that it is not possible to compute the initial carbon and solar capacity values. The optimal dynamics for solar capacity is derived, as well as the optimal amount of electricity stored in time and the timing of the energy transition. Transition to solar consists in four phases, and storage starts after there is only solar used during the day. The last phase, when there is full solar electricity generation, starts once the carbon budget is exhausted. In the general case with intermittency, an analytical solution of the model is not possible. Nevertheless, we are able to identify conditions that decide whether the solution is very different from the one with variability only, that is, whether it is a big mistake to ignore intermittency. In case the cloud problem is not too severe, the transition exhibits the same phases as under variability only, which drives the conclusion that intermittency does not matter too much. On the contrary, when clouds significantly reduce solar generation, storage needs to start before fossil has been abandoned for electricity generation at daytime. In addition, we show analytically that solar capacity and storage technology are complements.

We apply our model to the Spanish solar transition. We obtain that Spain should reach full solar electricity generation by 2069 and that clouds are sufficiently light and rare so that intermittency has a less than a 1.5% welfare cost (in terms of permanent consumption).

Storage is also responsible for this low cost as it allows demand management. This is reflected in its high value, reaching 12.5% of permanent consumption. Finally, transition would be speeded up, should the environmental policy become more stringent.

Next steps should first deal with a decentralized version of the model. It would be interesting and challenging as the energy market exhibits several peculiar features, and it would allow designing policy instruments. In addition, the model could be extended to account for carbon capture and storage, and the non-renewable resources that are necessary to build solar panels and storage devices.

APPENDICES A Phase diagram

The global phase diagram is represented on Figure 3, for a given carbon value λ(0).

The last phase is a saddle path leading to the steady state (µ * , Y * ). Moving backward from the steady state along the stable branch (thick line on the Figure), date T is reached. The relevant path (thick dashed line) then corresponds to phase (3) where the dynamics of Y and µ are independent, until date T i is reached. From T i on, a portion of the saddle path of phase (2) leading to the (never reached) steady state (µ * , Y * * ) is followed (in black) until date T . 28 Before T the path followed (thick dashed line) corresponds to phase (1) where Y and µ are independent, until date 0. We have chosen to represent the case where µ is bell-shaped in this phase. The initial shadow value of solar panels µ(0), function of λ(0), matches the initial condition Y (0) = Y 0 .

For a given value of λ(0), the joint evolutions of λ and Y trigger the phase switchings, i.e. give dates T , T i and T (see Eqs. ( 19), ( 20) and ( 27)).

The climate constraint pins down λ(0).

B Variability and intermittency

The current value Hamiltonian associated to the social planner's programme reads:

H =qu (x d + (1 -a)ζY, x n + kaζY ) + (1 -q)u (x d + (1 -a)φζY, x n + kaφζY ) -C(I) -λ (x d + x n ) + µI
and the Lagrangian is:

L = H + ω a a + ω a (1 -a) + ω d x d + ω n x n + ω X X -X 28
Phases (1), ( 2) and (3) coalesce if there is no loss in the storage technology (k = 1).

Y (t) Y 0 µ(t) Ẏ (t) = 0 µ * Y * Y * * μ(t) = 0 in phase (4) μ(t) = 0 in phase (2) Y (T ) Y (T i ) Y (T ) µ(0) Figure 3: Global phase diagram
The first order conditions are:

qu d (x d + (1 -a)ζY ) + (1 -q)u d (x d + (1 -a)φζY ) = λ -ω d (B.1) qu n (x n + kaζY ) + (1 -q)u n (x n + kaφζY ) = λ -ω n (B.2) qζY [u d (x d + (1 -a)ζY ) -ku n (x n + kaζY )] + (1 -q)φζY [u d (x d + (1 -a)φζY ) -ku n (x n + kaφζY )] = ω a -ω a (B.3) C (I) = µ (B.4) λ -ρλ = -ω X (B.5) μ -ρµ = -qζ [(1 -a)u d (x d + (1 -a)ζY ) + kau n (x n + kaζY )] -(1 -q)φζ [(1 -a)u d (x d + (1 -a)φζY ) + kau n (x n + kaφζY )] (B.6)
The complementarity slackness conditions read:

ω a a = 0, ω a ≥ 0, a ≥ 0 ω a (1 -a) = 0, ω a ≥ 0, 1 -a ≥ 0 ω d x d = 0, ω d ≥ 0, x d ≥ 0 ω n x n = 0, ω n ≥ 0, x n ≥ 0 ω X X -X = 0, ω X ≥ 0, X -X ≥ 0
Before the ceiling, X < X and ω X = 0. Then FOC (B.5) reads λ/λ = ρ, i.

B.1 Fossil night and day

We have x d > 0, x n > 0, ω d = 0, ω n = 0. FOC (B.1) and (B.2) then read:

qu d (x d + (1 -a)ζY ) + (1 -q)u d (x d + (1 -a)φζY ) = λ (B.9) qu n (x n + kaζY ) + (1 -q)u n (x n + kaφζY ) = λ (B.10) B.1.1 No storage
We have ω a > 0, ω a = 0, a = 0. Eqs. (B.9) and (B.10) then read:

qu d (x d + ζY ) + (1 -q)u d (x d + φζY ) = λ (B.11) u n (x n ) = λ (B.12)
Eq. (B.11) gives implicitly x d as a function of Y and λ, and Eq. (B.12) yields x n = u -1 n (λ). Eq. (B.6) simplifies into:

μ -ρµ = -qζu d (x d + ζY ) -(1 -q)φζu d (x d + φζY ) (B.13) Eq. (B.3) reads: qY [u d (x d + ζY ) -ku n (x n )] + (1 -q)φY [u d (x d + φζY ) -ku n (x n )] ≥ 0
i.e., using Eq. (B.12):

qu d (x d + ζY ) + (1 -q)φu d (x d + φζY ) ≥ kφλ
with φ = q + (1 -q)φ. Using Eq. (B.11) to replace λ in this last equation we obtain:

(

1 -kφ)qu d (x d + ζY ) ≥ (kφ -φ)(1 -q)u d (x d + φζY ) (B.14)
Let us now determine the boundaries of this phase. First, with our assumption that initial solar capacity is small, this phase is necessarily the first one and starts at date 0. Then, at the end of this phase, either x d = 0 (x n = 0 is impossible, since it would require λ → +∞) or Eq. (B.14) is satisfied as an equality, meaning that the next phase will be a phase with positive storage. Therefore the end of this phase is T or T a respectively defined by:

λ(T ) = qu d (ζY (T )) + (1 -q)u d (φζY (T )) and x d (T ) = 0 (B.15) and (1 -kφ)qu d (x d (T a ) + ζY (T a )) = (kφ -φ)(1 -q)u d (x d (T a ) + φζY (T a ))) (B.16)
A necessary condition for the existence of T a is:

kφ -φ > 0 ⇐⇒ φ < 1 1 + 1-k qk = φ 0 (B.17)
meaning that when φ is small enough, reflecting a serious cloud problem, storage must begin before fossil is abandoned at day. See Figure 4.

If this condition is not satisfied the relevant date of end of this phase is T . It is T as well if this condition is satisfied but T < T a . Comparing directly T and T a is out of reach. Nevertheless, we will obtain later on an argument allowing us to determine when the relevant date of end of this phase is T and when it is T a .

B.1.2 Interior storage

If it exists, this phase starts at T a . We have ω d = ω n = ω a = ω a = 0, x d > 0, x n > 0 and 0 < a < 1. FOC (B.3) reads:

q [u d (x d + (1 -a)ζY ) -ku n (x n + kaζY )] + (1 -q)φ [u d (x d + (1 -a)φζY ) -ku n (x n + kaφζY )] = 0 (B.18)
Eqs. (B.1), (B.2) and (B.18) allow us to obtain implicitly x d , x n and a as functions of Y and λ. Notice that algebraic expressions of these variables are impossible to obtain, even if we specify the utility function as an isoelastic function.

Turning to the boundaries of this phase, we have seen that if it exists it begins with no storage at date T a defined in Eq. (B.16). At the end of this phase (date T b ) fossil consumption at day stops. From Eq. (B.1), date T b is characterized by: This case with full storage cannot appear under our assumption that initial solar capacity is small (note that it is true as well in the variability only case). Indeed, intuitively, full storage is likely to occur if on the one hand the preference for night-electricity is higher that the preference for day electricity that is if agents prefer consuming electricity off-peak, and if on the other hand initial solar capacity is large, so that solar electricity is produced at day in excess of the consumption needs. But it will never be optimal to build solar capacity to obtain this kind of solution at a date other than the initial one, because of the loss of electricity attached to the storage technology.

λ(T b ) = qu d ((1 -a(T b ))ζY (T b )) + (1 -q)u d ((1 -a(T b ))φζY (T b )) (B.19) φ 1 1 φ q φ kq k kφ F (φ) φ φ 0
Relying on these arguments, we exclude in the following the case of full storage.

q)φu d (φζY )], which simplifies into:

qu d (ζY ) (1 -q)u d (φζY ) ≥ kφ -φ 1 -kφ
It seems difficult to go further without specifying the utility function. However, with an isoelastic utility function, the terms in ζY cancel out and the above condition simplifies into:

q 1 -q φ 1 σ ≥ kφ -φ 1 -kφ
This condition is equivalent to the following:

kφ ≤ (1 -q)φ + qφ 1 σ (1 -q) + qφ 1 σ = F (φ) (B.31) F (.
) is a function of φ on the interval (0, 1), with F (0) = 0 and F (1) = 1. It is increasing:

we have F (φ) = (1 -q) 1 σ qφ 1 σ 1 φ -1 + qφ 1 σ + (1 -q) /[(1 -q) + qφ 1 σ ] 2 > 0.
It is concave: we easily see that F (φ) ≥ φ ∀φ ∈ (0, 1). See Figure 4. Denoting by φ the value of φ for which the condition is satisfied as an equality, it may simply be written as φ > φ : φ must be high enough, meaning that the cloud problem is not too severe. If this condition is not satisfied this phase does not exist. It implies that the phase with fossil night and day and no storage necessarily ends at date T a . This solves the problem of the validity of the boundaries T and T a .

Let us come back to Eq. (B.31) taken as an equality and study how φ depends on k and q. φ is solution of:

G(φ) = kq(1 -q)φ 1 σ +1 -q(1 -kq)φ 1 σ -(1 -q)(1 -k(1 -q))φ + kq(1 -q) = 0
We have G(0) = 0, G(1) = k -1 < 0, and

G (φ) = 1 σ + 1 kq(1 -q)φ 1 σ - 1 σ q(1 -kq)φ 1 σ -1 -(1 -q)(1 -k(1 -q)) <(1 -q) 1 σ qφ 1 σ -1 (kφ -1) + kq(φ 1 σ -1) -(1 -k) < 0
Therefore, φ is clearly an increasing function of k: a higher k makes the whole G( φ) curve shift to the right. It is an increasing (resp. decreasing) function of q when q < (resp. >) 1 2 :

∂G(0) ∂q = k(1 -2q) > 0 for q < 1 2 , < 0 otherwise.

B.2.2 Interior storage

In the case of an interior solution on a, Eq. (B.22) yields: The date at which this phase ends, denoted T , is given by the fact that fossil fuel consumption at night becomes nil. Then Eq. (B.32) shows, in the isoelastic case, that:

a(T ) = (1 -α) σ k 1-σ α σ + (1 -α) σ
and Eq. (B.21) shows T is given by: λ(T ) = A q + (1 -q)φ -1 σ k 1-σ α σ + (1 -α) σ kζY (T )

1 σ (B.34)

B.3 Fossil at day only

Quite intuitively, this case could occur if initial solar capacity was very large, so that it is optimal to start with full storage at the beginning of the planning horizon, and make storage decrease in time. It cannot occur under our assumption of small initial solar capacity.

B.4 No fossil

This phase is necessarily the last one, and it always exists. More precisely, it exists as such as soon as φ > 0. For φ = 0 fossil consumption asymptotically decreases towards zero. Moreover, storage is always positive in this phase.

We have x d = 0, x n = 0, ω d > 0, ω n > 0, 0 < a < 1, ω a = ω a = 0 ∀t ≥ T .

The FOC then read: In the isoelastic case, Eq. (B.37) yields:

a * = (1 -α) σ k 1-σ α σ + (1 -α) σ = a(T ) (B.39)
There is a constant rate of storage all along this phase, the same as in the variability only model.

In the isoelastic case again, Eq. (B.38) reads, after some computations:

μ -ρµ = -A(ζk) 1-1 σ q + (1 -q)φ 1-1 σ k 1-σ α σ + (1 -α) σ 1 σ Y -1 σ (B.
Y * i = A ρc 1 σ q + (1 -q)φ 1-1 σ σ (k 1-σ α σ + (1 -α) σ ) (kζ) 1-σ (B.42)
The shadow value of solar panels at the steady state is the same whether intermittency is taken into account or not. If σ = 1 (logarithmic utility function), solar capacity at the steady state is the same as well: Y * i = Y * (see Eq. ( 48)). If σ < 1, we have:

Y * i Y * = (q + (1 -q)φ) 1-σ q + (1 -q)φ 1-1 σ -σ
This ratio is strictly greater than 1 for all q ∈ (0, 1), φ ∈ (0, 1). Indeed, we have:

Y * i Y * -1 σ = (q + (1 -q)φ) 1-1 σ q + (1 -q)φ 1-1 σ ≤ 1 44 because the function x → x 1-1 σ is convex.
Finally, Eqs. (B.35) and (B.36) imply 1 φY ≤ λ and 1 kφY ≤ λ. The second condition is more stringent than the first one. It shows that this phase begins at date T , which is also the date at which the ceiling is reached.

B.5 Respect of the carbon budget

The model is completed by specifying that the total quantity of fossil fuel burned cannot exceed the carbon budget. The constraint reads: C A polar case: intermittency with no sun at all in the bad case φ = 0

Note that this case is very specific. It does not constitute the limit when φ tends to 0 of the 0 < φ < φ case. It is the only case where fossil fuels use never stops, because there is a chance that solar panels will not be able to produce electricity some days.

C.1 No storage, fossil night and day

With isoelastic utility, Eq. (B.11) reads:

q Aα (x d + ζY ) The asymptotic steady state is characterized by µ * = c 1 and, according to Eq. (C.5):

1 σ + (1 -q) Aα
Y * i,0 = A ρc 1 σ q σ (k 1-σ α σ + (1 -α) σ ) (kζ) 1-σ (C.6)
The long run value of solar panels is the same as when φ > 0, but the long run value of solar capacity is smaller, because solar capacity is less useful when there is a chance that it cannot produce electricity at all and the transition to clean energy lasts forever. Indeed, we have:

Y * i Y * i,0 = 1 + 1 -q q φ 1-1 σ σ > 1

D Variability and intermittency without storage

The current value Hamiltonian associated to the social planner's programme reads:

H = qu (x d + ζY, x n ) + (1 -q)u (x d + φζY, x n ) -C(I) -λ (x d + x n ) + µI
and the Lagrangian is:

L = H + ω a a + ω d x d + ω n x n + ω X X -X

D.2 Fossil at night only

In this second case, the first order conditions reduce to: This phase lasts forever: it is not possible to abandon fossil at night absent storage possibilities. It is a saddle-path.

With our specification of the utility and investment cost functions, the steady state is characterized by µ * = c 1 , and:

Y * ns = Aα ρc 1 σ q + (1 -q)φ 1-1 σ σ (ζ) 1-σ

Figure 2 .

 2 Figure 2. Energy transition with solar in Spain

Figure 4 :

 4 Figure 4: Boundaries of the two possible solutions in the fossil night and day and no storage case

k

  [qu n (x n + kaζY ) + (1 -q)φu n (x n + kaφζY )] = qu d ((1 -a)ζY ) + (1 -q)φu d ((1 -a)φζY ) (B.32) Eqs. (B.21) and (B.32) implicitly give a and x n as functions of Y and λ. Using Eq. (B.32), Eq. (B.23) reads:μ -ρµ = -(B.23) [qu d ((1 -a)(B.23)Y ) + (1 -q)φu d ((1 -a)φ(B.23)Y )] (B.33)This phase may follow either a phase where fossil fuel is used at night only and there is no storage, or a phase where fossil fuel is used night and day and there is positive storage. In the first case, Eqs. (B.25) and (B.32) show that this phase begins at T i defined in Eq (B.30). In the second case, Eqs. (B.10) and (B.32) show that this phase begins at T b defined in Eq. (B.19).

  qu d ((1 -a)ζY ) + (1 -q)qu d ((1 -a)φζY ) ≤ λ (B.35) qu n (kaζY ) + (1 -q)u n (kaφζY ) ≤ λ (B.36) qu d (1 -a)ζY ) + (1 -q)φu d ((1 -a)φζY ) = k (qu n (kaζY ) + (1 -q)φu n (kaφζY )) (B.37) μ -ρµ = -qζ [(1 -a)u d ((1 -a)ζY ) + kau n (kaζY )] -(1 -q)φζ [(1 -a)u d ((1 -a)φζY ) + kau n (kaφζY )] (B.38)to which we add Eqs. (B.7) and (B.8).

  40) Eqs. (B.8) and (B.40) yield a saddle-path dynamic system in (µ, Y ). The values of µ and Y at the steady state are: µ * = c 1 (B.41)

  (t) + x d (t))dt +

  gives implicitly x d as a function of Y and λ. Eq. (B.16) yields: λ(T a ) = 1 k Aα (x d (T a ) + ζY (T a )) ρµ = -qζA (1 -a) α (x d + (1 -a)ζY ) with no storage at date T a . It never ends: in the long run, x d and x n tend asymptotically to zero, and, as shown by Eq. (C.4), a tends asymptotically to a * .

  qu d (ζY ) + (1 -q)u d (φζY ) ≤ λ (D.8) u n (x n ) = λ (D.9) μ -ρµ = -qζu d (ζY ) -(1 -q)φζu d (φζY ) (D.10)

  0 given e d and e n are respectively day and night-electricity consumption. u(e d , e n ) is the instantaneous utility function, supposed to have the standard properties and to be separable in day and night-electricity. This assumption may be justified by a temporal separability argument: temporal separability holds at the intra-day level as it holds across days. Then the marginal utility u d only depends on e d , and the marginal utility u n only on e n . In the rest of the paper, u d and u n are indifferently named marginal utilities of consumption or, as a shortcut, prices. Moreover, we suppose that marginal utilities become infinite when consumption tends to zero: lim e d →0 u d (e d ) = +∞ and lim en→0 u n (e n ) = +∞. x d and x

	n are
	fossil-generated electricity consumed respectively at day and night. X is the stock of car-
	bon accumulated into the atmosphere due to fossil fuel combustion expressed in electricity
	consumption units. X is the carbon budget, that is the ceiling on the atmospheric carbon
	concentration imposed by climate policy.

  and Xu et al. (2017) for existing battery storage technologies: k = 0.6. One rationale for choosing a low value is that in our model, this parameter captures all the costs related to storage.

	parameter	σ	ρ	α	q	φ	ζ
	value	1	0.04	0.5232 0.24	0.527	3066
	unit		%				h
	parameter	c 1	c 2	A	Y 0	X	k
	value	575	2, 596	2,630	7	4012 10 3 0.6
	unit	M¿/GW M¿/GW 2	M¿	GW	GWh

Table 2 :

 2 Calibration parameters

Nuclear and carbon Capture and Storage (CCS) is another option, but it is still expensive and can only offer a partial solution as potential carbon sinks are of limited capacity. CCS has already been extensively studied. See for instance[START_REF] Lafforgue | Energy substitutions, climate change and carbon sinks[END_REF]. Examining the nuclear option would require to write another, very different paper.

CAISO (2016). What the duck curve tells us about managing a green grid. https://www.caiso.com/ documents/flexibleresourceshelprenewables_fastfacts.pdf.

There is no such general pattern for wind energy, but specific patterns can be found depending on the location.

Coal reserves and, overall, resources are so large that coal, although non-renewable, can safely be considered as not scarce. See for instance IPCC (2014), Chapter 7, Table7.2.

For batteries, the round-trip efficiency is between

60% and 98% (IRENA, 2017 and Xu et al., 2018).6 In addition to stationary batteries, expansion of electric vehicles could also boost energy storage. In that same scenario, the IEA obtains that 150 TWh volume of energy storage could be used for grid support through vehicle-to-grid (V2G) inverters.7 It does not make sense to store coal electricity since coal-fired power plants can be operated at night as well and there is no capacity constraint.

The corresponding mathematical argument runs as follows. The left-hand side member of Eq. (12) is positive. Hence the case ω a = 0 and ω a > 0, i.e. a = 1 (full storage) is excluded. The interior case ω a = 0 and ω a = 0, i.e. 0 < a < 1, is possible if and only if Y = 0. But it does not make sense to store absent any intermittent source of energy. This case is also excluded. The only possibility is thus ω a > 0 and ω a = 0, i.e. a = 0. It is never optimal to store electricity when coal is used night and day.

It would be different absent storage possibilities: then fossil fuel use at day might tend to zero asymptotically and this steady state would be reached.

Proof: Suppose that T < T i ; then λ(T ) < λ(T i ), implying that u -1 d (kλ(T )) > u -1 d (kλ(T i )), implying in turn, by Eqs. (20) and (27), that Y (T ) > Y (T i ), a contradiction.

Proof: u d ((1-a)φζY ) is a strictly increasing function of a ∈ (0, 1), from u d (φζY ) to +∞, and u n (kaφζY ) is a strictly decreasing function of a, from +∞ to u n (kφζY ).

This is very different from what happens in energy transition models where renewable energy is modeled as a backstop technology.

"What the duck curve tells us about managing a green grid", https://www.caiso.com/Documents/ FlexibleResourcesHelpRenewables\_FastFacts.pdf

See "The duck has landed", the Energy Institute Blog, https://energyathaas.wordpress.com/2016/ 05/02/the-duck-has-landed/

See "What's the Point of an Electricity Storage Mandate?" https://energyathaas.wordpress.com/ 2013/07/29/whats-the-point-of-an-electricity-storage-mandate/

https://www.esios.ree.es/en

Note that it is significantly larger than 0.284 as computed by REE for total generation, that includes renewables.

Figure5in Appendix E has been constructed based on a fictive case, φ = 0.183 (still higher than φ but very slightly), the other parameters remaining the same. The effects of intermittency are qualitatively the same as for φ = 0.527, but they are larger, hence easier to visualize.

support of ANR (project REVE, ANR-14-CE05-0008), French Ministry of Research, for financial support.

1

B.2 Fossil at night only

This or these phases are intermediate. We have here x d = 0, x n > 0, ω d > 0, ω n = 0 and the FOC read:

to which we add Eqs. (B.7) and (B.8).

B.2.1 No storage

In the case of no storage, the FOC become:

Eqs. (B.8) and (B.27) yield a saddle-path dynamic system in (µ, Y ). The steady state values of µ and Y are given by:

According to (B.24) and (B.26), we must have

Hence this phase begins at T (see Eq. (B.15)), and it ends at T i defined by:

The existence of this phase requires that qu

The first order conditions are:

The complementarity slackness conditions read:

Before the ceiling, X < X and ω X = 0. Then FOC (D.4) reads λ/λ = ρ, as in the general model. Eq. (D.3) yields:

also as in the general model.

D.1 Fossil night and day

We have x d > 0, x n > 0, ω d = 0, ω n = 0. FOC (D.1) and (D.2) then read:

Eq. (D.6) gives implicitly x d as a function of Y and λ, and Eq. (D.7) yields x n = u -1 n (λ). Let us now determine the boundaries of this phase. First, with our assumption that initial solar capacity is nil, this phase is necessarily the first one and starts at date 0. Then, at the end of this phase, fossil stops being used at day. Therefore the end of this phase is date T defined by x d (T ) = 0. Notice that this equation is formally the same as the equation giving the boundary of the first phase in the case with intermittency and storage (see Eq. (B.15)), but of course the solar capacity is not necessarily the same, so that the dates may be different. Fossil fuel use (GWh) Electricity consumption (GWh) day (plain) and night (dashed) day (plain) and night (dashed)

E Transition with/without intermittency