Modelling & Control of Drinkable Water Networks

688 views

Published on

Modelling and Control of Drinkable Water Networks. Presentation at the 1st technical workshop of the FP7 research project EFFINET in Limassol, Cyprus, 5-6 June 2013. The main developments within WP2 are presented: Understanding the water demand patterns, development of time-series models for the water demand, formulation and solution of Model Predictive Control (MPC) problems for the water network and quantification of the effect that the prediction errors have on the optimal solution and on the closed-loop behaviour of the controlled system.

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
688
On SlideShare
0
From Embeds
0
Number of Embeds
13
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Modelling & Control of Drinkable Water Networks

  1. 1. Modelling  &  Control  of  Drinking  Water  Networks  Pantelis  Sopasakis,  IMTL    
  2. 2. The  Closed  Loop    Energy  Price  Water  Demand  DWN  Model  Predic?ve  Controller(s)  (running  on  GPUs+CPUs)  Online  Measurements  Flow  Pressure  Quality  Forecast  Module  Historical  Data  Data  Valida?on  Module  Validated  Measurements  
  3. 3. The  Closed  Loop  1.  Time-­‐series  Stochas4c  Models  2.  Hydraulic  Model  of  the  DWN  3.  Pressure  Constraints  4.  Model  Predic4ve  Controllers    Energy  Price  Water  Demand  DWN  Model  Predic?ve  Controller(s)  (running  on  GPUs+CPUs)  Online  Measurements  Flow  Pressure  Quality  Forecast  Module  Historical  Data  Data  Valida?on  Module  Validated  Measurements  
  4. 4. Requirements  Requirements  of  WP2:  Involved  Partners:  IMTL,  IRI,  AASI,  SGAB,  WBL  •  Construct  models  for  MPC  (Model  Predic?ve  Control),  based  on  mass-­‐balance  equa?ons  accompanied  by  constraints,  •  Define  risk-­‐sensi?ve  cost  func?ons  to  be  op?mised,  •  Devise  stochas?c  models  for  the  water  demand,  •  Develop  stochas?c  models  for  the  energy  prices  in  the  day-­‐ahead  market.  Implementa4on:  •  Prototype  applica?on  in  MATLAB/Simulink,  •  Control-­‐Oriented  models  available  in  MATLAB.  
  5. 5. Control-­‐Oriented  Modelling  The  mass-­‐balance  equa?ons  of  the  water  network  yield  an  Linear  Time-­‐Invariant  dynamical  model  in  the  following  form:    Disturbance  Model  (Stochas?c):  Note:  The  uncertainty  is  considered  to  be  bounded  and  possibly  discrete.  The  demand  requirements  can  be  cast  as  equality  constraints:  The  state  and  input  variables  are  bounded  in  convex  sets  (usually  boxes):  xk 2 X, 8k 2 Nuk 2 U, 8k 2 NAlterna?vely,  we  may  impose  bounds  on  the  probability  of  cosntraints’  viola?on,  e.g.,    xk+1 = Axk + Buk + Gddkyk = xkEuk + Eddk = 0dk|k = dkdk+i+1|k = ˆdk+i|k + ✏k+i|k✏k ⇠ Ekprob(xk 2 X) ✓x,8k 2 NJ.  M.  Grosso,  C.  Ocampo-­‐Matrínez  and  V.  Puig  (2013),  Learning-­‐based  tuning  of  supervisory  model  predic4ve  control  for  drinking,  Engineering  Applica?ons  of  Ar?ficial  Intelligence,  In  Print.  
  6. 6. Demand  Forecas?ng  Ini4al  Observa4ons:  •  Non-­‐sta4onarity:  Apparently  seasonally  governed  paNern,  •  ACF  (AutoCorrela?on  Func?on):  Rather  high  MA  content  •  PACF  (Par?al  ACF):  High  AR  content  
  7. 7. Demand  Forecas?ng  Ini4al  Observa4ons:  •  Non-­‐sta?onarity:  Apparently  seasonally  governed  pacern,  •  ACF  (AutoCorrela4on  Func4on):  Rather  high  MA  content  •  PACF  (Par?al  ACF):  High  AR  content  
  8. 8. Demand  Forecas?ng  Ini4al  Observa4ons:  •  Non-­‐sta?onarity:  Apparently  seasonally  governed  pacern,  •  ACF  (AutoCorrela?on  Func?on):  Rather  high  MA  content  •  PACF  (Par4al  ACF):  High  AR  content  
  9. 9. Demand  Forecas?ng  Ini4al  Observa4ons:  •  Non-­‐sta?onarity:  Apparently  seasonally  governed  pacern,  •  ACF:  Rather  high  MA  content  •  PACF:  High  AR  content  Numerical  Experiments  SARIMA(ARz }| {{1 : 4, 6 : 9},Iz}|{1 ,MAz }| {{1 : 13, 15, 17};sz}|{168 )⇥SAR({168, 336})
  10. 10. SARIMA(ARz }| {{1 : 4, 6 : 9},Iz}|{1 ,MAz }| {{1 : 13, 15, 17};sz}|{168 )⇥SAR({168, 336})About  this  model:  -­‐  Exhibits  the  lowest  pMSE*  (0.1049)  and  pRMSE  (0.3239)  amongst  other  tested  models  -­‐  Combines  simplicity  with  predic?ve  power:  the  lowest  AIC  (Akaike  Informa?on  Criterion)  value  (-­‐8.50)  and  SC  (-­‐8.45)  -­‐  It  is  inver?ble  -­‐  Its  residuals  pass  the  Ljung-­‐Box  test  for  uncorrelated  residuals  with  p-­‐value  0.29.  -­‐  Its  parameters  were  determined  with  high  sta?s?cal  certainty.    However:  -­‐  It  fails  to  pass  the  Kolmogorov-­‐Smirnov  test  for  normality.  * pMSE : Prediction Mean Square Error
  11. 11. Demand  Forecas?ng  d(!)k =(d(!)k 1! , ! 6= 0,log (dk) , ! = 0,d(!)k = lk 1 + bk 1 +PXi=1s(i)k mi+ hk,lk = lk 1 + bk 1 + ↵dhk,bk = bk 1 + dhk,s(i)k = s(i)k mi+ d,ihk,hk =pXi=1ihk i +qXi=1✓i"k i + "k.B    A    T    S  Box-­‐Cox  Transforma?on  Trend  ARMA  Errors  Seasonal  Mul4seasonal  decomposi4on  of  the  4me  series.  J.  M.  Grosso,  C.  Ocampo-­‐Matrínez  and  V.  Puig  (2013),  Learning-­‐based  tuning  of  supervisory  model  predic4ve  control  for  drinking,  Engineering  Applica?ons  of  Ar?ficial  Intelligence,  In  Print.  
  12. 12. Demand  Forecas?ng  d(!)k =(d(!)k 1! , ! 6= 0,log (dk) , ! = 0,d(!)k = lk 1 + bk 1 +PXi=1s(i)k mi+ hk,lk = lk 1 + bk 1 + ↵dhk,bk = bk 1 + dhk,s(i)k = s(i)k mi+ d,ihk,hk =pXi=1ihk i +qXi=1✓i"k i + "k.B    A    T    S  Box-­‐Cox  Transforma?on  Trend  ARMA  Errors  Seasonal  Distribu4on  of  the    residuals  A.M.  De  Livera,  R.J.  Hyndman,  and  R.D.  Snyder  (2011),  Forecas4ng  4me  series  with  complex  seasonal  paNerns  using  exponen4al  smoothing,  Journal  of  the  American  Sta?s?cal  Associa?on,  106(496),  1513–1527.    
  13. 13. Model  Predic?ve  Control  •  Op?mal  Control  Strategy  •  Sa?sfac?on  of  state  and  input  constraints  •  Perfectly  fit  for  real-­‐life  applica?ons:  Works  with  inaccurate  models  &  in  presense  of  disturbances.  J.  B.  Rawlings  and  D.  Q.  Mayne  (2009),  Model  predic4ve  control:  theory  and  design,  Nob  Hil  Publishing.  
  14. 14. Cost  Func?ons  Goal:  Introduce  cost  funcPons  so  as  to:    o  Minimise  the  total  energy  consump?on  o  Minimise  varia?ons  of  the  control  signal  (A  motor  consumes  6  to  8  ?mes  its  nominal  opera?ng  current  on  startup)  o  Op?mise  the  performance  of  the  water  network  o  (Try  to)  Stay  over  minimum  safety  volume.  JHu,Hp (xk, uk, k) =Electricityz }| {Xi2N[0,Hu]`w(uk+i|k, k) +Smooth Operationz }| {Xi2N[0,Hu 1]` ( uk+i|k)+Xi2N[0,Hp 1]`S(sk+i|k)| {z }Safety Storage
  15. 15. Cost  Func?ons  `w(uk, ↵k) , k↵kukk1`s(xk) = k[xsxk]+k2WxGoal:  Introduce  cost  funcPons  so  as  to:    o  Minimise  the  total  energy  consump?on  o  Minimise  varia?ons  of  the  control  signal  (A  motor  consumes  6  to  8  ?mes  its  nominal  opera?ng  current  on  startup)  o  Op?mise  the  performance  of  the  water  network  o  (Try  to)  Stay  over  minimum  safety  volume.  ` ( uk) , k ukk2Wu
  16. 16. The  MPC  Problem  P†Hp,Hu(xk, dk, k) :J?Hu,Hp(xk, dk, k) = minuk,⌅kJHu,Hp(xk, uk, ⌅k, uk, k)subject to:xmin xk+i|k  xmax, 8i 2 N[1,Hp 1]umin uk+i|k  umax, 8i 2 N[0,Hu]xk+i+1|k = Axk+i|k + Buk+i|k + Gdˆdk+i|k, 8i 2 N[0,Hp 1]Euk+i|k + Edˆdk+i|k = 0, 8i 2 N[0,Hu]uk+j|k = uk+Hu|k, 8j 2 N[Hu+1,Hp 1]⇠k+i|k xmaxxk+i|k, 8i 2 N[0,Hp]⇠k+i|k 0, 8i 2 N[0,Hp]ˆdk|k = dkxk|k = xkGiven  the  current  (measured)  state  of  the  system,  the  current  demand  and  a  sequence  of  predicted  demands,  solve  the  following  op?misa?on  problem:  Constraints  Op?misa?on  Problem  C.  Ocampo-­‐Matrínez,  V.  Puig,  G.  Cembrano,  R.  Creus  and  M.  Milnoves  (2009),  Improving  water  management  efficiency  by  using  op4miza4on-­‐based  control  strategies:  The  Barcelona  Case  Study,  Water  Sci  &  Tech:  Water  Supply,  9(5),  565-­‐575.  
  17. 17. The  MPC  Problem  Given  the  current  (measured)  state  of  the  system,  the  current  demand  and  a  sequence  of  predicted  demands,  solve  the  following  op?misa?on  problem:  This  can  be  formulated  as  a  Constrained  QP  problem:  J?Hu,Hp(xk, dk, k) = minyV (y)subject to:Gy = (dk)Fy  (xk, dk)yl  y  yhfrom  which  the  control  acPon  is  calculated  and  applied  to  the  system.  C.  Ocampo-­‐Matrínez,  V.  Puig,  G.  Cembrano,  R.  Creus  and  M.  Milnoves  (2009),  Improving  water  management  efficiency  by  using  op4miza4on-­‐based  control  strategies:  The  Barcelona  Case  Study,  Water  Sci  &  Tech:  Water  Supply,  9(5),  565-­‐575.  
  18. 18. The  MPC  Problem  System  Size:  63  states  114  inputs  88  disturbances  Computa4onal  Time:  Formula?on:  2.21  s  Update:  0.055  s  Solu?on:  1.85  s  Closed-­‐Loop  Simula?ons  in  15  LOC!  Op4misa4on  Problem  Size:    ~4.2k  decision  variables  ~4.5k  affine  inequali?es  ~1.5  bound  constraints  ~400  equality  constraints  E.  Caini,  V.  Puig  and  G.  Cembrano  (2009),  Development  of  a  simula4on  environment  for  Water  Drinking  Networks:  Applica4on  to  the  Valida4on  of  a  Centralized  MPC  Controller  for  the  Barcelona  Case  Study,  Technical  Report,  IRI-­‐TR-­‐09-­‐03,  UPC/IRI.  
  19. 19. Closed-­‐loop  Simula?ons  The  predic4on  error  affects  the  shape  of  the  closed-­‐loop  trajectories…  MPC  with  a  perfect  predictor  
  20. 20. Closed-­‐loop  Simula?ons  MPC  Control  Ac4ons  using  a  Seasonal  ARIMA  predictor.  MPC  with  a  perfect  predictor  
  21. 21. Closed-­‐loop  Simula?ons  €579.1€593.4MPC  with  a  perfect  predictor   MPC:  demand  forecas4ng  with  an  ARIMA  model  
  22. 22. Closed-­‐loop  Simula?ons  PMSEHp,k =HpXi=0( ˆdk+i|k dk+i)2Inaccurate  Predic?ons  
  23. 23. Open  Issues  •  Formula?on  of  Control  problems  for  other  objec?ves  (leak  isola?on,  quality  control)  •  Demand  Forecas?ng:  Exogenous  T.S.  Analysis  (JM).  •  Numerical  Issues:  The  Hessian  appears  to  be  near-­‐singular    Becer  precondi?oning  is  necessary  •  Other  formula?ons  of  the  QP  to  be  examined  •  The  MPC  control  law  should  be  recursively  feasible  •  Formula?on  of  a  robust  control  problem  •  Incorpora?on  of  nonlinear  pressure  constraints  •  Experiment  with  Fast  MPC  methods  •  Design  &  Establishment  of  an  API  Hessian’s sparsitypattern
  24. 24. Risk-­‐Sensi?ve  Cost  Func?ons  J(xk, uk, ⌅k, uk, k) =(E + cD) {J(xk, uk, ⌅k, uk, k)}Mean-­‐Risk  Cost  Func?on  DJ = V @R↵(J)= inft{prob(J  t) 1 ↵}for  instance:  J?(xk, dk, k) = minuk,⌅kJ(xk, uk, ⌅k, uk, k)subject to:prob(xmin xk+i|k  xmax) ✓x, 8i 2 N[1,Hp 1]etc.where:  Chance  Constraints  Measure  of  Dispersion  
  25. 25. Acknowledgements  •  Juan  Manuel  Grosso  Pérez,  UPC  •  Ajay  Kumar  Sampathirao,  IMTL  •  Carlos  Ocampo-­‐Marqnez,  UPC  •  Vicenç  Puig,  UPC  
  26. 26. Thank you for your attention!
  27. 27. Appendix  •  Invariance  and  Feasibility  Analysis  •  Fast  computa?on  of  the  op?mal  solu?on  •  Addi?onal  Diagrams  
  28. 28. Feasibility  Analysis  dk+1|k = ˆdk+1|k + ✏kARIMA  es?mate:   ˆdk+1|k =LXi=0↵idk i|k ) pk+1|k = Kpk + M✏kBounded  Error  pk =26664dkdk 1...dk L37775 K =2666664↵0 ↵1 · · · ↵L 1 ↵L1 0 · · · 0 00 1 · · · 0 0.........0 0 · · · 1 03777775xk+i+1|kpk+i+1|k| {z }#k+i+1|k=A ¯Gd0 K| {z }xk+i|kpk+i|k| {z }#k+i|k+B0| {z }⌦uk+i|k +0M| {z }R✏k+i|kRewriPng  the  ARIMA  model  in  state  space  form…  
  29. 29. Feasibility  Analysis  #k+i+1|k = #k+i|k + ⌦uk+i|k + R✏k+i|k✏k+i|k 2 E ⇢⇢ RSX ⇥ Rnd(L+1)( # + ⌦u) RE#S ✓ Pre(S)For   the   set   S   to   be   robustly   control  invariant,  the  following  has  to  hold  true:  But  we  should  keep  in  mind  that  p  is  the  uncontrollable  part  of  the  system,  i.e.,  :  p+= Kp + M✏Dimension:  ~70.000  So   in   order   to   find   such   as   a   (nonempty)  set  S,  it  is  necessary  that  the  trajectory  of  p  is  bounded  for  all  ε.  *  The  feasibility  analysis  with  the  assumpPon  that  the  predictor  is  accurate  is  easier.  
  30. 30. Feasibility  Analysis  Expanding  predic4on  error:  Impossible  to  guarantee  recursive  feasibility!  But,  we  know  that  the  disturbance  is  bounded!    d 2 D = {d|Cd  g}Thus,  the  predic?on  error  has  to  be  bounded  as  follows:  ✏ 2 E(p) =⇢✏CM✏  g CKp|✏|  ✏max , (✏, p) 2 gph(E)We  then  need  to  determine  a  set  S  so  that:  24xp✏35 2 S )24x+p+✏35 2 S, 8(✏, p) 2 gph(E)
  31. 31. J?Hu,Hp(xk, dk, k) = minuk,⌅kJHu,Hp(xk, uk, ⌅k, uk, k)subject to:Box Constraints:⇢xmin xk+i|k  xmax, 8i 2 N[1,Hp 1]umin uk+i|k  umax, 8i 2 N[0,Hu]xk+i+1|k = Ixk+i|k + Buk+i|k + Gdˆdk+i|k, 8i 2 N[0,Hp 1]Euk+i|k + Edˆdk+i|k = 0, 8i 2 N[0,Hu]uk+j|k = uk+Hu|k, 8j 2 N[Hu+1,Hp 1]⇠k+i|k xmaxxk+i|k, 8i 2 N[0,Hp]⇠k+i|k 0, 8i 2 N[0,Hp]Fast  Solu?on  Methods  There  are  certain  characteris?cs  of  the  op?misa?on  problem  that  can  be  exploited  to  accelerate  the  computa?on  of  the  op?mal  solu?on:  E  and  Ed  are    very  sparse  P.  Patrinos,  P.  Sopasakis  and  .  Sarimveis  (2011),  A  global  piecewise  smooth  Newton  method  for  fast  large-­‐scale  model  predic4ve  control,  Automa?ca  47,  2016-­‐2022.  
  32. 32. Simula?ons  
  33. 33. Topology  of  Barcelona’s  DWN  

×