Documentation Center

  • Trial Software
  • Product Updates

idproc

Continuous-time process model with identifiable parameters

Syntax

sys = idproc(type)
sys = idproc(type,Name,Value)

Description

sys = idproc(type) creates a continuous-time process model with identifiable parameters. type is a string that specifies aspects of the model structures, such as the number of poles in the model, whether the model includes an integrator, and whether the model includes a time delay.

sys = idproc(type,Name,Value) creates a process model with additional attributes specified by one or more Name,Value pair arguments.

Object Description

An idproc model represents a system as a continuous-time process model with identifiable (estimable) coefficients.

A simple SISO process model has a gain, a time constant, and a delay:

Kp is a proportional gain. Kp1 is the time constant of the real pole, and Td is the transport delay (dead time).

More generally, idproc can represent process models with up to three poles and a zero:

Two of the poles can be a complex conjugate (underdamped) pair. In that case, the general form of the process model is:

Tω is the time constant of the complex pair of poles, and ζ is the associated damping constant.

In addition, any idproc model can have an integrator. For example, the following is a process model that you can represent with idproc:

This model has no zero (Tz = 0). The model has a complex pair of poles. The model also has an integrator, represented by the 1/s term.

For idproc models, all the time constants, the delay, the proportional gain, and the damping coefficient can be estimable parameters. The idproc model stores the values of these parameters in properties of the model such as Kp, Tp1, and Zeta. (See Properties for more information.)

A MIMO process model contains a SISO process model corresponding to each input-output pair in the system. For idproc models, the form of each input-output pair can be independently specified. For example, a two-input, one-output process can have one channel with two poles and no zero, and another channel with a zero, a pole, and an integrator. All the coefficients are independently estimable parameters.

There are two ways to obtain an idproc model:

  • Estimate the idproc model based on output or input-output measurements of a system, using the procest command. procest estimates the values of the free parameters such as gain, time constants, and time delay. The estimated values are stored as properties of the resulting idproc model. For example, the properties sys.Tz and sys.Kp of an idproc model sys store the zero time constant and the proportional gain, respectively. (See Properties for more information.) The Report property of the resulting model stores information about the estimation, such as handling of initial conditions and options used in estimation.

    When you obtain an idproc model by estimation, you can extract estimated coefficients and their uncertainties from the model using commands such as getpar and getcov.

  • Create an idproc model using the idproc command.

    You can create an idproc model to configure an initial parameterization for estimation of a process model. When you do so, you can specify constraints on the parameters. For example, you can fix the values of some coefficients, or specify minimum or maximum values for the free coefficients. You can then use the configured model as an input argument to procest to estimate parameter values with those constraints.

Examples

expand all

SISO Process Model with Complex Poles and Time Delay

Create a process model with a pair of complex poles and a time delay. Set the initial value of the model to the following:

Create a process model with the specified structure.

sys = idproc('P2DU')
sys =
Process model with transfer function:     
                   Kp                     
G(s) = ---------------------- * exp(-Td*s)
          1+2*Zeta*Tw*s+(Tw*s)^2          
                                          
                                          
       Kp = NaN                           
       Tw = NaN                           
     Zeta = NaN                           
       Td = NaN                           
                                          
Parameterization:
    'P2DU'

   Number of free coefficients: 4
   Use "getpvec", "getcov" for parameters and their uncertainties.

Status:                                                         
Created by direct construction or transformation. Not estimated.

The input string 'P2DU' specifies an underdamped pair of poles and a time delay. The display shows that sys has the desired structure. The display also shows that the four free parameters, Kp, Tw, Zeta, and Td are all initialized to NaN.

Set the initial values of all parameters to the desired values.

sys.Kp = 0.01;
sys.Tw = 10;
sys.Zeta = 0.1;
sys.Td = 5;

You can use sys to specify this parametrization and these initial guesses for process model estimation with procest.

MIMO Process Model

Create a one-input, three-output process model, where each channel has two real poles and a zero, but only the first channel has a time delay, and only the first and third channels have an integrator.

