Products & Services Solutions Academia Support User Community Company

Learn more about System Identification Toolbox   

Identifying Low-Order Transfer Functions (Process Models)

What Is a Process Model?

The structure of a continuous-time process model is a simple transfer function that describes linear system dynamics in terms of one or more of the following elements:

Process models are popular for describing system dynamics in many industries and apply to various production environments. The primary advantages of these models are that they provide delay estimation, and the model coefficients have a physical interpretation.

You can create different model structures by varying the number of poles, adding an integrator, or adding or removing a time delay or a zero. You can specify a first-, second-, or third-order model, and the poles can be real or complex (underdamped modes).

For example, the following model structure is a first-order continuous-time process model, where K is the static gain, Tp1 is a time constant, and Td is the input-to-output delay:

To learn more about estimating continuous-time process models in the GUI, see Tutorial – Identifying Low-Order Transfer Functions (Process Models) Using the GUI in System Identification Toolbox Getting Started Guide.

Data Supported by a Process Model

You can estimate low-order (up to third order), continuous-time transfer functions from data with the following characteristics:

You must import your data into the MATLAB workspace, as described in Data Import and Processing.

How to Estimate Process Models Using the GUI

Before you can perform this task, you must have

  1. In the System Identification Tool GUI, select Estimate > Process models to open the Process Models dialog box.

  2. If your model contains multiple inputs, select the input channel in the Input list. This list only appears when you have multiple inputs. For more information, see Options for Multiple-Input Models.

  3. In the Model Transfer Function area, specify the model structure using the following options:

    • Under Poles, select the number of poles, and then select All real or Underdamped.

        Note   You need at least two poles to allow underdamped modes (complex-conjugate pair).

    • Select the Zero check box to include a zero, which is a numerator term other than a constant, or clear the check box to exclude the zero.

    • Select the Delay check box to include a delay, or clear the check box to exclude the delay.

    • Select the Integrator check box to include an integrator (self-regulating process), or clear the check box to exclude the integrator.

    The Parameter area shows as many active parameters as you included in the model structure.

  4. In the Initial Guess area, select Auto-selected to calculate the initial parameter values for the estimation. The Initial Guess column in the Parameter table displays Auto. If you do not have a good guess for the parameter values, Auto works better than entering an ad hoc value.

  5. (Optional) If you approximately know a parameter value, enter this value in the Initial Guess column of the Parameter table. The estimation algorithm uses this value as a starting point. If you know a parameter value exactly, enter this value in the Initial Guess column, and also select the corresponding Known check box in the table to fix its value.

    If you know the range of possible values for a parameter, enter these values into the corresponding Bounds field to help the estimation algorithm.

    For example, the following figure shows that the delay value Td is fixed at 2 s and is not estimated.

  6. In the Disturbance Model list, select one of the available options. For more information about each option, see Options for the Disturbance Model Structure.

  7. In the Focus list, select how to weigh the relative importance of the fit at different frequencies. For more information about each option, see Options for Frequency-Weighing Focus.

  8. In the Initial state list, specify how you want the algorithm to treat initial states. For more information about the available options, see Options for Initial States.

      Tip   If you get a bad fit, you might try setting a specific method for handling initial states, rather than choosing it automatically.

  9. In the Covariance list, select Estimate if you want the algorithm to compute parameter uncertainties. Effects of such uncertainties are displayed on plots as model confidence regions.

    To omit estimating uncertainty, select None. Skipping uncertainty computation might reduce computation time for complex models and large data sets.

  10. In the Model Name field, edit the name of the model or keep the default. The name of the model should be unique in the Model Board.

  11. To view the estimation progress in the MATLAB Command Window, select the Trace check box. During estimation, the following information is displayed for each iteration:

    • Loss function — Equals the determinant of the estimated covariance matrix of the input noise.

    • Parameter values — Values of the model structure coefficients you specified.

    • Search direction — Change in parameter values from the previous iteration.

    • Fit improvements — Shows the actual versus expected improvements in the fit.

  12. Click Estimate to add this model to the Model Board in the System Identification Tool GUI.

  13. To stop the search and save the results after the current iteration has been completed, click Stop Iterations. To continue iterations from the current model, click the Continue iter button to assign current parameter values as initial guesses for the next search.

