Computing an Optimal Control Policy for an Energy Storage Pierre - - PowerPoint PPT Presentation

computing an optimal control policy for an energy storage
SMART_READER_LITE
LIVE PREVIEW

Computing an Optimal Control Policy for an Energy Storage Pierre - - PowerPoint PPT Presentation

Intro Example of Ocean Power Smoothing solving Dynamic Optimization with Dynamic Programming Computing an Optimal Control Policy for an Energy Storage Pierre Haessig , Thibaut Kovaltchouk, Bernard Multon, Hamid Ben Ahmed, and Stphane Lascaud


slide-1
SLIDE 1

Intro Example of Ocean Power Smoothing solving Dynamic Optimization with Dynamic Programming

Computing an Optimal Control Policy for an Energy Storage

Pierre Haessig, Thibaut Kovaltchouk, Bernard Multon, Hamid Ben Ahmed, and Stéphane Lascaud

EDF R&D LME, ENS Cachan SATIE contact : pierre.haessig@ens-cachan.fr

EuroSciPy 2013, Brussels, August 24th 2013 Companion article: http://publications.pierreh.eu

1 / 16

slide-2
SLIDE 2

Intro Example of Ocean Power Smoothing solving Dynamic Optimization with Dynamic Programming

Outline of the presentation

1

Intro

2

Example of Ocean Power Smoothing

3

solving Dynamic Optimization with Dynamic Programming

2 / 16

slide-3
SLIDE 3

Intro Example of Ocean Power Smoothing solving Dynamic Optimization with Dynamic Programming

Outline of the presentation

1

Intro

2

Example of Ocean Power Smoothing

3

solving Dynamic Optimization with Dynamic Programming

3 / 16

slide-4
SLIDE 4

Intro Example of Ocean Power Smoothing solving Dynamic Optimization with Dynamic Programming

My background

Curriculum in Electrical Engineering and Control Theory → Matlab/Simulink kingdom PhD student on Electricity Storage in relation to Wind Energy Python for all my simulation and visualisation work (and a bit of R for time series analysis)

4 / 16

slide-5
SLIDE 5

Intro Example of Ocean Power Smoothing solving Dynamic Optimization with Dynamic Programming

StoDynProg: a Dynamic Optimization problem solving code

Working on the management of Energy Storage with Wind Power, I’ve progressively discovered that: my problems fall in the class of Dynamic Optimization (a quite specific problem structure) the Dynamic Programming approach exists to solve them. basic DP algorithms are “too simple to be worth implementing” !!

5 / 16

slide-6
SLIDE 6

Intro Example of Ocean Power Smoothing solving Dynamic Optimization with Dynamic Programming

StoDynProg: a Dynamic Optimization problem solving code

Working on the management of Energy Storage with Wind Power, I’ve progressively discovered that: my problems fall in the class of Dynamic Optimization (a quite specific problem structure) the Dynamic Programming approach exists to solve them. basic DP algorithms are “too simple to be worth implementing” !! So I’ve started a generic code to solve all my problems and hopefully other Dynamic Optimization problems as well. I wanted to challenge this “genericity claim” by trying it on a different problem: I took it from a topic of interest of my research group: Ocean Power Smoothing (with an Energy Storage).

5 / 16

slide-7
SLIDE 7

Intro Example of Ocean Power Smoothing solving Dynamic Optimization with Dynamic Programming

Outline of the presentation

1

Intro

2

Example of Ocean Power Smoothing

3

solving Dynamic Optimization with Dynamic Programming

6 / 16

slide-8
SLIDE 8

Intro Example of Ocean Power Smoothing solving Dynamic Optimization with Dynamic Programming

Ocean Wave Energy Harvesting

(CC-BY-NC picture by polandeze) www.flickr.com/photos/polandeze/3151015577

Harvesting electric power from Ocean Waves with “big machines” is an active area of Research & Development. There are no industrialized devices yet (unlike for wind & sun), but rather a wide variety of prototypes machines: Wave Energy Converters

E.ON P2 Pelamis, July 2011 http://www.pelamiswave.com 7 / 16

