65
General rights Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights. Users may download and print one copy of any publication from the public portal for the purpose of private study or research. You may not further distribute the material or use it for any profit-making activity or commercial gain You may freely distribute the URL identifying the publication in the public portal If you believe that this document breaches copyright please contact us providing details, and we will remove access to the work immediately and investigate your claim. Downloaded from orbit.dtu.dk on: Aug 12, 2019 Computational Methods for Model Predictive Control New Opportunities for Computational Scientists Jørgensen, John Bagterp; Boiroux, Dimitri; Hovgaard, Tobias Gybel; Halvgaard, Rasmus; Skajaa, Anders; Gade-Nielsen, Nicolai Fog; Standardi, Laura; Sokoler, Leo Emil; Völcker, Carsten; Capolei, Andrea Publication date: 2012 Document Version Publisher's PDF, also known as Version of record Link back to DTU Orbit Citation (APA): Jørgensen, J. B. (Author), Boiroux, D. (Author), Hovgaard, T. G. (Author), Halvgaard, R. (Author), Skajaa, A. (Author), Gade-Nielsen, N. F. (Author), ... Duun-Henriksen, A. K. (Author). (2012). Computational Methods for Model Predictive Control: New Opportunities for Computational Scientists. Sound/Visual production (digital), Technical University of Denmark (DTU).

Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Embed Size (px)

Citation preview

Page 1: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

General rights Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights.

Users may download and print one copy of any publication from the public portal for the purpose of private study or research.

You may not further distribute the material or use it for any profit-making activity or commercial gain

You may freely distribute the URL identifying the publication in the public portal If you believe that this document breaches copyright please contact us providing details, and we will remove access to the work immediately and investigate your claim.

Downloaded from orbit.dtu.dk on: Aug 12, 2019

Computational Methods for Model Predictive ControlNew Opportunities for Computational Scientists

Jørgensen, John Bagterp; Boiroux, Dimitri; Hovgaard, Tobias Gybel; Halvgaard, Rasmus; Skajaa,Anders; Gade-Nielsen, Nicolai Fog; Standardi, Laura; Sokoler, Leo Emil; Völcker, Carsten; Capolei,Andrea

Publication date:2012

Document VersionPublisher's PDF, also known as Version of record

Link back to DTU Orbit

Citation (APA):Jørgensen, J. B. (Author), Boiroux, D. (Author), Hovgaard, T. G. (Author), Halvgaard, R. (Author), Skajaa, A.(Author), Gade-Nielsen, N. F. (Author), ... Duun-Henriksen, A. K. (Author). (2012). Computational Methods forModel Predictive Control: New Opportunities for Computational Scientists. Sound/Visual production (digital),Technical University of Denmark (DTU).

Page 2: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Computational Methods for Model Predictive Control

New Opportunities for Computational Scientists

John Bagterp Jørgensen Dimitri Boiroux, Tobias Gybel Hovgaard, Rasmus Halvgaard, Anders Skajaa, Nicolai Fog Gade-Nielsen, Laura Standardi,

Leo Emil Sokoler, Carsten Völcker, Andrea Capolei, Gianluca Frison, Signe Schmidt, Anne-Katrine Dunn Henriksen

Technical University of Denmark

PARA 2012, Finlandia Hall, Helsinki, Finland June 10-13, 2012

Page 3: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Introduction • Model Predictive Control

– Optimal Experimental Design – Parameter Estimation – State Estimation – Regulation

• Constrained Optimization of Dynamical Systems • Case Studies

– The Artificial Pancreas – Closed-Loop Oil Reservoir Management – Smart Energy Systems

2

Page 4: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

MODEL PREDICTIVE CONTROL

3

Page 5: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Systematic Model Building

4

Page 6: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Model Predictive Controller

5

Regulator

Estimator

System

Sensors

Targets Inputs

Model Predictive Controller

Outputs

Measure-ments

State-/parameter-estimate

Page 7: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Model Predictive Control

MPC =

Estimation + Regulation Moving horizon

implementation