Next Steps

How to Estimate Process Models at the Command Line

Prerequisites

Before you can perform this task, you must have

Using pem to Estimate Process Models

You can estimate process models using the iterative estimation method pem that minimizes the prediction errors to obtain maximum likelihood estimates. The resulting models are stored as idproc model objects.

You can use the following general syntax to both configure and estimate process models:

m = pem(data,mod_struc,'Property1',Value1,...,
                       'PropertyN',ValueN)

To capture offsets that are essential to describe the dynamics of interest, such as when the model contains integration behavior, set the InputLevel property set to "estimate".

data is the estimation data and mod_struc is a string that represents the process model structure, as described in Options for Specifying the Process-Model Structure.

The property-value pairs specify any model properties that configure the estimation algorithm and the initial conditions. For more information about accessing and setting model properties, see Model Properties.

For more information about validating a process model, see Overview of Model Validation and Plots.

You can use pem to refine parameter estimates of an existing process model, as described in Refining Linear Parametric Models.

For detailed information about pem and idproc, see the corresponding reference page.

Example – Estimating Process Models with Free Parameters at the Command Line

This example demonstrates how to estimate the parameters of a first-order process model:

This process has two inputs and the response from each input is estimated by a first-order process model. All parameters are free to vary.

Use the following commands to estimate a model m from sample data:

% Load sample data
load co2data
% Sampling interval is 0.5 min (known)
Ts = 0.5;
% Split data set into estimation data ze
% and validation data zv
ze = iddata(Output_exp1,Input_exp1,Ts,...
                        'TimeUnit','min');
zv = iddata(Output_exp2,Input_exp2,Ts,...
                        'TimeUnit','min');
% Estimate model with one pole and a delay
m = pem(ze,'P1D')

MATLAB computes the following output:

Process model with 2 inputs:
y = G_1(s)u_1 + G_2(s)u_2
where
           K                    
G_1(s) = ---------- * exp(-Td*s)
          1+Tp1*s               
                                
with   K = -3.2168              
     Tp1 = 23.033               
      Td = 10.101               
                                
           K                    
G_2(s) = ---------- * exp(-Td*s) 
          1+Tp1*s               
                                
with   K = 9.9877               
     Tp1 = 2.0314               
      Td = 4.8368

Use dot notation to get the value of any model parameter. For example, to get the Value field in the K structure, type the following command:

m.K.value

Example – Estimating Process Models with Fixed Parameters at the Command Line

When you know the values of certain parameters in the model and want to estimate only the values you do not know, you must specify the fixed parameters after creating the idproc model object.

Use the following commands to prepare the data and construct a process model with one pole and a delay:

% Load sample data
load co2data
% Sampling interval is 0.5 min (known)
Ts = 0.5;
% Split data set into estimation data ze
% and validation data zv
ze = iddata(Output_exp1,Input_exp1,Ts,...
                        'TimeUnit','min');
zv = iddata(Output_exp2,Input_exp2,Ts,...
                        'TimeUnit','min');
mod=idproc('P1D')

MATLAB computes the following output:

Process model with transfer function   
           K                           
G(s) = ---------- * exp(-Td*s)         
        1+Tp1*s                        
                                       
with   K = NaN                         
     Tp1 = NaN                         
      Td = NaN                         
                                       
This model was not estimated from data.

The model parameters K, Tp1, and Td are assigned NaN values, which means that the parameters have not yet been estimated from the data.

All process-model parameters are structures with the following fields:

To set the value of K to 12 and keep it fixed, use the following commands:

mod.K.value=12;
mod.K.status='fixed';

To estimate Tp1 and Td only, use the following command:

mod_proc=pem(ze,mod)

MATLAB computes the following result:

Process model with 2 inputs:
y = G_1(s)u_1 + G_2(s)u_2
where                           
           K                    
G_1(s) = ---------- * exp(-Td*s)
          1+Tp1*s               
                                
with   K = 12                   
     Tp1 = 7.0998e+007          
      Td = 15                   
                                
                                
           K                    
G_2(s) = ---------- * exp(-Td*s)
          1+Tp1*s               
                                
