Model Predictive Control

Similar documents
Optimization of warehousing and transportation costs, in a multiproduct multi-level supply chain system, under a stochastic demand

Fast Model Predictive Control Using Online Optimization Yang Wang and Stephen Boyd, Fellow, IEEE

Real-Time Embedded Convex Optimization

C21 Model Predictive Control

Lecture 13 Linear quadratic Lyapunov theory

Distributed Control in Transportation and Supply Networks

Neuro-Dynamic Programming An Overview

The Heat Equation. Lectures INF2320 p. 1/88

Lecture 3. Linear Programming. 3B1B Optimization Michaelmas 2015 A. Zisserman. Extreme solutions. Simplex method. Interior point method

Solving Very Large Financial Planning Problems on Blue Gene

Operation Count; Numerical Linear Algebra

Duality in General Programs. Ryan Tibshirani Convex Optimization /36-725

Computer Graphics. Geometric Modeling. Page 1. Copyright Gotsman, Elber, Barequet, Karni, Sheffer Computer Science - Technion. An Example.

CSE 167: Lecture 13: Bézier Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

CONTROLLABILITY. Chapter Reachable Set and Controllability. Suppose we have a linear system described by the state equation

Support Vector Machine (SVM)

Linear-Quadratic Optimal Controller 10.3 Optimal Linear Control Systems

TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAA

19 LINEAR QUADRATIC REGULATOR

Reinforcement Learning

Reinforcement Learning

Solving polynomial least squares problems via semidefinite programming relaxations

A Robust Optimization Approach to Supply Chain Management

6.231 Dynamic Programming and Stochastic Control Fall 2008

An Optimized Linear Model Predictive Control Solver for Online Walking Motion Generation

Sampled-Data Model Predictive Control for Constrained Continuous Time Systems

CHAPTER 7 APPLICATIONS TO MARKETING. Chapter 7 p. 1/54

Chapter 3 Nonlinear Model Predictive Control

Identification algorithms for hybrid systems

Lecture Notes to Accompany. Scientific Computing An Introductory Survey. by Michael T. Heath. Chapter 10

Predictive Control Algorithms: Stability despite Shortened Optimization Horizons

IEEE TRANSACTIONS ON CONTROL SYSTEMS TECHNOLOGY 1

Numerical methods for American options

A linear combination is a sum of scalars times quantities. Such expressions arise quite frequently and have the form

2.3 Convex Constrained Optimization Problems

Summer course on Convex Optimization. Fifth Lecture Interior-Point Methods (1) Michel Baes, K.U.Leuven Bharath Rangarajan, U.

6.231 Dynamic Programming Midterm, Fall Instructions

Linear Threshold Units

5.1 Bipartite Matching

Lecture 7: Finding Lyapunov Functions 1

VENDOR MANAGED INVENTORY

Lecture Cost functional

AN INTRODUCTION TO NUMERICAL METHODS AND ANALYSIS

Optimization Modeling for Mining Engineers

Optimization under uncertainty: modeling and solution methods

Nonlinear Model Predictive Control: From Theory to Application

3. Interpolation. Closing the Gaps of Discretization... Beyond Polynomials

10.2 ITERATIVE METHODS FOR SOLVING LINEAR SYSTEMS. The Jacobi Method

From the Aggregate Plan to Lot-Sizing in Multi-level Production Planning

6. Cholesky factorization

Towards Dual MPC. Tor Aksel N. Heirung B. Erik Ydstie Bjarne Foss

Mathematical finance and linear programming (optimization)

Advanced Lecture on Mathematical Science and Information Science I. Optimization in Finance

Valuation of American Options

CONTROL SYSTEMS, ROBOTICS AND AUTOMATION Vol. XVI - Fault Accomodation Using Model Predictive Methods - Jovan D. Bošković and Raman K.

Introduction to the Finite Element Method (FEM)

Analysis of a Production/Inventory System with Multiple Retailers

An Introduction to Applied Mathematics: An Iterative Process

CSCI567 Machine Learning (Fall 2014)

Nonlinear Optimization: Algorithms 3: Interior-point methods