6

Page 8: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Filtering and Prediction - EKF

Filtering

Prediction

7

Page 9: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Optimal Control Problem

Integrator (Runge-Kutta Methods) • DOPRI54 (non-stiff systems) • ESDIRK12 / ESDIRK23 / ESDIRK34 (stiff systems)

Sensitivities • Forward, Adjoint

Optimization • SQP • Single-shooting • Multiple-shooting 9

Page 10: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Insulin Administration Systems for

People with Diabetes

The Artificial Pancreas

10

Page 11: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Blood glucose control The blood glucose must stay within certain upper and lower bounds!

– Too low: coma (immediate effect) – Too high: blindness and other long-term effects

11

Page 12: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Insulin Administration Systems Pen or Pump

dosing

Continuous blood glucose monitor

Normal blood glucose level (90 mg/dL)

Control Algorithm

+

-

12

Page 13: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Systems Diagram

Man

BloodGlucose

Insulin infusionrate

Diffusion ofinsulin in

tissue

Diffusion ofglucose in

tissue

ModelPredictiveController

Subcutaneous Glucose

Physical activity /exercise

Insulininjection

Physiological System

GlucoseSensor

InsulinPump

Meal

Artificial Pancreas

GlucoseMeter

BloodGlucoseSetpoint

13

Page 14: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Physiological Models – The Virtual Patient

14

Page 15: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Physiological Models – A Compartment Model

15

Page 16: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

The Cobelli Model – and the Virtual Clinic

• Developed by – University of Virginia – University of Padova – Juvenile Diabetes Research Foundation

• 30 virtual patients in the version that we have a license to • The full version including 300 patients approved to substitute animal

tests by FDA 16

Page 17: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Clinical Trials • Gastric emptying trials (left) • Clinical trials collecting data for modeling

(right)

17

Page 18: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Example of a Clinical Experiment

8:00 Insert lines

12:30 Exercise

15:00 Snack

10:00 Meal/ bolus

18

Page 19: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Identification Results • Representative

model fit

• Very accurate model fit

• Note: Model is fit to the

CGM signal. The intravenous glucose concentration is also shown (thick line) for comparison

19

Page 20: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

The DTU Type 1 Diabetes Model

20

Page 21: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Insulin Administration Strategies

NMPC Pre-meal Insulin Allowed

NMPC No Pre-meal Insulin

MDI (Pen Based) Insulin Treatment

21

Page 22: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Closed-Loop Studies by NMPC Meals not announced Meals announced at meal-time

22

Page 23: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Overnight Stabilization – A Cohort

23

Page 24: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Clinical Closed Loop Studies

24

Page 25: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

MODEL PREDICTIVE CONTROL FOR MANAGEMENT OF OIL RESERVOIRS

25

Page 26: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

An Offshore Oil Reservoir

26

Page 27: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Mathematical Model

27

Page 28: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Closed-Loop Reservoir Management

28

Page 29: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

t

x Experimental setup Seismic data

Applied Seismology: Subsurface Imaging

29

Page 30: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

The Computational Challenge: Integrated Inversion of Seismic and Production Data

Seismic inversion History matching

Seismic data Oil production data

30

Page 31: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

History Matching (State and Parameter Est) + Seismic Data

=> Permeability Field

31

Page 32: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Optimization Problem

• Single-Shooting and SQP • ESDIRK methods tailored for this problem • Gradients computed by the adjoint method

32

Page 33: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Objective Function is the Net Present Value

33

Page 34: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Optimal Oil Field Development - MVs

34

Page 35: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Optimal Oil Field Development - CVs

35

Page 36: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Oil Field Development Using NMPC

36

Page 37: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

MODEL PREDICTIVE CONTROL OF SMART ENERGY SYSTEMS

37

Page 38: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Smart Energy Systems

38

Page 39: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Wind Power

0%

20%

40%

60%

80%

100%

120%

01-2007 03-2007 05-2007 07-2007 09-2007 11-2007 01-2008

Wind power / consumption DK-W