with   K = 12                   
     Tp1 = 3.6962               
      Td = 3.817

In this case, the value of K is fixed at 12, but Tp1 and Td are estimated.

If you prefer to specify parameter constraints directly in the estimator syntax, the following table provides examples of pem commands.

ActionExample

Fix the value of K to 12.

m=pem(ze,'p1d','k','fix','k',12)

Initialize K for the iterative search without fixing this value.

m=pem(ze,'p1d','k',12)

Constrain the value of K between 3 and 4.

m=pem(ze,'p1d','k',...
  {'min',3},'k',{'max',4})

Options for Specifying the Process-Model Structure

This section describes how to specify the model structure in the estimation procedures How to Estimate Process Models Using the GUI and How to Estimate Process Models at the Command Line.

In the System Identification Tool GUI. Specify the model structure by selecting the number of real or complex poles, and whether to include a zero, delay, and integrator. The resulting transfer function is displayed in the Process Models dialog box.

At the command line. Specify the model structure using an acronym that includes the following letters and numbers:

Typically, you specify the model-structure acronym as a string argument in the estimation command pem:

For more information about estimating models , see How to Estimate Process Models at the Command Line.

Options for Multiple-Input Models

If your model contains multiple inputs, you can specify whether to estimate the same transfer function for all inputs, or a different transfer function for each input. The information in this section supports the estimation procedures How to Estimate Process Models Using the GUI and How to Estimate Process Models at the Command Line.

In the System Identification Tool GUI. To fit a data set with multiple inputs in the Process Models dialog box, configure the process model settings for one input at a time. When you finish configuring the model and the estimation settings for one input, select a different input in the Input Number list.

If you want the same transfer function to apply to all inputs, select the Same structure for all channels check box. To apply a different structure to each channel, leave this check box clear, and create a different transfer function for each input.

At the command line. Specify the model structure as a cell array of acronym strings in the estimation command pem. For example, use this command to specify the first-order transfer function for the first input, and a second-order model with a zero and an integrator for the second input:

m = idproc({'P1','P2ZI'})
m = pem(data,m)

To apply the same structure to all inputs, define a single structure in idproc.

Options for the Disturbance Model Structure

This section describes how to specify a noise model in the estimation procedures How to Estimate Process Models Using the GUI and How to Estimate Process Models at the Command Line.

In addition to the transfer function G, a linear system can include an additive noise term He, as follows:

where e is white noise.

You can estimate only the dynamic model G, or estimate both the dynamic model and the disturbance model H. For process models, H is a rational transfer function C/D, where the C and D polynomials for a first- or second-order ARMA model.

In the GUI. To specify whether to include or exclude a noise model in the Process Models dialog box, select one of the following options from the Disturbance Model list:

At the command line. Specify the disturbance model as an argument in the estimation command pem. For example, use this command to estimate a first-order transfer function and a first-order noise model:

pem(data,'P1D','DisturbanceModel','ARMA1')

For a complete list of values for the DisturbanceModel model property, see the idproc reference page.

Options for Frequency-Weighing Focus

You can specify how the estimation algorithm weighs the fit at various frequencies. This information supports the estimation procedures How to Estimate Process Models Using the GUI and How to Estimate Process Models at the Command Line.

In the System Identification Tool GUI. Set Focus to one of the following options:

At the command line. Specify the focus as an argument in the estimation command pem using the same options as in the GUI. For example, use this command to optimize the fit for simulation and estimate a disturbance model:

pem(data,'P1D','dist','arma2','Focus','Simulation')

Options for Initial States

Because the process models are dynamic, you need initial states that capture past input properties. Thus, you must specify how the iterative algorithm treats initial states. This information supports the estimation procedures How to Estimate Process Models Using the GUI and How to Estimate Process Models at the Command Line.

In the System Identification Tool GUI. Set Initial state to one of the following options:

At the command line. Specify the initial states as an argument in the estimation command pem using the same options as in the GUI. For example, use this command to estimate a first-order transfer function and set the initial states to zero:

m=pem(data,'P1D','InitialState','zero')

For a complete list of values for the InitialState model property, see the idproc reference page.

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS