A fair comparison of two stochastic optimization algorithms - - PowerPoint PPT Presentation

a fair comparison of two stochastic optimization
SMART_READER_LITE
LIVE PREVIEW

A fair comparison of two stochastic optimization algorithms - - PowerPoint PPT Presentation

A fair comparison of two stochastic optimization algorithms Benchmarking MPC vs SDDP April 10, 2017 1/33 Why using stochastic optimization? We aim to tackle uncertainties in Energy Management System. Problem: we do not know in advance the


slide-1
SLIDE 1

A fair comparison of two stochastic

  • ptimization algorithms

Benchmarking MPC vs SDDP

April 10, 2017

1/33

slide-2
SLIDE 2

Why using stochastic optimization?

We aim to tackle uncertainties in Energy Management System. Problem: we do not know in advance the uncertainties, common in the management of energetical systems:

  • Electrical demands
  • Hot water demands
  • Outdoor temperature
  • Wind’s speed
  • Solar irradiation
  • etc.

2/33

slide-3
SLIDE 3

Introducing the problem

Here, we focus on the management of a domestic microgrid Sensitivity analysis w.r.t two uncertainties:

  • Electrical demands
  • Solar irradiation

3/33

slide-4
SLIDE 4

Introducing the problem

Here, we focus on the management of a domestic microgrid Sensitivity analysis w.r.t two uncertainties:

  • Electrical demands
  • Solar irradiation

3/33

slide-5
SLIDE 5

Introducing the problem

Here, we focus on the management of a domestic microgrid Sensitivity analysis w.r.t two uncertainties:

  • Electrical demands
  • Solar irradiation

We compare two classes of algorithm: The Mainstream: Model Predictive Control (MPC) (use forecasts to predict the future uncertainties) The Challenger: Stochastic Dual Dynamic Programming (SDDP) (model uncertainties with discrete probability laws)

3/33

slide-6
SLIDE 6

Outline

A brief recall of the single house problem Physical modelling Optimization problem Resolution Methods Handling solar irradiation Academic modeling Realistic modeling

4/33

slide-7
SLIDE 7

Framing the optimization problem

We aim to

  • Minimize electrical’s bill
  • Maintain a comfortable temperature inside the house

To achieve these goals, we can

  • store electricity in battery;
  • store heat in hot water tank.

We control the stocks every 15mn over one day. We formulate a multistage stochastic programming problem

5/33

slide-8
SLIDE 8

Microgrid’s description

Fn Fb Dth Del

ELECTRICAL DEMAND NETWORK BATTERY THERMAL DEMAND TANK

SOLAR PANEL

DOMESTIC HOT WATER

Fh Fpv Ft

6/33

slide-9
SLIDE 9

Outline

A brief recall of the single house problem Physical modelling Optimization problem Resolution Methods Handling solar irradiation Academic modeling Realistic modeling

7/33

slide-10
SLIDE 10

We introduce states, controls and noises

Fn Fb Dth Del

ELECTRICAL DEMAND NETWORK BATTERY THERMAL DEMAND TANK SOLAR PANEL DOMESTIC HOT WATER

Fh Fpv Ft Ci Cw Ri Rs Rm Re Rv Rf

Te Ti Tw

  • Stock variables Xt =
  • Bt, Ht, θi

t, θw t

  • Bt, battery level (kWh)
  • Ht, hot water storage (kWh)
  • θi

t, inner temperature (◦C)

  • θw

t , wall’s temperature (◦C)

  • Control variables Ut =
  • F+

B,t, F− B,t, FA,t, FH,t

  • F+

B,t, energy stored in the battery

  • F−

B,t, energy taken from the battery

  • FA,t, energy used to heat the hot water tank
  • FH,t, thermal heating
  • Uncertainties Wt =
  • DE

t , DDHW t

, Φs

t

  • DE

t , electrical demand (kW)

  • DDHW

t

, domestic hot water demand (kW)

  • Φs

t, external radiations (kW)

8/33

slide-11
SLIDE 11

Discrete time state equations

So we have the four state equations (all linear):

Bt+1 =αBBt + ∆T

  • ρcF+

B,t − 1

ρd F−

B,t

  • Ht+1 =αHHt + ∆T
  • FA,t − DDHW

t

  • θw

t+1 =θw t + ∆T

cm

  • θi

t − θw t

Ri + Rs + θe

t − θw t

Rm + Re + γFH,t + Ri Ri + Rs Pint

t

+ Re Re + Rm Φs

t

  • θi

t+1 =θi t + ∆T

ci

  • θw

t − θi t

Ri + Rs + θe

t − θi t

Rv + θe

t − θi t

Rf + (1 − γ)FH,t + Rs Ri + Rs Pint

