This example shows how to design a model predictive controller for a linear identified plant model.
This example uses only the measured input and output of the identified model for the model predictive controller plant model.
This example requires a System Identification Toolbox™ license.
Obtain an identified linear plant model.
load dryer2; Ts = 0.08; dry_data = iddata(y2,u2,Ts); dry_data_detrended = detrend(dry_data); plant_idss = ssest(dry_data_detrended,3);
plant_idss is a third-order, identified state-space
model that contains one measured input and one unmeasured (noise)
Convert the identified plant model to a numeric LTI model.
You can convert the identified model to an
zpk model. For this example, convert the identified
state-space model to a numeric state-space model.
plant_ss = ss(plant_idss);
plant_ss contains the measured input and
plant_idss. The software discards the
noise input of
plant_idss when it creates
Design a model predictive controller for the numeric plant model.
controller = mpc(plant_ss,Ts);
controller is an
The software treats:
The measured input of
the manipulated variable of
The output of
plant_ss as the measured
output of the plant for
To view the structure of the model predictive controller, type
the MATLAB® command prompt.