Model Predictive Control (MPC)

Model Predictive Control Model Predictive Control (MPC)      Overview of Model Predictive Control Impulse/Step Response Model Identification Pr...
Author: Corey Phillips
17 downloads 0 Views 3MB Size
Model Predictive Control

Model Predictive Control (MPC)     

Overview of Model Predictive Control Impulse/Step Response Model Identification Predictions for SISO and MIMO Models Model Predictive Control Calculations Selection of Design and Tuning Parameters

1

Model Predictive Control

MPC - Motivation •

Practical Problems – – – –



multivariable difficult dynamic behavior nonlinear constraints (input, output)

Overall Objectives of MPC – – –

Prevent violations of input and output constraints. Drive some output variables to their optimal set points, while maintaining other outputs within specified ranges. Prevent excessive movement of the input variables.

2

MPC - Basic Concepts Model Predictive Control

1.

Future values of output variables are predicted using a dynamic model of the process and current measurements. •

2. 3.

The control calculations are based on both future predictions and current measurements. The manipulated variables, u(k), at the k-th sampling instant are calculated so that they minimize an objective function, J. •

4. 5.

Unlike time delay compensation methods, the predictions are made for more than one time delay ahead.

Example: Minimize the sum of the squares of the deviations between predicted future outputs and specific reference trajectory.

Inequality & equality constraints, and measured disturbances are included in the control calculations. The calculated manipulated variables are implemented as set point for lower level control loops. (cf. cascade control). 3

Model Predictive Control

MPC Block Diagram



Basic Elements of MPC  Reference Trajectory Specification  Process Output Prediction (using Model)  Control Action Sequence Computation (programming problem)  Error Prediction Update (feedback) 4

Model Predictive Control

Control Hierarchy

5

MPC - Calculations Model Predictive Control

1.

At the k-th sampling instant, the values of the manipulated variables, u, at the next M sampling instants, {u(k), u(k+1), …, u(k+M -1)} are calculated. • This set of M “control moves” is calculated so as to minimize the predicted deviations from the reference trajectory over the next P sampling instants while satisfying the constraints. • Typically, an LP or QP problem is solved at each sampling instant. • Terminology: M = control horizon, P = prediction horizon

2.

Then the first “control move”, u(k), is implemented.

3.

At the next sampling instant, k+1, the M-step control policy is re-calculated for the next M sampling instants, k+1 to k+M, and implement the first control move, u(k+1).

4.

Then Steps 1 and 2 are repeated for subsequent sampling instants. Note: This approach is an example of a receding horizon approach. 6

Model Predictive Control

Figure 20.2 Basic concept for Model Predictive Control 7

Model Predictive Control

Moving Horizon Concept of MPC

8

Model Predictive Control

When Should MPC be Used? 1.

Processes are difficult to control with standard PID algorithm (e.g., large time constants, substantial time delays, inverse response, etc.)

2.

There is significant process interactions between u and y. • i.e., more than one manipulated variable has a significant effect on an important process variable.

3.

Constraints (limits) on process variables and manipulated variables are important for normal control.

Terminology: • y ↔ CV, u ↔ MV, d ↔ DV 9

MPC History Model Predictive Control

• Model Algorithmic Control (MAC) (1978) – Finite impulse response model

• Dynamic Matrix Control (DMC) (1980) – Step response model – Control calculation by least-squares method (no constraints)

• Quadratic Dynamic Matrix Control (QDMC) (1984) – Step response model – Control calculation by quadratic programming (with constraints)

• Generalized Predictive Control (GPC) (1987) – Transfer function model

• Nonlinear Model Predictive Control (NMPC)

• Over 5000 applications of MPC since 1980 (Qin and Badgwell, 2003) 10

Dynamic Models for MPC Model Predictive Control

• Could be either: 1. Physical or empirical (but usually empirical) 2. Linear or nonlinear (but usually linear) 3. Parametric or non-parametric