t

  • which will be denoted:

Xt+1 = ft(Xt, Ut, Wt+1)

9/33

slide-12
SLIDE 12

Outline

A brief recall of the single house problem Physical modelling Optimization problem Resolution Methods Handling solar irradiation Academic modeling Realistic modeling

10/33

slide-13
SLIDE 13

Prices and temperature setpoints vary along time

0.08 0.09 0.10 0.11 0.12 0.13 0.14 0.15 0.16 Electricity price (euros) 4 8 12 16 20 24 Hours 15 16 17 18 19 20 21 Temperature setpoint [°C]

  • Tf = 24h, ∆T = 15mn
  • Electricity peak and off-peak

hours

  • πE

t = 1.5 euros/kWh

(10x higher than usual)

  • Temperature set-point

¯ θi

t = 16◦C or 20◦C 11/33

slide-14
SLIDE 14

The costs we have to pay

  • Cost to import electricity from the network

− bE

t max{0, −FNE,t+1}

  • selling

+ πE

t max{0, FNE,t+1}

  • buying

where we define the recourse variable (electricity balance): FNE,t+1

Network

= DE

t+1

  • Demand

+ F+

B,t − F− B,t

  • Battery

+ FH,t

  • Heating

+ FA,t

  • Tank

− Fpv,t

  • Solar panel
  • Virtual Cost of thermal discomfort: κth(

θi

t − ¯

θi

t deviation from setpoint

)

10 5 5 10 2 4 6 8 10

κth Piecewise linear cost Penalize temperature if below given setpoint

12/33

slide-15
SLIDE 15

Instantaneous and final costs for a single house

  • The instantaneous convex costs are

Lt(Xt, Ut, Wt+1) = −bE

t max{0, −FNE,t+1}

  • buying

+ πE

t max{0, FNE,t+1}

  • selling

+ κth(θi

t − ¯

θi

t)

  • discomfort
  • We add a final linear cost

K(XT) = −πHHT − πBBT to avoid empty stocks at the final horizon T

13/33

slide-16
SLIDE 16

That gives the following stochastic optimization problem

min

X,U

J(X, U) = E   

T−1

  • t=0

Lt(Xt, Ut, Wt+1)

  • instantaneous cost

+ K(XT)

final cost

   s.t Xt+1 = ft(Xt, Ut, Wt+1)

Dynamic

X ♭ ≤ Xt ≤ X ♯ U♭ ≤ Ut ≤ U♯ X0 = Xini σ(Ut) ⊂ σ(W1, . . . , Wt)

Non-anticipativity 14/33

slide-17
SLIDE 17

That gives the following stochastic optimization problem

min

X,U

J(X, U) = E   

T−1

  • t=0

Lt(Xt, Ut, Wt+1)

  • instantaneous cost

+ K(XT)

final cost

   s.t Xt+1 = ft(Xt, Ut, Wt+1)

Dynamic

X ♭ ≤ Xt ≤ X ♯ U♭ ≤ Ut ≤ U♯ X0 = Xini σ(Ut) ⊂ σ(W1, . . . , Wt)

Non-anticipativity

Because of the non-anticipativity constraint, we can not solve the optimization problem with standard methods (such as stochastic gradient)

14/33

slide-18
SLIDE 18

Outline

A brief recall of the single house problem Physical modelling Optimization problem Resolution Methods Handling solar irradiation Academic modeling Realistic modeling

15/33

slide-19
SLIDE 19

MPC vs SDDP: uncertainties modelling

The two algorithms use optimization scenarios to model the uncertainties: MPC SDDP

4 8 12 16 20 24 Time (h) 1 2 3 4 5 6 Load [kW]

16/33

slide-20
SLIDE 20

MPC vs SDDP: online resolution

