idproc

Continuous-time process model with identifiable parameters

Description

An idproc model represents a system as a continuous-time process model with estimable coefficients. Use idproc to create a process model.

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

$sys=\frac{{K}_{p}}{1+{T}_{p1}s}{e}^{-{T}_{d}s}.$

Kp is a proportional gain, Tp1 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 one zero:

$sys={K}_{p}\frac{1+{T}_{z}s}{\left(1+{T}_{p1}s\right)\left(1+{T}_{p2}s\right)\left(1+{T}_{p3}s\right)}{e}^{-{T}_{d}s}.$

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

$sys={K}_{p}\frac{1+{T}_{z}s}{\left(1+2\zeta {T}_{\omega }s+{\left({T}_{\omega }s\right)}^{2}\right)\left(1+{T}_{p3}s\right)}{e}^{-{T}_{d}s}.$

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:

$sys={K}_{p}\frac{1}{s\left(1+2\zeta {T}_{\omega }s+{\left({T}_{\omega }s\right)}^{2}\right)}{e}^{-{T}_{d}s}.$

This model has no zero (Tz = 0) and 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.

Creation

There are two ways to obtain an idproc model:

• Estimate the idproc model based on 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. The Report property of the resulting model stores information about the estimation, such as handling of initial conditions and options used in estimation. For example, you can use the following commands to estimate and get information about a first-order process model.

sys = procest(data,"P1");
kp = sys.Kp
sys.Report

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. For example, fix the value of Tp1 to 1 and constrain the value of Kp1 to a range of [0.3 0.6].

init_sys.Structure.Tp1 = 1;
init_sys.Structure.Tp1.Free = False;
init_sys.Structure.Kp1.Min = 0.3;
init_sys.Structure.Kp1.Max = 0.6;
sys = procest(data,init_sys)

For information on functions you can use to extract information from or transform idproc model objects, see Object Functions.

Description

example

sys = idproc(Type) creates a continuous-time process model with estimable parameters and sets the Type property. Type 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 properties specified by one or more name-value arguments.

Properties

expand all

Model structure, specified as a character vector, string, or cell array of character vectors or strings.

For a SISO model sys, the property sys.Type contains a character vector or string specifying the structure of the system. For example, 'P1D' specifies a process model with one pole and a time delay.

For a MIMO model with Ny outputs and Nu inputs, sys.Type is an Ny-by-Nu cell array of character vectors or 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 Type specifications are made up of one or more of the following characters that specify aspects of the model structure:

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). A type with P0 cannot include Z (a process model with no poles cannot include a zero).
DThe process model includes a time delay (dead time).
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 specification must begin with one of P0, P1, P2, or P3. All other characters are optional. For example:

• 'P1D' specifies a process model with one pole and a dead-time term:

$sys=\frac{{K}_{p}}{1+{T}_{p1}s}{e}^{-{T}_{d}s}.$

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

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

$sys=\frac{{K}_{p}}{\left(1+2\zeta {T}_{\omega }s+{\left({T}_{\omega }s\right)}^{2}\right)}.$

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

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

$sys={K}_{p}\frac{1+{T}_{z}s}{s\left(1+{T}_{p1}s\right)\left(1+{T}_{p2}s\right)\left(1+{T}_{p3}s\right)}{e}^{-{T}_{d}s}.$

The estimable 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 time units.

For a MIMO process model with Ny outputs and Nu inputs, type is an Ny-by-Nu cell array of character vectors or 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.

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

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

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

For examples of specifying Type for different model structures, see:

Example: type = idproc("P2DU")

Example: type = {"P2ZDI";"P2Z";"P2ZI"}; sys = idproc(type)

Values of process model parameters, specified as NaNs, numeric scalars, cell arrays, or 0s. If you use the idproc command to create an idproc model with a model structure that you specify with Type, 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 character vectors or 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.

Integrator presence indicator, specified as a logical value or matrix that denotes 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 theidproc command, the value of sys.Integration is determined by whether the corresponding type contains I.

Coefficients of the noise transfer function, specified as a structure of the form struct('num',{num2cell(ones(Ny,1))},'den',{num2cell(ones(Ny,1))}). 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.

Property-specific information about the estimable parameters of the idproc model, specified as a structure.

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 estimable 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.

FieldDescriptionExamples
ValueParameter valuessys.Structure.Kp.Value contains the initial or estimated values of the Kp parameter. In the SISO case, sys.Kp is an alias of the value of this property. In the MIMO case, sys.Kp{i,j} is the alias of the property sys.Structure(i,j).Kp.Value.
MinimumMinimum value that the parameter can assume during estimation. sys.Structure.Kp.Minimum = 1 constrains the proportional gain to values greater than or equal to 1.
MaximumMaximum value that the parameter can assume during estimation.sys.Structure.Kp.Maximum = 2 constrains the proportional gain to values less than or equal to 2.
FreeBoolean 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 value to false.

The following commands fix the dead time Td to 5.

sys.Td = 5;
sys.Structure.Td.Free = false;

ScaleScale of the value of the parameter. The estimation algorithm does not use Scale.
InfoStructure array that contains the fields Label and Unit for storing parameter labels and units. Specify parameter labels and units as character vectors.sys.Structure.Td.Info = struct("Label","Delay","Unit","seconds") stores the label and units for the delay Td in seconds.

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.

Variance (covariance matrix) of the model innovations e, specified as a scalar or a positive semidefinite matrix.

• SISO model — Scalar

• MIMO model with Ny outputs — Ny-by-Ny positive semidefinite matrix

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.

Summary report that contains information about the estimation options and results when the process model is obtained using the procest estimation command. Use Report to query a model for how it was estimated, including its:

• Estimation method

• Estimation options

• Search termination conditions

• Estimation data fit and other quality metrics

If you create the model by construction, the contents of Report are irrelevant.

m = idproc("P2DU");
m.Report.OptionsUsed
ans =

[]

If you obtain the process model using estimation commands, the fields of Report contain information on the estimation data, options, and results.

m = procest(z2,"P2DU");
m.Report.OptionsUsed
DisturbanceModel: 'estimate'
InitialCondition: 'auto'
Focus: 'prediction'
EstimateCovariance: 1
Display: 'off'
InputOffset: [1x1 param.Continuous]
OutputOffset: []
Regularization: [1x1 struct]
SearchMethod: 'auto'
SearchOptions: [1x1 idoptions.search.identsolver]
OutputWeight: []

For more information on this property and how to use it, see the Output Arguments section of the corresponding estimation command reference page and Estimation Report.

Input delay for each input channel, specified as a scalar value or numeric vector. 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. Each entry of this vector is a numerical value that represents 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. Note that InputDelay is separate from the Td dynamic property, which represents estimable IO delays. InputDelay is not an estimable parameter. The total delay corresponds to a sum of these property values.

For identified systems such as idproc, OutputDelay is fixed to zero.

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

Model time units, specified as one of these values:

• 'nanoseconds'

• 'microseconds'

• 'milliseconds'

• 'seconds'

• 'minutes'

• 'hours'

• 'days'

• 'weeks'

• 'months'

• 'years'

You can specify TimeUnit using a string, such as "hours", but the time units are stored as a character vector, 'hours'.

Model properties such as sample time Ts, InputDelay, OutputDelay, and other time delays are expressed in the units specified by TimeUnit. Changing this property has no effect on other properties, and therefore changes the overall system behavior. Use chgTimeUnit to convert between time units without modifying system behavior.

Names of input channels, specified as one of these values:

• Character vector — For single-input models

• Cell array of character vectors — For models with two or more inputs

• '' — For inputs without specified names

You can 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)'}.

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

You can specify InputName using a string, such as "voltage", but the input name is stored as a character vector, 'voltage'.

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

Units of input signals, specified as one of these values:

• Character vector — For single-input models

• Cell array of character vectors — For models with two or more inputs

• '' — For inputs without specified units

Use InputUnit to keep track of the units each input signal is expressed in. InputUnit has no effect on system behavior.

You can specify InputUnit using a string, such as "voltage", but the input units are stored as a character vector, 'voltage'.

Example: 'voltage'

Example: {'voltage','rpm'}

Input channel groups, specified as a structure where the fields are the group names and the values are the indices of the input channels belonging to the corresponding group. When you use InputGroup to assign the input channels of MIMO systems to groups, you can refer to each group by name when you need to access it. For example, suppose you have a five-input model sys, where the first three inputs are control inputs and the remaining two inputs represent noise. Assign the control and noise inputs of sys to separate groups.

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

Use the group name to extract the subsystem from the control inputs to all outputs.

sys(:,'controls')

Example: struct('controls',[1:3],'noise',[4 5])

Names of output channels, specified as one of these values:

• Character vector — For single-output models

• Cell array of character vectors — For models with two or more outputs

• '' — For outputs without specified names

You can 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 automatically expand to {'measurements(1)';'measurements(2)'}.

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

You can specify OutputName using a string, such as "rpm", but the output name is stored as a character vector, 'rpm'.

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

Units of output signals, specified as one of these values:

• Character vector — For single-output models

• Cell array of character vectors — For models with two or more outputs

• '' — For outputs without specified units

Use OutputUnit to keep track of the units each output signal is expressed in. OutputUnit has no effect on system behavior.

You can specify OutputUnit using a string, such as "voltage", but the output units are stored as a character vector, 'voltage'.

Example: 'voltage'

Example: {'voltage','rpm'}

Output channel groups, specified as a structure where the fields are the group names and the values are the indices of the output channels belonging to the corresponding group. When you use OutputGroup to assign the output channels of MIMO systems to groups, you can refer to each group by name when you need to access it. For example, suppose you have a four-output model sys, where the second output is a temperature, and the rest are state measurements. Assign these outputs to separate groups.