• Typical linear models used in MPC: 1. 2. 3. 4.

Impulse response models Step response models Transfer function models State-space models

Note: Can convert one type of linear model to the other types • Discrete-time models are more convenient for prediction 11

Discrete Impulse Response Models Model Predictive Control

Consider a single input, single output process: uu (k)

yy (k)

Process

where u and y are deviation variables, u(k) and y(k) are their measurements at k-th sampling instant.

• Definition: impulse response is the response of a relaxed process to a unit pulse (impulse) excitation at t = 0

{h i }

i = 0, 1, 2 , 3,⋯

• Process input-output relationship ∞

y ( k ) = ∑ hi u ( k − i )

(convolution summation)

i =0

12

Model Predictive Control

• For a stable process: h i ≈ 0 for i > N  Finite Impulse response (FIR) N

y ( k ) = ∑ hi u ( k − i )

(h0 = 0)

i =0

• For a multivariable process with r inputs and m outputs, the representation becomes a impulse response matrix  h11,k ⋯ h1r ,k    ⋱ ⋮  Hk =  ⋮ h  ⋯ h m 1 ,k mr ,k  

k = 0, 1, 2, 3,⋯

hij,k : the FIR between the j-th input and the i-th output N

y (k ) = ∑ H i u (k − i) i =0

13

Model Predictive Control

FIR Identification • Identification problem: given input u(k) and output measurement y(k)  find the FIR, hi e(k) (noise) u(k)

Process

w(k) +

y(k)

(FIR, hi)

• Assumptions: – The input u(k) is a continuing driving function of the process. We observe u(k) for 0 ≤ k ≤ n + N where n > N. – The output sequence y(k) for N ≤ k ≤ n + N is also observed. – The noise e(k) is a random sequence with zero mean and is uncorrelated with u(k). 14

Model Predictive Control

• Using the input-output relationship, we have n+1 eqs. k = N, k = N + 1, ⋮

y ( N ) = h0 u ( N ) + h1 u ( N − 1) + ⋯ + hN u ( 0 ) + e ( N ) y ( N + 1) = h0 u ( N + 1) + h1 u ( N ) + ⋯ + hN u (1) + e ( N + 1) ⋮

k = N + n, y ( N + n ) = h0 u ( N + n ) + h1 u ( N + n − 1) + ⋯ + hN u ( n ) + e ( N + n )

• Written in vector form y = Uh + e  h0   y(N )   e( N )   u(N) u ( N − 1)        h1  y N e N u ( N + 1) u(N) + 1 + 1 ( ) ( )       y= ; e= ; h =  ; U =      ⋮ ⋮ ⋮ ⋮ ⋮         h N   y ( N + n )  e ( N + n )  u ( N + n ) u ( N + n − 1)

⋯ u ( 0)  ⋯ u (1)  ⋱ ⋮   ⋯ u ( n ) 

n+1 equations, N+1 unknowns (n > N)  No exact solution 15

Model Predictive Control

Least-Squares Estimation • Estimate the unknown parameter vector h by the method of least-squares (minimize the error criterion J = eTe with respect to h where e = y − Uh )

(

ˆ = UT U Solution : h

• Accuracy of hˆ

)

−1

UT y (Least-squares estimator)

( )

ˆ =h ˆ is an unbiased estimate of h, i.e. E h – h

ˆ is a consistent estimate of h if n → ∞ – h

• Potential problems – The selection of settling time parameter N (unknown a priori) – Usually needs to repeat the computation with progressively increasing N values – A large N value may cause computational difficulty 16

Multivariable FIR Identification • Input-output relationship for the i-th output Model Predictive Control

r

N

yi ( k ) = ∑ ∑ hij ,ℓ u j ( k − ℓ ) j =1 ℓ =0