type = {'P2ZDI';'P2Z';'P2ZI'};
sys = idproc(type);

Providing an array of type strings causes idproc to create a MIMO model where each type string in the array defines the structure of the corresponding I/O pair. Since type is a column vector of strings, sys is a one-input, 3-output model having the specified parametrization structure. The string type{k,1} specifies the structure of the subsystem sys(k,1). All identifiable parameters are initialized to NaN.

Array of Process Models

Create a 3-by-1 array of process models, each containing one output and two input channels.

Create cell array of type strings.

type1 = {'P1D','P2DZ'};
type2 = {'P0','P3UI'};
type3 = {'P2D','P2DI'};
type = cat(3,type1,type2,type3);
size(type)
ans =

     1     2     3

Use type to create the array.

sysarr = idproc(type);

The first two dimensions of the cell array type set the output and input dimensions of each model in the array of process models. The remaining dimensions of the cell array set the array dimensions. Thus, sysarr is a 3-model array of 2-input, one-output process models.

Select a model from the array.

sysarr(:,:,2)
Process model with 2 inputs: y = G11(s)u1 + G12(s)u2
From input 1 to output 1:                           
G11(s) = Kp                                         
                                                    
      Kp = NaN                                      
                                                    
From input 2 to output 1:                           
                          Kp                        
G12(s) = ----------------------------------         
          s(1+2*Zeta*Tw*s+(Tw*s)^2)(1+Tp3*s)        
                                                    
       Kp = NaN                                     
       Tw = NaN                                     
     Zeta = NaN                                     
      Tp3 = NaN                                     
                                                    
Parameterization:
    'P0'    'P3IU'

   Number of free coefficients: 5
   Use "getpvec", "getcov" for parameters and their uncertainties.

Status:                                                         
Created by direct construction or transformation. Not estimated.

This two-input, one-output model corresponds to the type2 entry in the type cell array.

Input Arguments

type

String or cell array of strings characterizing the model structure.

For SISO models, type is a string made up of a series of characters that specify aspects of the model structure.

CharactersMeaning
PkA process model with k poles (not including an integrator). k must be 0, 1, 2, or 3.
ZThe process model includes a zero (Tz ≠ 0). A type string with P0 cannot include Z (a process model with no poles cannot include a zero).
DThe process model includes a time delay (deadtime) (Td ≠ 0).
IThe process model includes an integrator (1/s).
UThe process model is underdamped. In this case, the process model includes a complex pair of poles

Every type string must begin with one of P0, P1, P2, or P3. All other components of the string are optional.

Example type strings include:

  • 'P1D' specifies a process model with one pole and a time delay (deadtime) term:

    Kp, Tp1, and Td are the identifiable parameters of this model.

  • 'P2U' creates a process model with a pair of complex poles:

    Kp, Tw, and Zeta are the identifiable parameters of this model.

  • 'P3ZDI' creates a process model with three poles. All poles are real, because the string does not include U. The model also includes a zero, a time delay, and an integrator:

    The identifiable parameters of this model are Kp, Tz, Tp1, Tp2, Tp3, and Td.

The values of all parameters in a particular model structure are initialized to NaN. You can change them to finite values by setting the values of the corresponding idproc model properties after you create the model. For example, sys.Td = 5 sets the initial value of the time delay of sys to 5.

For a MIMO process model with Ny outputs and Nu inputs, type is an Ny-by-Nu cell array of strings specifying the structure of each input/output pair in the model. For example, type{i,j} specifies the type of the subsystem sys(i,j) from the jth input to the yth output.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Use Name,Value arguments to specify parameter initial values and additional properties of idproc models during model creation. For example, sys = idproc('p2z','InputName','Voltage','Kp',10,'Tz',0); creates an idtf model with the InputName property set to Voltage. The command also initializes the parameter Kp to a value of 10, and Tz to 0.

Properties

idproc object properties include:

Type

Cell array of strings characterizing the model structure.

For a SISO model sys, the property sys.Type contains a single string specifying the structure of the system.