At the beginning of time period [τ, τ + 1], do MPC

  • Consider a rolling horizon [τ, τ + H[
  • Consider a deterministic scenario of

demands (forecast)

  • W τ+1, . . . , W τ+H
  • Solve the deterministic optimization

problem

min X,U   τ+H

  • t=τ

Lt (Xt , Ut , W t+1) + K(Xτ+H )   s.t. X· = (Xτ , . . . , Xτ+H ) U· = (Uτ , . . . , Uτ+H−1) Xt+1 = f (Xt , Ut , W t+1) X♭ ≤ Xt ≤ X♯ U♭ ≤ Ut ≤ U♯

  • Get optimal solution (U#

τ , . . . , U# τ+H)

  • ver horizon H = 24h
  • Send only first control U#

τ to

assessor, and iterate at time τ + 1

SDDP

  • We consider the approximated value

functions

  • Vt

T

  • Vt
  • Piecewise affine functions

≤ Vt

  • Solve the stochastic optimization

problem:

min uτ EWτ+1

  • Lτ (Xτ , uτ , Wτ+1)

+ Vτ+1

  • fτ (Xτ , uτ , Wτ+1)
  • ⇒ this problem resumes to solve a LP at each timestep
  • Get optimal solution U#

τ

  • Send U#

τ to assessor

17/33

slide-21
SLIDE 21

A brief recall on Dynamic Programming

Dynamic Programming µt is the probability law of Wt and is being used to estimate expectation and compute offline value functions with the backward equation:

VT (x) = K(x) Vt(xt) = min

Ut

Eµt

  • Lt(xt, Ut, Wt+1)
  • current cost

+ Vt+1

  • f (xt, Ut, Wt+1)
  • future costs
  • 10

5 5 10 x 20 40 60 80 100 y

18/33

slide-22
SLIDE 22

A brief recall on Dynamic Programming

Dynamic Programming µt is the probability law of Wt and is being used to estimate expectation and compute offline value functions with the backward equation:

VT (x) = K(x) Vt(xt) = min

Ut

Eµt

  • Lt(xt, Ut, Wt+1)
  • current cost

+ Vt+1

  • f (xt, Ut, Wt+1)
  • future costs
  • Stochastic Dual Dynamic Programming

10 5 5 10 x 20 40 60 80 100 y

  • Convex value functions Vt are approximated as

a supremum of a finite set of affine functions

  • Affine functions (=cuts) are computed during

forward/backward passes, till convergence

  • SDDP makes an extensive use of LP solver
  • Vt(x) = max

1≤k≤K

  • λk

t x + βk t

  • ≤ Vt(x)

18/33

slide-23
SLIDE 23

Outline

A brief recall of the single house problem Physical modelling Optimization problem Resolution Methods Handling solar irradiation Academic modeling Realistic modeling

19/33

slide-24
SLIDE 24

How to forecast solar irradiation?

We suppose that we have available at midnight a forecast ˆ Φ, with error bounds (ε0, . . . , εT). The realization of Φt is equal to Φt = ˆ Φt × (1 + εt) .

20/33

slide-25
SLIDE 25

How to forecast solar irradiation?

We suppose that we have available at midnight a forecast ˆ Φ, with error bounds (ε0, . . . , εT). The realization of Φt is equal to Φt = ˆ Φt × (1 + εt) . Objective We aim to identify the sensitivity of the two algorithms w.r.t the modelling of εt

20/33

slide-26
SLIDE 26

How to forecast solar irradiation?

We suppose that we have available at midnight a forecast ˆ Φ, with error bounds (ε0, . . . , εT). The realization of Φt is equal to Φt = ˆ Φt × (1 + εt) . Objective We aim to identify the sensitivity of the two algorithms w.r.t the modelling of εt We model the error εt as a random variable. Different models are available:

  • First with gaussian white noise, supposing that the process

(ε0, . . . , εT) is time independent,

  • Then with an autoregressive process, to have a more accurate

modelling of the time dependency

20/33

slide-27
SLIDE 27

Outline

A brief recall of the single house problem Physical modelling Optimization problem Resolution Methods Handling solar irradiation Academic modeling Realistic modeling

21/33

slide-28
SLIDE 28

White noise process

We recall that the irradiation corresponds to a forecast and an error: Φt = ˆ Φt × (1 + εt)

20 40 60 80 200 400 600 800 1000 1200 1400

  • Irrad. [Wh/m2]

We first consider that for all t, εt is Gaussian: εt ∼ N(0, σt) and that the standard-deviation increases linearly over time σt = σ0 + (σT − σ0) t T

22/33

slide-29
SLIDE 29

Discretizing the probability laws

Numerical optimization requires the discretization of continuous variables. We use optimal quantization to approximate the continuous gaussian distribution of εt with a discrete probability distribution.

4 2 2 4 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 Distribution

Quantization of a gaussian

The probability measure of εt is approximated as µ

  • εt

n

  • i=1

πiδwi where πi is the probability that the event εt = wi occurs.

23/33

slide-30
SLIDE 30

Decision-Hazard or Hazard-Decision?

  • In Decision-Hazard, the decision Ut is taken before the realization of

the uncertainties Wt+1 in [t, t + 1[.

  • In Hazard-Decision, the decision Ut is taken after the realization of

the uncertainties Wt+1 in [t, t + 1[. Hence irrealistic, Hazard-Decision gives a lower-bound of the Decision-Hazard problem. (the more information, the better the algorithm is)

24/33

slide-31
SLIDE 31

Hazard-Decision

In HD, we know the realization wτ+1 of the uncertainties Wt+1 during the following interval [τ, τ + 1[. MPC forecasts:

  • wτ+1, E
  • Wτ+2
  • , . . . , E
  • WT
  • and solves the deterministic optimization problem.

25/33

slide-32
SLIDE 32

Hazard-Decision

In HD, we know the realization wτ+1 of the uncertainties Wt+1 during the following interval [τ, τ + 1[. MPC forecasts:

  • wτ+1, E
  • Wτ+2
  • , . . . , E
  • WT
  • and solves the deterministic optimization problem.

SDDP solves the following LP problem: min

  • Lτ(xτ, uτ, wτ+1) + θ
  • s.t

xτ+1 = fτ(xτ, uτ, wτ+1) θ ≥

  • λc

τ+1 , xτ+1

  • + βc

τ+1

∀c ∈ Cτ+1 where Cτ+1 is the set of cuts uses to approximate the value function Vτ+1.

25/33

slide-33
SLIDE 33

Decision-Hazard

In DH, we know only the probability distribution of the uncertainties Wt+1 MPC forecasts:

  • E
  • Wτ+1
  • , E
  • Wτ+2
  • , . . . , E
  • WT
  • and solves the deterministic optimization problem.

26/33

slide-34
SLIDE 34

Decision-Hazard

In DH, we know only the probability distribution of the uncertainties Wt+1 MPC forecasts:

  • E
  • Wτ+1
  • , E
  • Wτ+2
  • , . . . , E
  • WT
  • and solves the deterministic optimization problem.

SDDP solves the following LP problem: min

uτ n

  • i=1

πi

  • Lτ(xτ, uτ, w i

τ+1) + θi

s.t xi

τ+1 = fτ(xτ, uτ, w i τ+1)

∀i θi ≥

  • λc

τ+1 , xi τ+1

  • + βc

τ+1

∀i, c ∈ Cτ+1 where Cτ+1 is the set of cuts uses to approximate the value function Vτ+1 and n is the size of the discrete probability law.

26/33

slide-35
SLIDE 35

Numerical settings

We compare different level of uncertainties, corresponding to different final standard-deviation σT.

20 40 60 80 200 400 600 800 1000 1200 1400

  • Irrad. [Wh/m2]

20 40 60 80 200 400 600 800 1000 1200 1400

  • Irrad. [Wh/m2]

20 40 60 80 200 400 600 800 1000 1200 1400

  • Irrad. [Wh/m2]

σT = 5 % σT = 20 % σT = 40%

27/33

slide-36
SLIDE 36

Assessment scenarios

We generate nassess scenarios

20 40 60 80 100 200 400 600 800 1000 1200 1400

  • Irrad. [Wh/m2]

20 40 60 80 100 200 400 600 800 1000 1200 1400

  • Irrad. [Wh/m2]

20 40 60 80 100 200 400 600 800 1000 1200 1400

  • Irrad. [Wh/m2]

σT = 5 % σT = 20 % σT = 40%

28/33

slide-37
SLIDE 37

And then, let’s roll!

29/33

slide-38
SLIDE 38

Results

0.05 0.1 0.2 0.3 0.4

T

1.00 1.05 1.10 1.15 1.20 1.25 1.30

Cost

MPC DH SDDP DH MPC HD SDDP HD HD DH σT SDDP MPC SDDP MPC 5 % 0.976 0.987 0.984 1.006 10 % 0.979 0.999 0.984 1.038 20 % 0.981 0.994 1.034 1.104 30 % 0.984 1.027 1.077 1.187 40 % 0.983 1.070 1.202 1.296

30/33

slide-39
SLIDE 39

Outline

A brief recall of the single house problem Physical modelling Optimization problem Resolution Methods Handling solar irradiation Academic modeling Realistic modeling

31/33

slide-40
SLIDE 40

Description

Modelling solar irradiation with white noise is a shortfall. We rather have to model the process (ε0, . . . , εT) as an ARMA process. We define the nebulosity as: ns

t =

Φt Φclear

t

  • Φclear

t

is given by some trigonometric laws (position of the sun in the sky).

  • ns

t can be modelled with an AR process. 32/33

slide-41
SLIDE 41

Description

Modelling solar irradiation with white noise is a shortfall. We rather have to model the process (ε0, . . . , εT) as an ARMA process. We define the nebulosity as: ns

t =

Φt Φclear

t

  • Φclear

t

is given by some trigonometric laws (position of the sun in the sky).

  • ns

t can be modelled with an AR process.

Still a work in progress! :-)

32/33

slide-42
SLIDE 42

Conclusion

  • The more uncertainties, the better SDDP is towards MPC
  • We obtained similar results while tackling electrical and

hot water demands

  • We have to study more realistic uncertainties, corresponding to

real data

  • We aim to use decomposition algorithms to tackle bigger problems,

with a lot more houses! :-D

33/33