Specifications

Identify Plant from Data
2-31
Identify Plant from Data
This example shows how to identify a linear plant model using measured data.
When you have measured plant input/output data, you can use System Identification
Toolbox software to estimate a linear plant model. Then, you can use the estimated plant
model to create a model predictive controller.
You can estimate the plant model either programmatically or by using the System
Identification app.
This example requires a System Identification Toolbox license.
Load the measured data.
load dryer2
The variables u2 and y2, which contain the data measured for a temperature-control
application, are loaded into the MATLAB workspace. u2 is the plant input, and y2 is the
plant output. The sampling period for u2 and y2 is 0.08 seconds.
Create an iddata object for the measured data.
Use an iddata object to store the measured values of the plant inputs and outputs,
sampling time, channel names, etc.
Ts = 0.08;
dry_data = iddata(y2,u2,Ts);
dry_data is an iddata object that contains the measured input/output data.
You can optionally assign channel names and units for the input/output signals. To do so,
use the InputName, OutputName, InputUnit and OutputUnit properties of an iddata
object. For example:
dry_data.InputName = 'Power';
dry_data.OutputName = 'Temperature';
Detrend the measured data.
Before estimating the plant model, preprocess the measured data to increase the
accuracy of the estimated model. For this example, u2 and y2 contain constant offsets
that you eliminate.