sys.OutputGroup.temperature = [2];
sys.OutputGroup.measurements = [1 3 4];

Use the group name to extract the subsystem from all inputs to the measurement outputs.

sys('measurements',:)

Example: struct('temperature',[2],'measurement',[1 3 4])

Model name, stored as a character vector. You can specify Name using a string, such as "DCmotor", but the output units are stored as a character vector, 'DCmotor'.

Example: 'system_1'

Text notes about the model, stored as a string or a cell array of character vectors. The property stores whichever of these two data types you provide. For instance, suppose that sys1 and sys2 are dynamic system models, and set their Notes properties to a string and a character vector, respectively.

sys1.Notes = "sys1 has a string.";
sys2.Notes = 'sys2 has a character vector.';
sys1.Notes
sys2.Notes
ans =

"sys1 has a string."

ans =

'sys2 has a character vector.'

Data of any kind that you want to associate and store with the model, specified as any MATLAB® data type.

Sampling grid for model arrays, specified as a 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.

For model arrays generated by linearizing a Simulink® model at multiple parameter values or operating points, the software populates SamplingGrid automatically with the variable values that correspond to each entry in the array. For example, the Simulink Control Design™ commands linearize (Simulink Control Design) and slLinearizer (Simulink Control Design) populate SamplingGrid in this way.

Object Functions

In general, any function applicable to Dynamic System Models is applicable to an idproc model object. These functions are of four general types.

• Functions that operate and return idproc model objects enable you to transform and manipulate idproc models. For instance, use merge to merge estimated idproc models.

• Functions that perform analytical and simulation functions on idproc objects, such as bode and sim

• Functions that retrieve or interpret model information, such as advice and getpar

• Functions that convert idproc objects into a different model type, such as idpoly for time domain or idfrd for frequency domain

The following lists contain a representative subset of the functions that you can use with idproc models.

expand all

 translatecov Translate parameter covariance across model transformation operations setpar Set attributes such as values and bounds of linear model parameters chgTimeUnit Change time units of dynamic system merge Merge estimated models

expand all

 sim Simulate response of identified model predict Predict state and state estimation error covariance at next time step using extended or unscented Kalman filter, or particle filter compare Compare identified model output with measured output impulse Impulse response plot of dynamic system; impulse response data step Step response plot of dynamic system; step response data bode Bode plot of frequency response, or magnitude and phase data

expand all

 tfdata Access transfer function data get Access model property values getpar Obtain attributes such as values and bounds of linear model parameters getcov Parameter covariance of identified model advice Analysis and recommendations for data or estimated linear models

expand all

 idtf Transfer function model with identifiable parameters idpoly Polynomial model with identifiable parameters idss State-space model with identifiable parameters idfrd Frequency response data or model

Examples

collapse all

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

$sys=\frac{0.01}{1+2\left(0.1\right)\left(10\right)s+{\left(10s\right)}^{2}}{e}^{-5s}$.

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 "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 parameterization and these initial guesses for process model estimation with procest.

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)
sys =

Process model with 3 outputs: y_k = Gk(s)u
From input 1 to output 1:
1+Tz*s
G1(s) = Kp * ------------------- * exp(-Td*s)
s(1+Tp1*s)(1+Tp2*s)

Kp = NaN
Tp1 = NaN
Tp2 = NaN
Td = NaN
Tz = NaN

From input 1 to output 2:
1+Tz*s
G1(s) = Kp * ------------------
(1+Tp1*s)(1+Tp2*s)

Kp = NaN
Tp1 = NaN
Tp2 = NaN
Tz = NaN

From input 1 to output 3:
1+Tz*s
G1(s) = Kp * -------------------
s(1+Tp1*s)(1+Tp2*s)

Kp = NaN
Tp1 = NaN
Tp2 = NaN
Tz = NaN

Parameterization:
{'P2DIZ'}
{'P2Z'  }
{'P2IZ' }
Number of free coefficients: 13
Use "getpvec", "getcov" for parameters and their uncertainties.

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

idproc creates a MIMO model where each character vector in the type array defines the structure of the corresponding I/O pair. Since type is a column vector of character vectors, sys is a one-input, three-output model having the specified parameterization structure. type{k,1} specifies the structure of the subsystem sys(k,1). All identifiable parameters are initialized to NaN.

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

Specify the structure for each model in the array of process models.

type1 = ["P1D","P2DZ"];
type2 = ["P0","P3UI"];
type3 = ["P2D","P2DI"];
type = cat(3,type1,type2,type3);
size(type)
ans = 1×3

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 three-model array of two-input, one-output process models.

Select a model from the array.

sysarr(:,:,2)
ans =

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.

Version History

Introduced before R2006a