two time scales stochastic dynamic optimization for...

1
Two time scales stochastic dynamic optimization for microgrids control Pierre Carpentier, Jean-Philippe Chancelier, Michel De Lara & Tristan Rigaut ENSTA, ENPC, Efficacity Stochastic optimization for storage management in microgrids Energy storage is often used to mitigate the uncertainty related to energy demand and production. Renewable energies are especially inttermittent and some electrical demands particularly uncertain. Stochastic optimization is a tool to ensure supply demand balance without wasting energy or curtail- ing demand. Hierarchical control architecture Microgrids control architecture is divided into multiple layers to handle multiple time steps. Primary level is devoted to ensure the microgrid voltage stability, secondary level is devoted to the energy man- agement while the tertiary level is devoted to economic reliability. Primary Secondary Tertiary T T ... t Δ t Δ T Δ T ... 1 min Δ T Target 1s 1s 1s Δ t Δ t Δ t Info Info Tertiary level Secondary level A superior level purpose is to provide a target that the next inferior level has to reach at the end of its horizon while reaching its own objective. Example: intraday energy arbitrage and battery long term aging management We study hereby a two time scales problem to manage a battery ageing over the long term while using it everyday for intraday energy arbitrage. The example we use is a battery in a subway station able to recover subways braking energy and to provide power to the station. S D B E s E l Station node D: Demand station E s : From grid to station : Discharge battery Subways node B : Braking E l : From grid to battery : Charge battery Medium time scale: energy arbitrage • Time step Δ t = 1 min • Horizon M = 24h • Decision: battery charge/discharge • Objective: energy cost minimization d, 0 ... d, M 1 min 1 min For a given charge/discharge decision U d,m : state of charge S changes S d,m+1 = S d,m - 1 ρ d U - d,m | {z } + ρ c sat(S d,m , U + d,m , B d,m+1 ) | {z } state of health H decreases H d,m+1 = H d,m - 1 ρ d U - d,m - ρ c sat(S d,m , U + d,m , B d,m+1 ) we save energy and money p e d,m (E s d,m+1 + E l d,m+1 - D d,m+1 | {z } Saved energy ) with p e d,m the cost of electricity on day d at minute m Large time scale: long term ageing • Time step Δ T = 1 day • Horizon D = 10 years • Decision: battery replacement • Objective: long term profitability T Δ T 0 ... D 24h 24h For a given replacement decision R d : battery capacity changes C d+1 = R d , if R d > 0 C d , otherwise we pay a replacement cost P b d R d at uncertain market prices P b d . The link between the two scales is the global state at the beginning of each day: (S d+1,0 , H d+1,0 , C d+1 )= ψ d ((S d,M , H d,M , C d , R d )) Stating a two time scales optimization problem The previous example displays 2 state variables that changes every minutes and 1 state variable that changes every day. We make 1 charge/discharge decision every minute and 1 capacity replacement decision everyday. We can formulate a two-time scales stochastic optimization problem. General two time scales stochastic optimization problem We minimize medium and large scale costs taking into account the medium and large scales dynamics, f index means fast (medium scale), s index means slow (large scale): min X f ,X s ,U f ,U s E h D-1 X d=0 M -1 X m=0 L f d,m (X f d,m , U f d,m , W f d,m+1 ) + L s d (X s d , U s d , W s d+1 , X f d,0 , U f d,: , W f d,: ) i X f d,m+1 = F f d,m (X f d,m , U f d,m , W f d,m+1 ) X f d,0 = ψ d (X s d , X f d-1,M ) X s d+1 = F s d (X s d , U s d , W s d+1 , X f d,0 , U f d,: , W f d,: ) σ (U f d,m ) ⊂F d,m σ (U s d ) ⊂F d,M we can reformulate the problem with X d =(X f d,0 , X s d ), U d =(U f d,: , U s d ), W d =(W f d-1,: , W s d ) min X ,U E h D-1 X d=0 L d (X d , U d , W d+1 ) i X d+1 = F d (X d , U d , W d+1 ) σ (U f d,m ) ⊂F d,m σ (U s d ) ⊂F d,M The last two constraints, called non anticipativity constraints, states that we make our decisions knowing only the past realizations of the noises. F d,m = σ W f d 0 ,m 0 ,d 0 <d, m 0 M +1 W s d 0 ,d 0 d W f d,m 0 ,m 0 m = σ previous days fast noises previous days slow noises current day previous minutes fast noises Resolution method: two time scales stochastic dynamic programming The resolution method is based on primal decomposition and dynamic programming. We show that when the (W d ) d=0,...,D are stage(day)wise independent we can define inductively value functions: Daily value function V d (x d )= min X d+1 h intraday problem z }| { φ d (x d , [X d+1 ]) + expected next day value z }| { EV d+1 (X d+1 ) i s.t X d+1 σ (X d , W d+1 ) Intraday arbitrage problem with almost sure stochastic target φ d (x d , [X d+1 ]) = min U d E L d (x d , U d , W d+1 ) s.t F d (X d , U d , W d+1 )= X d+1 U f d,m σ (X d , W f d,1:m ) U s d σ (X d , W f d,1:M ) U d =(U f d,: , U s d ) X d = x d We use the notation f ([W ]) to emphasize that f ’s domain is L 0 , F , P). Solving these two problems directly is computationally very expensive as the target to reach at the end of the day is measurable w.r.t all the intraday noises. We use 3 tricks to simplify the computation: • We exploit the problem periodicity (d, φ d = φ 0 ) • We exploit value functions monotonicity to relax the target F d (X d , U d , W d+1 ) X d+1 • We simplify measurability (X d+1 σ (X d )) meaning that we choose the final state target at the beginning of the day! We loose optimality with this trick. Numerical application We manage batteries in a subway station over 7 years and want to maximize the Net Present Value (NPV). We have to choose every month a maximum number of daily cycles for the current battery (orange horizontal line). We can decide to buy a new battery every month (green vertical lines are re- placements). We use synthetic scenarios for the price of batteries on the market. We manage charge discharge of the battery every 15 minutes, giving an effective number of cycles for each day (blue dots). The algorithm is implemented in Julia with a Core I7, 1.7 Ghz, 8Go ram + 12Go swap SSD. It requires 16 min to compute daily value functions and intraday problem value offline. It then takes 20 ms to make a charge/discharge decision online every 15 minutes and to make an ageing daily target decision at the beginning of every month. We obtain a +128k euros upper bound for the NPV. Conclusion This method allows to model two time scales stochastic optimization problems with a proper mod- elization of the information for the decision maker. The resolution method we present decouples the two time scales and could be applied to microgrid hierarchical management, sizing of storage or energy storage investment and long term ageing strategies.