Wind power share in the western part of Denmark: 24 %

39

Page 40: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Wind Power Production and Imbalances

0%

20%

40%

60%

80%

100%

120%

0 5 10 15 20 25 30 35Wind speed [m/s]

Pro

duct

ion

in %

of t

otal

inst

alle

d ca

paci

ty % of installed capacity

1 m/s change in wind speed changes the production by 350

MW (DK West)

40

Page 41: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Power System Development – DK West

Centralized system of the mid 1980s

Primary production plants

Local plants

Wind turbines

More decentralized system of today 41

Page 42: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Load Balancing Controller

42

Page 43: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Models of Energy Components

43

Page 44: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Controllable Power Generators

46

Page 45: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

MPC for Economic Power Portfolio Optimization

47

Page 46: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Soft Economic MPC

48

Page 47: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Simple Test Example

49

Page 48: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Optimal Production Profiles

50

Page 49: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Cooling Houses – A Flexible Consumer • Motivation: • Refrigeration and air-conditioning consume

substantial amounts of energy. • E.g. up to 80% of energy consumed by

supermarkets goes to refrigeration.

• Methods: • Economic MPC:

Minimize the cost of cooling subject to temperature limits

• Predictions of weather, energy prices and load profiles.

• Implementation on industrial hardware.

Evaporator

Compressor

Expansionvalve

Condenser

Cold RoomOutdoorsurroundings

Suction Pressure controller

Condenser Pressure Controller

NEF

NCF

NC

Tcr

PC

PE

Qload

Pc,ref=PdewT(Ta+DT) Stored goods

MPC

Cooling system used in refrigerators and cooling houses

FPGA

52

Page 50: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Power Management 2 Power Plants and 1 Cooling House

• Economic Optimizing MPC • Minimize power consumption and costs without lowering the cooling quality • Load shifting utilizing the thermal capacity of the cooling house

53

Page 51: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Online Computing Time Tailored Primal-Dual Interior Point Algorithm

54

Page 52: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Warm Start Interior Point Methods

55

Page 53: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Accelerating LP Algorithms with GPUs

56

Page 54: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Implementation Details

57

Page 55: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Speed-Up with GPU

58

Page 56: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Dantzig-Wolfe Decomposition

59

Page 57: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Uncertainty

60

Page 58: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Uncertainty Scenarios

61

Page 59: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

The Extended LQ Problem

62

Page 60: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

KKT System for the Extended LQ Problem

63

Page 61: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

KKT System for the Extended LQ Problem

64

Page 62: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Numerical Results

65

1 1.5 2 2.5-3

-2.5

-2

-1.5

-1

-0.5

0

0.5

1C code, N=100

log10(nx)

log 10

(wal

l clo

ck ti

me)

Riccati, nu=1Riccati, nu=2Riccati, nu=5Condensing, nu=1Condensing, nu=2Condensing, nu=5MA57, nu=1MA57, nu=2MA57, nu=5

Page 63: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Numerical Results

66

1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2-3

-2.5

-2

-1.5

-1

-0.5C code, nx=50, nu=5

log10(N)

log 10

(CPU

tim

e)

RiccatiCondensingMA57

Page 64: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Summary

• There is a need for HPC software supporting MPC – QP, LP, SOCP algorithms – ODE/PDE solvers equipped with sensitivity computing

abilities (adjoints) – SQP / NLP algorithms – Efficient direct sparse and iterative methods for KKT

systems (even when they are ill-conditioned) • The number of potential applications is very large

67

Page 65: Computational Methods for Model Predictive Control - New ...orbit.dtu.dk/ws/files/12092477/Computational Methods for Model...Computational Methods for Model Predictive Control New

Center for Energy Ressources Engineering (CERE) Consortium www.cere.dtu.dk

Novo Nordisk A/S, Hvidovre Hospital, Medtronic Danfoss A/S, DONG Energy A/S, Vestas A/S, GEA Process Engineering A/S The Danish Strategic Research Council The Danish Research Council for Production and Technology Sciences

68