For a MIMO model with Ny outputs and Nu inputs, sys.Type is an Ny-by-Nu cell array of strings specifying the structure of each input/output pair in the model. For example, type{i,j} specifies the structure of the subsystem sys(i,j) from the jth input to the ith output.

The strings are made up of a series of characters that specify aspects of the model structure, as follows.

CharactersMeaning
PkA process model with k poles (not including an integrator). k is 0, 1, 2, or 3.
ZThe process model includes a zero (Tz ≠ 0).
DThe process model includes a time delay (deadtime) (Td ≠ 0).
IThe process model includes an integrator (1/s).
UThe process model is underdamped. In this case, the process model includes a complex pair of poles

If you create an idproc model sys using the idproc command, sys.Type contains the strings that you specify with the type input argument.

If you obtain an idproc model by identification using procest, then sys.Type contains the strings describing the model structures that you specified for that identification.

In general, you cannot change the type string of an existing model. However, you can change whether the model contains an integrator using the property sys.Integration.

Kp,Tp1,Tp2,Tp3,Tz,Tw,Zeta,Td

Values of process model parameters.

If you create an idproc model using the idproc command, the values of all parameters present in the model structure initialize by default to NaN. The values of parameters not present in the model structure are fixed to 0. For example, if you create a model, sys, of type 'P1D', then Kp, Tp1, and Td are initialized to NaN and are identifiable (free) parameters. All remaining parameters, such as Tp2 and Tz, are inactive in the model. The values of inactive parameters are fixed to zero and cannot be changed.

For a MIMO model with Ny outputs and Nu inputs, each parameter value is an Ny-by-Nu cell array of strings specifying the corresponding parameter value for each input/output pair in the model. For example, sys.Kp(i,j) specifies the Kp value of the subsystem sys(i,j) from the jth input to the ith output.

For an idproc model sys, each parameter value property such as sys.Kp, sys.Tp1, sys.Tz, and the others is an alias to the corresponding Value entry in the Structure property of sys. For example, sys.Tp3 is an alias to the value of the property sys.Structure.Tp3.Value.

Default: For each parameter value, NaN if the process model structure includes the particular parameter; 0 if the structure does not include the parameter.

Integration

Logical value or matrix denoting the presence or absence of an integrator in the transfer function of the process model.

For a SISO model sys, sys.Integration = true if the model contains an integrator.

For a MIMO model, sys.Integration(i,j) = true if the transfer function from the jth input to the ith output contains an integrator.

When you create a process model using the idproc command, the value of sys.Integration is determined by whether the corresponding type string contains I.

NoiseTF

Coefficients of the noise transfer function.

sys.NoiseTF stores the coefficients of the numerator and the denominator polynomials for the noise transfer function H(s) = N(s)/D(s).

sys.NoiseTF is a structure with fields num and den. Each field is a cell array of Ny row vectors, where Ny is the number of outputs of sys. These row vectors specify the coefficients of the noise transfer function numerator and denominator in order of decreasing powers of s.

Typically, the noise transfer function is automatically computed by the estimation function procest. You can specify a noise transfer function that procest uses as an initial value. For example:

NoiseNum = {[1 2.2]; [1 0.54]};
NoiseDen = {[1 1.3]; [1 2]};
NoiseTF = struct('num', {NoiseNum}, 'den', {NoiseDen});
sys = idproc({'p2'; 'p1di'}); % 2-output, 1-input process model
sys.NoiseTF = NoiseTF;

Each vector in sys.NoiseTF.num and sys.NoiseTF.den must be of length 3 or less (second-order in s or less). Each vector must start with 1. The length of a numerator vector must be equal to that of the corresponding denominator vector, so that H(s) is always biproper.

Default: struct('num',{num2cell(ones(Ny,1))},'den',{num2cell(ones(Ny,1))})

Structure

Information about the estimable parameters of the idproc model.

sys.Structure includes one entry for each parameter in the model structure of sys. For example, if sys is of type 'P1D', then sys includes identifiable parameters Kp, Tp1, and Td. Correspondingly, sys.Structure.Kp, sys.Structure.Tp1, and sys.Structure.Td contain information about each of these parameters, respectively.