⇒ y i = [ U1 U 2 ⋯ U r ] hi + ei = Uhi + ei u j ( N − 1)  uj (N )  yi ( N )   ei ( N )       uj (N) y ( N + 1)  e ( N + 1)   u j ( N + 1) ; ei =  i ; Uj =  yi =  i     ⋮ ⋮ ⋮ ⋮      u j ( N + n ) u j ( N + n − 1)  yi ( N + n )  ei ( N + n )    hij ,0    h  ij ,1  T T T T  ⋯ ; = hij =  h h h h i i2 ir   i1 ⋮     hij ,N 

• Least-squares estimation

(

ˆ = UT U h i

)

−1

⋯ u j ( 0)  ⋯ u j (1)  ; ⋱ ⋮  ⋯ u j ( n ) 

UT y i 17

Model Predictive Control

Discrete Step Response Models

• The step response Si is related to the impulse response hi For unit step input, u(k)=1 N

S k = y ( k ) = ∑ hi u ( k − i ) i =0

k

⇒ S k = ∑ hi

(S0 = 0)

i =0

or

hi = Si − Si −1 18

Prediction for SISO Step Response Models Model Predictive Control

• The step response model of a stable SISO process N

N

i =1

i =1

(

)

y ( k + 1) = ∑ hi u ( k − i + 1) = ∑ S i − S i −1 u ( k − i + 1) ⇒

y ( k +1) =

N −1

∑ Si ∆u ( k − i + 1) + S N u ( k − N + 1) i =1

Si = the i-th step response coefficient N = an integer (the model horizon)

∆u(k ) = u(k ) − u(k − 1) = change in the input from one sampling instant to the next

• Let k denote the current sampling instant and ˆy ( k +1) denote the prediction of y(k+1) at time k One-step-ahead prediction

ˆy ( k +1) =

N −1

∑ Si ∆u ( k − i + 1) + S N u ( k − N + 1) i =1

19

• Rearrange as

Model Predictive Control

yˆ (k + 1) =

S1∆u (k )   

+

Effect of current control action

N −1

∑ Si ∆u(k − i + 1) + S N u(k − N + 1)

i =2  

Effect of past control actions

• Two-step-ahead prediction (k = k+1) yˆ (k + 2) = S1∆u (k + 1) +  Effect of future control action

S2 ∆u (k )    Effect of current control action

• j -step ahead prediction yˆ (k + j ) =

j

∑ Si ∆u (k + j − i) i =1   

Effects of current and future control actions

yˆ ( k + j ) =

+

+

N −1

∑ Si ∆u(k − i + 2) + S N u(k − N + 2)

i =3 

Effect of past control actions

N −1

∑ Si ∆u (k + j − i) + S N u (k + j − N )

i = j +1  

Effects of past control actions

j

o ˆ S ∆ u ( k + j − i ) + y (k + j ) ∑ i i =1

Predicted unforced response (no current or future control actions, u ( k + i ) = u ( k − 1) for i ≥ 0 ) 20

Model Predictive Control

• Example : Derive a predictive control law based on the following concept. A single control move, ∆u (k ) , is calculated so that the J-step-ahead prediction is equal to the set-point. Assume ∆u (k + i ) = 0 for i > 0. Solution: o A single prediction for J step ahead yˆ ( k + J ) = S J ∆u (k ) + yˆ ( k + J ) Setting yˆ ( k + J ) = ysp and rearranging gives the desired predictive controller

∆u ( k ) =

ysp − yˆ o ( k + J ) SJ

Apply the predictive control law to the process

Y (s) 1 = U ( s) ( 5s + 1)5 Large J  sluggish response 21

Vector Notation for Multiple Predictions Model Predictive Control

Define vectors: Yˆ ( k +1) : predicted response for the next P sampling instants Yˆ o ( k +1) : predicted unforced response ∆U ( k ) : control actions for the next M sampling instants

 ˆy ( k+1)  ˆ  y k+ 2 ( ) Yˆ ( k +1) ≜    ⋮    ˆy ( k+P ) 

 ˆy o ( k+1)     ˆy o ( k+2 )  o  Yˆ ( k +1) ≜  ⋮     o  ˆy ( k+P ) 

 ∆u ( k )    u k+ ∆ 1 ( )  ∆U ( k ) ≜    ⋮    ∆u ( k+M -1)  22