slide-9
SLIDE 9

Intro Example of Ocean Power Smoothing solving Dynamic Optimization with Dynamic Programming

Ocean Energy Converter: the SEAREV

Hydro-mechanical design from Centrale Nantes. My group involved in the electric generator design.

8 / 16

slide-10
SLIDE 10

Intro Example of Ocean Power Smoothing solving Dynamic Optimization with Dynamic Programming

Ocean Energy Converter: the SEAREV

a highly fluctuating output

1.0 0.5 0.0 0.5 1.0 speed (m/s) 1.0 0.5 0.0 0.5 1.0 200 400 600 800 time (s) 0.2 0.4 0.6 0.8 1.0 power (MW) 240 250 260 270 280 290 zoomed time (s) 0.2 0.4 0.6 0.8 1.0

SEAREV is a giant double-pendulum that swings with the waves. An electric generator “brakes” the inner wheel to generates power (Pprod = T(Ω) × Ω).

9 / 16

slide-11
SLIDE 11

Intro Example of Ocean Power Smoothing solving Dynamic Optimization with Dynamic Programming

Power smoothing

240 260 280 300 320 time (s) 0.0 0.2 0.4 0.6 0.8 1.0 Power (MW)

Pprod Pgrid

Objective of this application I want to smooth out the variations of the power production. This requires an energy buffer to store the difference (Pprod − Pgrid).

10 / 16

slide-12
SLIDE 12

Intro Example of Ocean Power Smoothing solving Dynamic Optimization with Dynamic Programming

Power smoothing using an Energy Storage

240 260 280 300 320 time (s) 0.0 0.2 0.4 0.6 0.8 1.0 Power (MW)

Pprod Pgrid

Ocean Wave Energy Converter

?

Storage Production Grid

Energy Management

Renewable Energy Source with an Energy Storage System

11 / 16

slide-13
SLIDE 13

Intro Example of Ocean Power Smoothing solving Dynamic Optimization with Dynamic Programming

Power smoothing: control of the Energy Storage

0.0 0.2 0.4 0.6 0.8 1.0 Power (MW) Pprod Pgrid average 200 250 300 350 400 time (s) 2 4 6 8 Energy Esto (MJ)

12 / 16

slide-14
SLIDE 14

Intro Example of Ocean Power Smoothing solving Dynamic Optimization with Dynamic Programming

Power smoothing: control of the Energy Storage

0.0 0.2 0.4 0.6 0.8 1.0 Power (MW) Pprod Pgrid average 200 250 300 350 400 time (s) 2 4 6 8 Energy Esto (MJ) linear policy linear policy

First, using a simple control law (~policy) . . . quite good result but storage is underused → could do better.

12 / 16

slide-15
SLIDE 15

Intro Example of Ocean Power Smoothing solving Dynamic Optimization with Dynamic Programming

Power smoothing: control of the Energy Storage

0.0 0.2 0.4 0.6 0.8 1.0 Power (MW) Pprod Pgrid average 200 250 300 350 400 time (s) 2 4 6 8 Energy Esto (MJ) linear policy linear policy

“Doing better” is defined with an additive cost function which penalizes Pgrid variations: J = 1 N E

N−1

  • k=0

cost(Pgrid(k) − Pavg)

  • with N → ∞

cost J should be minized.

12 / 16

slide-16
SLIDE 16

Intro Example of Ocean Power Smoothing solving Dynamic Optimization with Dynamic Programming

Power smoothing: control of the Energy Storage

0.0 0.2 0.4 0.6 0.8 1.0 Power (MW) Pprod Pgrid average 200 250 300 350 400 time (s) 2 4 6 8 Energy Esto (MJ) linear policy linear policy

Controlling the storage (choosing Pgrid at each time step) in order to minimize a cost function is a Stochastic Dynamic Optimization problem (also called Stochastic Optimal Control)

12 / 16

slide-17
SLIDE 17

Intro Example of Ocean Power Smoothing solving Dynamic Optimization with Dynamic Programming

Power smoothing: control of the Energy Storage