Each of these parameter entries in sys.Structure contains the following fields:

  • Value — Parameter values. For example, sys.Structure.Kp.Value contains the initial or estimated values of the Kp parameter.

    NaN represents unknown parameter values.

    For SISO models, each parameter value property such as sys.Kp, sys.Tp1, sys.Tz, and the others is an alias to the corresponding Value entry in the Structure property of sys. For example, sys.Tp3 is an alias to the value of the property sys.Structure.Tp3.Value.

    For MIMO models, sys.Kp{i,j} is an alias to sys.Structure(i,j).Kp.Value, and similarly for the other identifiable coefficient values.

  • Minimum — Minimum value that the parameter can assume during estimation. For example, sys.Structure.Kp.Minimum = 1 constrains the proportional gain to values greater than or equal to 1.

  • Maximum — Maximum value that the parameter can assume during estimation.

  • Free — Logical value specifying whether the parameter is a free estimation variable. If you want to fix the value of a parameter during estimation, set the corresponding Free = false. For example, to fix the dead time to 5:

    sys.Td = 5;
    sys.Structure.Td.Free = false;
  • Scale — Scale of the parameter's value. Scale is not used in estimation.

  • Info — Structure array for storing parameter units and labels. The structure has Label and Unit fields.

    Use these fields for your convenience, to store strings that describe parameter units and labels.

Structure also includes a field Integration that stores a logical array indicating whether each corresponding process model has an integrator. sys.Structure.Integration is an alias to sys.Integration.

For a MIMO model with Ny outputs and Nu input, Structure is an Ny-by-Nu array. The element Structure(i,j) contains information corresponding to the process model for the (i,j) input-output pair.

NoiseVariance

The variance (covariance matrix) of the model innovations e.

An identified model includes a white, Gaussian noise component e(t). NoiseVariance is the variance of this noise component. Typically, the model estimation function (such as procest) determines this variance.

For SISO models, NoiseVariance is a scalar. For MIMO models, NoiseVariance is a Ny-by-Ny matrix, where Ny is the number of outputs in the system.

Report

Information about the estimation process.

Report contains the following fields:

  • InitialCondition — Whether estimation estimated initial conditions or fixed them at zero.

  • Fit — Quantitative quality assessment of estimation, including percent fit to data and final prediction error.

  • Parameters — Estimated values of model parameters and input offset, and their covariances.

  • OptionsUsed — Options used during estimation (see procestOptions).

  • RandState — Random number stream state at start of estimation.

  • Status — Whether model was obtained by construction, estimated, or modified after estimation.

  • Method — Name of estimation method used.

  • DataUsed — Attributes of data used for estimation, such as name and sampling time.

  • Termination — Termination conditions for the iterative search scheme used for prediction error minimization, such as final cost value or stopping criterion.

InputDelay

Input delays. InputDelay is a numeric vector specifying a time delay for each input channel. Specify input delays in the time unit stored in the TimeUnit property.

For a system with Nu inputs, set InputDelay to an Nu-by-1 vector, where each entry is a numerical value representing the input delay for the corresponding input channel. You can also set InputDelay to a scalar value to apply the same delay to all channels.

Default: 0 for all input channels

OutputDelay

Output delays.

For identified systems, like idproc, OutputDelay is fixed to zero.

Ts

Sampling time. For idproc, Ts is fixed to zero because all idproc models are continuous time.

TimeUnit

String representing the unit of the time variable. For continuous-time models, this property represents any time delays in the model. For discrete-time models, it represents the sampling time Ts. Use any of the following values:

  • 'nanoseconds'

  • 'microseconds'

  • 'milliseconds'

  • 'seconds'

  • 'minutes'

  • 'hours'

  • 'days'

  • 'weeks'

  • 'months'

  • 'years'

Changing this property changes the overall system behavior. Use chgTimeUnit to convert between time units without modifying system behavior.

Default: 'seconds'

InputName

Input channel names. Set InputName to a string for single-input model. For a multi-input model, set InputName to a cell array of strings.