Upload: others

Post on 25-Sep-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Two time scales stochastic dynamic optimization for ...cermics.enpc.fr/~rigautt/PosterTRigautTwoTimeScales.pdf · level is devoted to ensure the microgrid voltage stability, secondary

Two time scales stochastic dynamic optimization for microgrids controlPierre Carpentier, Jean-Philippe Chancelier, Michel De Lara & Tristan Rigaut

ENSTA, ENPC, Efficacity

Stochastic optimization for storage management in microgridsEnergy storage is often used to mitigate the uncertainty related to energy demand and production.

Renewable energies are especially inttermittent and some electrical demands particularly uncertain.Stochastic optimization is a tool to ensure supply demand balance without wasting energy or curtail-ing demand.Hierarchical control architectureMicrogrids control architecture is divided into multiple layers to handle multiple time steps. Primarylevel is devoted to ensure the microgrid voltage stability, secondary level is devoted to the energy man-agement while the tertiary level is devoted to economic reliability.

Primary

Secondary

Tertiary

2∆T

2∆T. . .

2∆t∆t

∆T

∆T . . .1 min

∆T

Target

1 s 1 s1 s

∆t ∆t∆t

InfoInfo

Tertiary level

Secondary level

A superior level purpose is to provide a target that the next inferior level has to reach at the end of itshorizon while reaching its own objective.

Example: intraday energy arbitrage and battery long term aging managementWe study hereby a two time scales problem to manage a battery ageing over the long term while usingit everyday for intraday energy arbitrage. The example we use is a battery in a subway station able torecover subways braking energy and to provide power to the station.

SD ⊕ B

Es El

Station node

• D: Demand station

• Es: From grid to station

•: Discharge battery

Subways node

• B: Braking

• El: From grid to battery

•⊕: Charge battery

Medium time scale: energy arbitrage

• Time step ∆t = 1 min• Horizon M = 24h• Decision: battery charge/discharge• Objective: energy cost minimization

d, 0 . . . d,M1 min1 min

For a given charge/discharge decision Ud,m:state of charge S changes

Sd,m+1 = Sd,m −1

ρdU−d,m︸ ︷︷ ︸

+ ρcsat(Sd,m,U+d,m,Bd,m+1)︸ ︷︷ ︸

state of health H decreases

Hd,m+1 = Hd,m −1

ρdU−d,m − ρcsat(Sd,m,U

+d,m,Bd,m+1)

we save energy and moneyped,m(Es

d,m+1 + Eld,m+1 −Dd,m+1︸ ︷︷ ︸

Saved energy

) with ped,m the cost of

electricity on day d at minute m

Large time scale: long term ageing

• Time step ∆T = 1 day

• Horizon D = 10 years

• Decision: battery replacement

• Objective: long term profitability