Optimization of Supply Chain Networks

Integrated support system for planning and scheduling /4/24 page 75 #101. Chapter 5 Sequencing and assignment Strategies

the points are called control points approximating curve

Equilibria and Dynamics of. Supply Chain Network Competition with Information Asymmetry. and Minimum Quality Standards

Nonlinear Programming Methods.S2 Quadratic Programming

Dynamic Network Energy Management via Proximal Message Passing

General Framework for an Iterative Solution of Ax b. Jacobi s Method

Introduction to the Finite Element Method

Sensitivity analysis of utility based prices and risk-tolerance wealth processes

Similarity and Diagonalization. Similar Matrices

The Characteristic Polynomial

Lecture 7 Circuit analysis via Laplace transform

MATH 304 Linear Algebra Lecture 20: Inner product spaces. Orthogonal sets.

Interactive applications to explore the parametric space of multivariable controllers

ECON20310 LECTURE SYNOPSIS REAL BUSINESS CYCLE

Duality of linear conic problems

A Framework Algorithm to Compute Optimal Asset Allocation for. Retirement with Behavioral Utilities

Distributed Machine Learning and Big Data

Solutions Of Some Non-Linear Programming Problems BIJAN KUMAR PATEL. Master of Science in Mathematics. Prof. ANIL KUMAR

Identification of Hybrid Systems

Agenda. Real System, Transactional IT, Analytic IT. What s the Supply Chain. Levels of Decision Making. Supply Chain Optimization

Lecture Notes 10

Optimal linear-quadratic control

Lecture 3: Linear methods for classification

Adaptive cruise controller design: a comparative assessment for PWA systems

Adaptive Control Using Combined Online and Background Learning Neural Network

DATA ANALYSIS II. Matrix Algorithms

MATH BOOK OF PROBLEMS SERIES. New from Pearson Custom Publishing!

Current Accounts in Open Economies Obstfeld and Rogoff, Chapter 2

Overview. Essential Questions. Precalculus, Quarter 4, Unit 4.5 Build Arithmetic and Geometric Sequences and Series

How will the programme be delivered (e.g. inter-institutional, summerschools, lectures, placement, rotations, on-line etc.):


Support Vector Machines

Finite Element Formulation for Plates - Handout 3 -

Dynamical Systems Analysis II: Evaluating Stability, Eigenvalues

Parallel Interior Point Solver for Structured Quadratic Programs: Application to Financial Planning Problems

Applied Computational Economics and Finance

Dual Methods for Total Variation-Based Image Restoration

The Basics of FEA Procedure

Transcription:

Model Predictive Control linear convex optimal control finite horizon approximation model predictive control fast MPC implementations supply chain management Prof. S. Boyd, EE364b, Stanford University

Linear time-invariant convex optimal control minimize J = t=0 l(x(t), u(t)) subject to u(t) U, x(t) X, t = 0,1,... x(t + 1) = Ax(t) + Bu(t), t = 0,1,... x(0) = z. variables: state and input trajectories x(0), x(1),... R n, u(0), u(1),... R m problem data: dynamics and input matrices A R n n, B R n m convex stage cost function l : R n R m R, l(0,0) = 0 convex state and input constraint sets X, U, with 0 X, 0 U initial state z X Prof. S. Boyd, EE364b, Stanford University 1

Greedy control use u(t) = argmin w {l(x(t),w) w U, Ax(t) + Bw X } minimizes current stage cost only, ignoring effect of u(t) on future, except for x(t + 1) X typically works very poorly; can lead to J = (when optimal u gives finite J) Prof. S. Boyd, EE364b, Stanford University 2

Solution via dynamic programming (Bellman) value function V (z) is optimal value of control problem as a function of initial state z can show V is convex V satisfies Bellman or dynamic programming equation V (z) = inf {l(z, w) + V (Az + Bw) w U, Az + Bw X } optimal u given by u (t) = argmin w U, Ax(t)+Bw X (l(x(t), w) + V (Ax(t) + Bw)) Prof. S. Boyd, EE364b, Stanford University 3