0.0 0.2 0.4 0.6 0.8 1.0 Power (MW) Pprod Pgrid average 200 250 300 350 400 time (s) 2 4 6 8 Energy Esto (MJ) linear policy linear policy

Dynamic Programming (Richard Bellman, ~1950) teaches us that the optimal control is a state feedback policy: Pgrid(t) = µ(x(t)) with x = (Esto, speed, accel)

12 / 16

slide-18
SLIDE 18

Intro Example of Ocean Power Smoothing solving Dynamic Optimization with Dynamic Programming

Power smoothing: control of the Energy Storage

0.0 0.2 0.4 0.6 0.8 1.0 Power (MW) Pprod Pgrid average 200 250 300 350 400 time (s) 2 4 6 8 Energy Esto (MJ) linear policy linear policy

Dynamic Programming (Richard Bellman, ~1950) teaches us that the optimal control is a state feedback policy: Pgrid(t) = µ(x(t)) with x = (Esto, speed, accel) And DP gives us methods to compute this policy function µ. . .

12 / 16

slide-19
SLIDE 19

Intro Example of Ocean Power Smoothing solving Dynamic Optimization with Dynamic Programming

Power smoothing: control of the Energy Storage

0.0 0.2 0.4 0.6 0.8 1.0 Power (MW) Pprod Pgrid average 200 250 300 350 400 time (s) 2 4 6 8 Energy Esto (MJ) linear policy

  • ptimized

policy

  • ptimized

policy linear policy

And now applying the optimal feedback policy µ∗, the standard deviation of the power injected to the grid is reduced by ~20 % compared to the heuristic policy. This improvement just comes from a smarter use of the stored energy.

12 / 16

slide-20
SLIDE 20

Intro Example of Ocean Power Smoothing solving Dynamic Optimization with Dynamic Programming

Outline of the presentation

1

Intro

2

Example of Ocean Power Smoothing

3

solving Dynamic Optimization with Dynamic Programming

13 / 16

slide-21
SLIDE 21

Intro Example of Ocean Power Smoothing solving Dynamic Optimization with Dynamic Programming

Dynamic Programming equation

In the end, the optimization problem turns into solving the DP equation: J + ˜ J(x) = min

u∈U(x) E w

  • cost(x, u, w)
  • instant cost

+ ˜ J(f (x, u, w))

  • cost of the future
  • u is control and w is random perturbation, using generic notations

It is a functional equation: should be solved for all x The optimal policy µ : x → u appears as the argmin. The DP equation is solved on a discrete grid over the state space. With x ∈ Rn, ˜ J and µ are computed as n-d numpy arrays.

14 / 16

slide-22
SLIDE 22

Intro Example of Ocean Power Smoothing solving Dynamic Optimization with Dynamic Programming

Equation solving, Multilinear interpolator

The resolution is done purely in Python. Basically a giant for loop with an argmin inside. numpy for handling arrays, with a good amount of vectorization itertools to iterate over the state space grid (of arbitrary dimension) (introspect for some signature analysis magic)

15 / 16

slide-23
SLIDE 23

Intro Example of Ocean Power Smoothing solving Dynamic Optimization with Dynamic Programming

Equation solving, Multilinear interpolator

The resolution is done purely in Python. Basically a giant for loop with an argmin inside. numpy for handling arrays, with a good amount of vectorization itertools to iterate over the state space grid (of arbitrary dimension) (introspect for some signature analysis magic) Extremely useful code reuse: a multilinear interpolator by Pablo Winant (within its dolo project: github.com/albop/dolo). Uses Jinja templates to generate Cython code for dimension 1-5. Learning of this project (on scipy ML) saved me weeks, if not months !

15 / 16

slide-24
SLIDE 24

Intro Example of Ocean Power Smoothing solving Dynamic Optimization with Dynamic Programming

Conclusion

mayavi.surf plot of the optimal storage policy

Code should be soon on GitHub (github.com/pierre-haessig). Decent Sphinx doc with examples (and complete code for SEAREV example), but ridiculous test coverage.

16 / 16