Alternatively, use automatic vector expansion to assign input names for multi-input models. For example, if sys is a two-input model, enter:

sys.InputName = 'controls';

The input names automatically expand to {'controls(1)';'controls(2)'}.

When you estimate a model using an iddata object, data, the software automatically sets InputName to data.InputName.

You can use the shorthand notation u to refer to the InputName property. For example, sys.u is equivalent to sys.InputName.

Input channel names have several uses, including:

  • Identifying channels on model display and plots

  • Extracting subsystems of MIMO systems

  • Specifying connection points when interconnecting models

Default: Empty string '' for all input channels

InputUnit

Input channel units. Use InputUnit to keep track of input signal units. For a single-input model, set InputUnit to a string. For a multi-input model, set InputUnit to a cell array of strings. InputUnit has no effect on system behavior.

Default: Empty string '' for all input channels

InputGroup

Input channel groups. The InputGroup property lets you assign the input channels of MIMO systems into groups and refer to each group by name. Specify input groups as a structure. In this structure, field names are the group names, and field values are the input channels belonging to each group. For example:

sys.InputGroup.controls = [1 2];
sys.InputGroup.noise = [3 5];

creates input groups named controls and noise that include input channels 1, 2 and 3, 5, respectively. You can then extract the subsystem from the controls inputs to all outputs using:

sys(:,'controls')

Default: Struct with no fields

OutputName

Output channel names. Set OutputName to a string for single-output model. For a multi-output model, set OutputName to a cell array of strings.

Alternatively, use automatic vector expansion to assign output names for multi-output models. For example, if sys is a two-output model, enter:

sys.OutputName = 'measurements';

The output names to automatically expand to {'measurements(1)';'measurements(2)'}.

When you estimate a model using an iddata object, data, the software automatically sets OutputName to data.OutputName.

You can use the shorthand notation y to refer to the OutputName property. For example, sys.y is equivalent to sys.OutputName.

Output channel names have several uses, including:

  • Identifying channels on model display and plots

  • Extracting subsystems of MIMO systems

  • Specifying connection points when interconnecting models

Default: Empty string '' for all input channels

OutputUnit

Output channel units. Use OutputUnit to keep track of output signal units. For a single-output model, set OutputUnit to a string. For a multi-output model, set OutputUnit to a cell array of strings. OutputUnit has no effect on system behavior.

Default: Empty string '' for all input channels

OutputGroup

Output channel groups. The OutputGroup property lets you assign the output channels of MIMO systems into groups and refer to each group by name. Specify output groups as a structure. In this structure, field names are the group names, and field values are the output channels belonging to each group. For example:

sys.OutputGroup.temperature = [1];
sys.InputGroup.measurement = [3 5];

creates output groups named temperature and measurement that include output channels 1, and 3, 5, respectively. You can then extract the subsystem from all inputs to the measurement outputs using:

sys('measurement',:)

Default: Struct with no fields

Name

System name. Set Name to a string to label the system.

Default: ''

Notes

Any text that you want to associate with the system. Set Notes to a string or a cell array of strings.

Default: {}

UserData

Any type of data you wish to associate with system. Set UserData to any MATLAB® data type.

Default: []

SamplingGrid

Sampling grid for model arrays, specified as a data structure.

For arrays of identified linear (IDLTI) models that are derived by sampling one or more independent variables, this property tracks the variable values associated with each model. This information appears when you display or plot the model array. Use this information to trace results back to the independent variables.

Set the field names of the data structure to the names of the sampling variables. Set the field values to the sampled variable values associated with each model in the array. All sampling variables should be numeric and scalar valued, and all arrays of sampled values should match the dimensions of the model array.

For example, if you collect data at various operating points of a system, you can identify a model for each operating point separately and then stack the results together into a single system array. You can tag the individual models in the array with information regarding the operating point:

nominal_engine_rpm = [1000 5000 10000];
sys.SamplingGrid = struct('rpm', nominal_engine_rpm)

where sys is an array containing three identified models obtained at rpms 1000, 5000 and 10000, respectively.

Default: []

See Also

| | | | |

Was this topic helpful?