intepretation: term V (Ax(t) + Bw) properly accounts for future costs due to current action w optimal input has state feedback form u (t) = φ(x(t)) Prof. S. Boyd, EE364b, Stanford University 4

Linear quadratic regulator special case of linear convex optimal control with U = R m, X = R n l(x(t),u(t)) = x(t) T Qx(t) + u(t) T Ru(t), Q 0, R 0 can be solved using DP value function is quadratic: V (z) = z T Pz P can be found by solving an algebraic Riccati equation (ARE) P = Q + A T PA A T PB(R + B T PB) 1 B T PA optimal policy is linear state feedback: u (t) = Kx(t), with K = (R + B T PB) 1 B T PA Prof. S. Boyd, EE364b, Stanford University 5

Finite horizon approximation use finite horizon T, impose terminal constraint x(t) = 0: T 1 minimize τ=0 l(x(t),u(t)) subject to u(t) U, x(t) X τ = 0,..., T x(t + 1) = Ax(t) + Bu(t), τ = 0,..., T 1 x(0) = z, x(t) = 0. apply the input sequence u(0),..., u(t 1), 0,0,... a finite dimensional convex problem gives suboptimal input for original optimal control problem Prof. S. Boyd, EE364b, Stanford University 6

Example system with n = 3 states, m = 2 inputs; A, B chosen randomly quadratic stage cost: l(v, w) = v 2 + w 2 X = {v v 1}, U = {w w 0.5} initial point: z = (0.9, 0.9, 0.9) optimal cost is V (z) = 8.83 Prof. S. Boyd, EE364b, Stanford University 7

Cost versus horizon 12 11.5 11 Vfha(z) 10.5 10 9.5 9 8.5 T dashed line shows V (z); finite horizon approximation infeasible for T 9 Prof. S. Boyd, EE364b, Stanford University 8

Trajectories 1 T = 10 1 T = x1(t) 0.5 0 0.5 1 0.5 0 0.5 1 0.5 0.5 u(t) 0 0 0.5 t 0.5 t Prof. S. Boyd, EE364b, Stanford University 9

Model predictive control (MPC) at each time t solve the (planning) problem t+t minimize τ=t l(x(τ),u(τ)) subject to u(τ) U, x(τ) X, τ = t,..., t + T x(τ + 1) = Ax(τ) + Bu(τ), τ = t,..., t + T 1 x(t + T) = 0 with variables x(t + 1),..., x(t + T), u(t),..., u(t + T 1) and data x(t), A, B, l, X, U call solution x(t + 1),..., x(t + T), ũ(t),...,ũ(t + T 1) we interpret these as plan of action for next T steps we take u(t) = ũ(t) this gives a complicated state feedback control u(t) = φ mpc (x(t)) Prof. S. Boyd, EE364b, Stanford University 10

MPC performance versus horizon 12 11.5 11 10.5 J 10 9.5 9 8.5 T solid: MPC, dashed: finite horizon approximation, dotted: V (z) Prof. S. Boyd, EE364b, Stanford University 11

MPC trajectories 1 MPC, T = 10 1 T = x1(t) 0.5 0 0.5 1 0.5 0 0.5 1 0.5 0.5 u1(t) 0 0.5 t 0 0.5 t Prof. S. Boyd, EE364b, Stanford University 12

MPC goes by many other names, e.g., dynamic matrix control, receding horizon control, dynamic linear programming, rolling horizon planning widely used in (some) industries, typically for systems with slow dynamics (chemical process plants, supply chain) MPC typically works very well in practice, even with short T under some conditions, can give performance guarantees for MPC Prof. S. Boyd, EE364b, Stanford University 13

Variations on MPC add final state cost ˆV (x(t + T)) instead of insisting on x(t + T) = 0 if ˆV = V, MPC gives optimal input convert hard constraints to violation penalties avoids problem of planning problem infeasibility solve MPC problem every K steps, K > 1 use current plan for K steps; then re-plan Prof. S. Boyd, EE364b, Stanford University 14