2∆T∆T0 . . . D24h24h

For a given replacement decision Rd:battery capacity changes

Cd+1 =

Rd, if Rd > 0Cd, otherwise

we pay a replacement cost P bdRd at uncertain

market prices P bd .

The link between the two scales is the global state at the beginning of each day:

(Sd+1,0,Hd+1,0,Cd+1) = ψd((Sd,M ,Hd,M ,Cd,Rd))

Stating a two time scales optimization problemThe previous example displays 2 state variables that changes every minutes and 1 state variable that

changes every day. We make 1 charge/discharge decision every minute and 1 capacity replacementdecision everyday. We can formulate a two-time scales stochastic optimization problem.

General two time scales stochastic optimization problemWe minimize medium and large scale costs taking into account the medium and large scales dynamics,f index means fast (medium scale), s index means slow (large scale):

minXf ,Xs,Uf ,Us

E[D−1∑d=0

(M−1∑m=0

Lfd,m(Xfd,m,U

fd,m,W

fd,m+1)

)+ Lsd(X

sd,U

sd,W

sd+1,X

fd,0,U

f

d,:,Wf

d,:)]

Xfd,m+1 = F f

d,m(Xfd,m,U

fd,m,W

fd,m+1)

Xfd,0 = ψd(X

sd,X

fd−1,M)

Xsd+1 = F s

d (Xsd,U

sd,W

sd+1,X

fd,0,U

f

d,:,Wf

d,:)

σ(U fd,m) ⊂ Fd,m

σ(U sd) ⊂ Fd,M

we can reformulate the problem with

Xd = (Xfd,0,X

sd), U d = (U f

d,:,Usd), W d = (W f

d−1,:,Wsd)

minX ,U

E[D−1∑d=0

Ld(Xd,U d,W d+1)]

Xd+1 = Fd(Xd,U d,W d+1)

σ(U fd,m) ⊂ Fd,m

σ(U sd) ⊂ Fd,M

The last two constraints, called non anticipativity constraints, states that we make our decisions knowingonly the past realizations of the noises.

Fd,m = σ

Wfd′,m′

, d′<d, m′≤M+1

W sd′, d′≤d

Wfd,m′

, m′≤m

= σ

(previous days fast noisesprevious days slow noises

current day previous minutes fast noises

)

Resolution method: two time scales stochastic dynamic programmingThe resolution method is based on primal decomposition and dynamic programming. We show thatwhen the (W d)d=0,...,D are stage(day)wise independent we can define inductively value functions:

Daily value function

Vd(xd) = minXd+1

[ intraday problem︷ ︸︸ ︷φd(xd, [Xd+1])

+

expected next day value︷ ︸︸ ︷EVd+1(Xd+1)

]s.t Xd+1 σ(Xd,W d+1)

Intraday arbitrage problem with almost surestochastic target

φd(xd, [Xd+1]) = minUd

E Ld(xd,U d,W d+1)

s.t Fd(Xd,U d,W d+1) = Xd+1

U fd,m σ(Xd,W

fd,1:m)

U sd σ(Xd,W

fd,1:M)

U d = (U fd,:,U

sd)

Xd = xd

We use the notation f ([W ]) to emphasize that f ’s domain is L0(Ω,F ,P). Solving these two problemsdirectly is computationally very expensive as the target to reach at the end of the day is measurable w.r.tall the intraday noises. We use 3 tricks to simplify the computation:

• We exploit the problem periodicity (∀d, φd = φ0)

• We exploit value functions monotonicity to relax the target Fd(Xd,Ud,W d+1) ≥Xd+1

• We simplify measurability (Xd+1 σ(Xd)) meaning that we choose the final state target at thebeginning of the day! We loose optimality with this trick.

Numerical applicationWe manage batteries in a subway station over 7 years and want to maximize the Net Present Value(NPV). We have to choose every month a maximum number of daily cycles for the current battery(orange horizontal line). We can decide to buy a new battery every month (green vertical lines are re-placements). We use synthetic scenarios for the price of batteries on the market. We manage chargedischarge of the battery every 15 minutes, giving an effective number of cycles for each day (blue dots).

The algorithm is implemented in Julia with a Core I7, 1.7 Ghz, 8Go ram + 12Go swap SSD. It requires16 min to compute daily value functions and intraday problem value offline. It then takes 20 ms to makea charge/discharge decision online every 15 minutes and to make an ageing daily target decision at thebeginning of every month. We obtain a +128k euros upper bound for the NPV.

ConclusionThis method allows to model two time scales stochastic optimization problems with a proper mod-

elization of the information for the decision maker. The resolution method we present decouples thetwo time scales and could be applied to microgrid hierarchical management, sizing of storage or energystorage investment and long term ageing strategies.