Model Predictive Control

Dynamic Matrix Model • The MPC control calculations are based on calculating ∆U ( k ) so that the predicted outputs move optimally to the new set-point • The model predictions can be written as Yˆ ( k +1) = S ∆U ( k ) + Yˆ o ( k +1) where S is the P × M dynamic matrix      S ≜      

S1 S2

0 S1

⋯ 0

0 ⋮





0 S1

SM

S M -1

⋱ ⋯

S M +1

SM



S2







S P-1



⋮ SP

S P-M +1

           23

Output feedback: Bias Correction Model Predictive Control

• Sources of inaccurate prediction: – model inaccuracy and unmeasured disturbance d(k) (disturbance) u

Process

ˆy ( k ) +

y(k)

• The model predictions can be corrected by utilizing the latest measurement, y(k). • The corrected prediction is defined to be: yɶ ( k + j ) ≜ ˆy ( k + j ) + dˆ ( k + j ) ≜ ˆy ( k + j ) +  y ( k ) − ˆy ( k ) 

dˆ ( k + j ) = y ( k ) − ˆy ( k ) Estimated disturbance (Residual)

• Adding this bias correction to each prediction gives Yɶ ( k +1) = S ∆U ( k ) + Yˆ o ( k +1) + 1  y ( k ) − ˆy ( k )  (Assume process disturbance is constant for j=1,2,…,P)

24

EXAMPLE

Model Predictive Control

The benefits of using corrected predictions will be illustrated by a simple example, the first-order plus-time-delay model:

Y(s) 5e-2s = U(s) 15s + 1 Assume that the disturbance transfer function is identical to the process transfer function, Gd(s)=Gp(s). A unit step change in u occurs at time t=2 min and a step disturbance, d=0.15, occurs at t=8 min. The sampling period is ∆t = 1 min. (a) Compare the process response y(k) with the predictions that were made 15 steps earlier based on a step response model with N=80. (b) Repeat part (a) for the situation where the step response coefficients are calculated using an incorrect model:

Y(s) 4e-2 s = U(s) 20s + 1 25

yɶ ( k +15 ) ≜ ˆy ( k +15 ) + dˆ ( k +15 )

Model Predictive Control

≜ ˆy ( k +15 ) +  y ( k ) − ˆy ( k )  Bias correction begins after t = 25 (k = 10)

Bias correction begins after t = 19 (k = 4)

(a) Without model error.

(b) With model error.

26

Prediction for MIMO Step Response Models Model Predictive Control

• By the Principle of Superposition ˆy1 ( k + j ) = ˆy2 ( k + j ) =



N −1

N −1

i =1

i =1

N −1

N −1

i =1

i =1

∑ S11,i ∆u1 ( k + j − i ) + S11,N u1 ( k + j − N ) + ∑ S12,i ∆u2 ( k + j − i ) + S12,N u2 ( k + j − N )

∑ S21,i ∆u1 ( k + j − i ) + S21,N u1 ( k + j − N ) + ∑ S22,i ∆u2 ( k + j − i ) + S22,N u2 ( k + j − N )

Let the output vector be y = [ y1 T vector be u = [u1 u2 ⋯ ur ]

y2 ⋯ ym ] and the input T

• The MIMO model for the corrected predictions ˆ ( k )  Yɶ ( k +1) = S ∆U ( k ) + Yˆ o ( k +1) + Φ  y ( k ) − y  yɶ ( k+1)  ɶ  k+ 2 y ( )  Yɶ ( k +1) ≜    ⋮    yɶ ( k+P ) 