Explicit MPC MPC with l quadratic, X and U polyhedral can show φ mpc is piecewise affine φ mpc (z) = K j z + g j, z R j R 1,..., R N is polyhedral partition of X (solution of any QP is PWA in righthand sides of constraints) φ mpc (i.e., K j, g j, R j ) can be computed explicitly, off-line on-line controller simply evaluates φ mpc (x(t)) (effort is dominated by determining which region x(t) lies in) Prof. S. Boyd, EE364b, Stanford University 15

can work well for (very) small n, m, and T number of regions N grows exponentially in n, m, T needs lots of storage evaluating φ mpc can be slow simplification methods can be used to reduce the number of regions, while still getting good control Prof. S. Boyd, EE364b, Stanford University 16

MPC problem structure MPC problem is highly structured (see Convex Optimization, 10.3.4) Hessian is block diagonal equality constraint matrix is block banded use block elimination to compute Newton step Schur complement is block tridiagonal with n n blocks can solve in order T(n + m) 3 flops using an interior point method Prof. S. Boyd, EE364b, Stanford University 17

Fast MPC can obtain further speedup by solving planning problem approximately fix barrier parameter; use warm-start (sharply) limit the total number of Newton steps results for simple C implementation problem size QP size run time (ms) n m T vars constr fast mpc SDPT3 4 2 10 50 160 0.3 150 10 3 30 360 1080 4.0 1400 16 4 30 570 1680 7.7 2600 30 8 30 1110 3180 23.4 3400 can run MPC at kilohertz rates Prof. S. Boyd, EE364b, Stanford University 18

n nodes (warehouses/buffers) Supply chain management m unidirectional links between nodes, external world x i (t) is amount of commodity at node i, in period t u j (t) is amount of commodity transported along link j incoming and outgoing node incidence matrices: { A in(out) 1 link j enters (exits) node i ij = 0 otherwise dynamics: x(t + 1) = x(t) + A in u(t) A out u(t) Prof. S. Boyd, EE364b, Stanford University 19

Constraints and objective buffer limits: 0 x i (t) x max (could allow x i (t) < 0, to represent back-order) link capacities: 0 u i (t) u max A out u(t) x(t) (can t ship out what s not on hand) shipping/transportation cost: S(u(t)) (can also include sales revenue or manufacturing cost) warehousing/storage cost: W(x(t)) objective: t=0 (S(u(t)) + W(x(t))) Prof. S. Boyd, EE364b, Stanford University 20

Example n = 5 nodes, m = 9 links (links 8, 9 are external links) u 3 x 1 x 2 u 2 u 5 u 1 x 3 u 7 u 4 u 6 x 5 x 4 u 8 u 9 Prof. S. Boyd, EE364b, Stanford University 21

Example x max = 1, u max = 0.05 storage cost: W(x(t)) = n i=0 (x i(t) + x i (t) 2 ) shipping cost: S(u(t)) = u 1 (t) + + u 7 (t) }{{} transportation cost initial stock: x(0) = (1,0,0,1, 1) (u 8 (t) + u 9 (t)) }{{} revenue we run MPC with T = 5, final cost ˆV (x(t + T)) = 10(1 T x(t + T)) optimal cost: V (z) = 68.2; MPC cost 69.5 Prof. S. Boyd, EE364b, Stanford University 22

MPC and optimal trajectories x1(t), x3(t) 1 0.5 MPC 0 1 0.5 optimal 0 u3(t), u4(t) 0.06 0.04 0.02 0 t 0.06 0.04 0.02 0 t solid: x 3 (t), u 4 (t); dashed: x 1 (t), u 3 (t) Prof. S. Boyd, EE364b, Stanford University 23

Variations on optimal control problem time varying costs, dynamics, constraints discounted cost convergence to nonzero desired state tracking time-varying desired trajectory coupled state and input constraints, e.g., (x(t), u(t)) P (as in supply chain management) slew rate constraints, e.g., u(t + 1) u(t) u max stochastic control: future costs, dynamics, disturbances not known (next lecture) Prof. S. Boyd, EE364b, Stanford University 24