mP ×1

 ˆy o ( k+1)     ˆy o ( k+2 )  o ˆ  Y ( k +1) ≜  ⋮     o  ˆy ( k+P )  mP ×1

 ∆u ( k )    ∆ k+ 1 u ( )  ∆U ( k ) ≜    ⋮   ∆ k+M 1 u ( )   rM ×1 27

• The mP × m matrix Φ is defined as Φ = [Im Im ⋯ Im ]   

T

Model Predictive Control

P times

where Im denotes the m × m identity matrix • The dynamic matrix is defined as      S ≜      

S1 S2 ⋮ SM

0 S1 ⋮ S M -1

⋯ 0

S M +1 ⋮ SP

SM ⋮ S P-1

⋯ ⋱ ⋯

0 ⋮ 0 S1

⋱ ⋯

S2 ⋮ S P-M +1

           mP × rM

where Si is the m × r matrix of step response coefficients for the i-th time step ⋯ S  S 11,i

1r ,i

  Si =  ⋮ ⋱ ⋮  S   m1,i ⋯ S mr ,i 

28

Model Predictive Control

Example: Individual step-response models for a distillation column with three inputs and four outputs. Each model represents the step response for 120 minutes. Reference: Hokanson and Gerstle (1992).

29

Model Predictive Control

MPC Calculations • The control objective is to calculate a set of control moves (input changes) that make the corrected predictions as close to a reference trajectory as possible. Reference Trajectory • A reference trajectory can be used to make a gradual transition to the desired set point. • Let the reference trajectory over the prediction horizon P be denoted as:  y ( k+1)  r

  y k+ 2 ( )  Yr ( k +1) ≜  r   ⋮   y k+P )  mP ×1  r (

Exponential Trajectory from y(k) to ysp(k) A reasonable approach for the i-th output is to use: yi ,r ( k + j ) = (α i ) yi ( k ) + 1 − (α i )  yi , sp ( k )   for i=1,2,…, m and j=1, 2, …, P. j

j

(

(αi ) = 0 ⇒ y r = y sp j

) 30

Model Predictive Control

Unconstrained MPC • The control calculations are based on minimizing the predicted deviations between the reference trajectory. • The predicted error vector is defined as: ˆ ( k +1) ≜ Y ( k +1) − Yɶ ( k +1) E r

Similarly, the predicted unforced error, Eˆ o ( k +1) , is defined as ˆ o ( k +1) ≜ Y ( k +1) − Yɶ o ( k +1) E r where the corrected prediction for unforced case is defined as

ˆ ( k )  Yɶ o ( k +1) ≜ Yˆ o ( k +1) + Φ  y ( k ) − y ˆ ( k +1) = E ˆ o ( k +1) − S ∆U ( k ) ⇒ E Note that all of the above vectors are of dimension, mP.

• The objective of the control calculations is to determine the control moves, ∆U ( k ) , for the next M time intervals. • The rM-dimensional vector ∆U ( k ) is calculated so that an objective function (also called a performance index) is minimized. 31

MPC Performance Index Model Predictive Control

• The rM-dimensional vector ∆U(k) is calculated so as to minimize: a. The predicted errors over the prediction horizon, P. b. The size of the control move over the control horizon, M. • Example: Consider a quadratic performance index:

ˆ ( k + 1)T Q E ˆ ( k + 1) + ∆U ( k )T R ∆U ( k ) min J = E

∆U ( k )

where Q and R are weighting matrices used to weight the most important outputs and inputs. Both Q and R are usually diagonal matrices with positive diagonal elements.

32

Model Predictive Control

MPC Control Law: Unconstrained Case • The MPC control law that minimizes the quadratic objective function can be calculated analytically ∂J

(

∆U ( k ) = S Q S + R T

)

-1

ˆ S QE T

o

( k +1)

∂∆U ( k )

=0

where S is the dynamic matrix. • This control law can be written in a more compact form

ˆ o ( k +1) ∆U ( k ) = K c E where controller gain matrix Kc is defined to be:

(

Kc ≜ S Q S + R T

)

-1

ST Q

Dimension: rM × mP

(a multivariable, proportional control law based on the predicted error)

• Note that Kc can be evaluated off-line, rather than on-line, provided that the dynamic matrix S and weighting matrices, Q and R, are constant. 33

.

Model Predictive Control

MPC Control Law: Receding Horizon Approach ˆ o ( k +1) • MPC control law: ∆U ( k ) = K c E where:

 ∆u ( k )    ∆ k+ 1 u ( )  ∆U ( k ) ≜    ⋮   ∆ k+M 1 u )  rM ×1  (

• Note that the controller gain matrix, Kc, is an rM × mP matrix. • In the receding horizon control approach, only the first step of the M-step control policy, ∆u ( k ) , is implemented. ˆ o ( k +1) ∆u ( k ) = K E c1

where matrix Kc1 is defined to be the first r rows of Kc. Thus, Kc1 has dimensions of r × mP . Advantage: new information in the form of the most recent measurement y(k) is utilized immediately

34

Model Predictive Control

Unconstrained MPC (DMC) Algorithm • The process output, y(k), is measured, and used to estimate the disturbance. dˆ ( k + j ) = y ( k ) − ˆy ( k ) • The predicted unforced error, Eˆ o ( k +1) , is updated (accounting for changes in set-point and effect of previous controller moves). ˆ o ( k +1) = Y ( k +1) − Yˆ o ( k +1) − Φ  y ( k ) − y ˆ ( k )  E r 

• Solve for control move.

(

∆U ( k ) = S Q S + R



T

)

-1

ˆ o ( k +1) ST Q E

∆u ( k ) (first step only) is implemented.

• Counter is updated: k = k + 1. 35

Model Predictive Control

MPC with Inequality Constraints • Inequality constraints on input and output variables are important characteristics for MPC applications – Input constraint: physical limitations on plant equipments such as limits on input value and rate-of-change – Output constraint: related to plant operating strategy such as constraint on product quality

• MPC inequality constraints u− ( k ) ≤ u ( k + j ) ≤ u+ ( k )

j = 0,1,⋯ , M − 1

∆u − ( k ) ≤ ∆u ( k + j ) ≤ ∆u + ( k )

j = 0,1,⋯ , M − 1

y − ( k + j ) ≤ yɶ ( k + j ) ≤ y + ( k + j )

j = 1, 2,⋯ , P

• The introduction of inequality constraints results in a constrained optimization problem – Can be solved numerically using linear or quadratic programming techniques 36

Model Predictive Control

Selection of Design Parameters Model predictive control techniques include a number of design parameters: N: ∆t : P: M: Q: R:

model horizon sampling period prediction horizon (number of predictions) control horizon (number of control moves) weighting matrix for predicted errors (Q > 0) weighting matrix for control moves (R > 0)

37

Model Predictive Control

Selection of Design Parameters 1.

N and ∆t These parameters should be selected so that N ∆t > open-loop settling time. Typical values of N: 30 < N < 120

2.

Prediction Horizon, P Increasing P results in less aggressive control action Set P = N + M

3.

Control Horizon, M Increasing M makes the controller more aggressive and increases computational effort, typically: 5 < M < 20 or N/3 < M < N/2

4.

Weighting matrices Q and R Diagonal matrices with largest elements corresponding to most important variables – –

output weighting matrix Q : the most important variables having the largest weights input weighting matrix (move suppression matrix) R : increasing the values of weights tends to make the MPC controller more conservative by reducing the magnitudes of the input moves 38

Example: SISO system Model Predictive Control

e-s G( s ) = (10 s + 1)( 5s + 1)

Assume

N = 70, ∆t = 1

The controller gain matrix, Kc, for two cases (Qii = 1, Rii = 0):

Set-point response [MPC vs. PID (ITAE set-point tuning)] MPC: small settling time

39

Model Predictive Control

Disturbance response [MPC vs. PID (ITAE disturbance tuning)]

MPC: small maximum deviations and non-oscillatory

40

MIMO Example: Effects of MPC design parameters (M, P, Q, R) Model Predictive Control

• Wood and Berry process

– ∆t = 1 min – Saturation limits of ±0.15 were imposed on each input – +1% set-point change in XB at t=0, followed by two feed flow rate disturbances: +30% increase at t=50 and a return to the original value at t=100 (Fs = 2.45) – Compare a variety of MPC controllers and a multi-loop control system (Lee et al., 1998) Control loop

Kc

τI

XD – R

0.85

7.21

XB – S

-0.089

8.86

41

Model Predictive Control

Unconstrained MPC vs. Multi-loop Control

MPC is superior to the multi-loop control system (faster responses, less oscillation). 42

Model Predictive Control

Effect of input weighting matrix R

When Rii are increased, the MPC inputs become smoother and the output responses have larger deviations and longer settling times.

43

Model Predictive Control

Effect of output weighting matrix Q

Control of the more heavily weighted output improves at the expense of the other output.

44

Model Predictive Control

Effect of control horizon M

The y responses are similar, but the u responses are smoother for M = 5. 45

MATLAB Tools for MPC • Unconstrained MPC (DMC) Model Predictive Control

– Kmpc = mpccon(model,ywt,uwt,M,P) • Calculate MPC controller gains for unconstrained case. • Inputs: – – – –

model : Step response coefficient matrix of model. ywt,uwt : output and input weighting matrices. M : control horizons. P : prediction horizon.

• Output: –

Kmpc : Controller gain matrix

– model = tfd2step(tfinal,delt,nout,g1,...,g25) • Determines the step response model of a transfer function model. • Inputs: – – – –

tfinal: truncation time for step response model. delt: sampling interval for step response model. nout: number of outputs, ny. g1, g2,...: SISO transfer function ordered to be read in columnwise (by input). The number of transfer functions required is ny*nu. (nu=number of inputs). Limited to ny*nu 0 (for discrete-time system). delay : Pure time delay (dead time). Can be >= 0.

• Output: –

g: transfer function.

47

• Unconstrained MPC (DMC)

Model Predictive Control

– [yp,u,ym] = mpcsim(plant,model,Kmpc,tend,r,usat,... tfilter,dplant,dmodel,dstep) • Simulation of the unconstrained Model Predictive Controller. • REQUIRED INPUTS: – – – –

plant(model): the step response coefficient matrix of the plant (model) generated by the function tfd2step. Kmpc: the constant matrix computed by the function mpccon. tend: final time of simulation. r: reference trajectory (set-point).

• OPTIONAL INPUTS: – usat: the matrix of manipulated variable constraints.It is a vector of the lower limits (Ulow), upper limits (Uhigh) and rate of change limits (DelU) on the manipulated variables. – tfilter: time constants for noise filter and unmeasured disturbance lags. – dplant: step response coefficient matrix for the disturbance generated by the function tfd2step. – dmodel: step response coefficient matrix for the measured disturbance effect on the model output generated by the function tfd2step. – dstep: matrix of disturbances to the plant.

• OUTPUT: – y (system response), u (manipulated variable) and ym (model response)

48

• Constrained MPC (QDMC) Model Predictive Control

– [yp,u,ym] = cmpc(plant,model,ywt,uwt,M,P,tend,r,ulim,ylim... tfilter,dplant,dmodel,dstep) • Simulation of the constrained Model Predictive Controller. • REQUIRED INPUTS: – plant, model, ywt, uwt, M, P, tend, r

• OPTIONAL INPUTS: – ulim: matrix of manipulated variable constraints. It is a trajectory of lower limits (Ulow), upper limits (Uhigh) and rate of change (DelU). – ylim: matrix of output variable constraints. It is a trajectory of lower (Ylow) and upper limits (Yhigh) on the output variables. – tfilter, dplant, dmodel, dstep

• OUTPUT: – y (system response), u (manipulated variable) and ym (model response)

49