# idtf

Transfer function model with identifiable parameters

## Description

sys = idtf(num,den) creates a continuous-time transfer function with identifiable parameters (an idtf model). num specifies the current values of the transfer function numerator coefficients. den specifies the current values of the transfer function denominator coefficients.

sys = idtf(num,den,Ts) creates a discrete-time transfer function with identifiable parameters. Ts is the sample time.

sys = idtf(___,Name,Value) creates a transfer function with properties specified by one or more Name,Value pair arguments.

sys = idtf(sys0) converts any dynamic system model, sys0, to idtf model form.

## Object Description

An idtf model represents a system as a continuous-time or discrete-time transfer function with identifiable (estimable) coefficients.

A SISO transfer function is a ratio of polynomials with an exponential term. In continuous time,

$G\left(s\right)={e}^{-\tau s}\frac{{b}_{n}{s}^{n}+{b}_{n-1}{s}^{n-1}+...+{b}_{0}}{{s}^{m}+{a}_{m-1}{s}^{m-1}+...+{a}_{0}}.$

In discrete time,

$G\left({z}^{-1}\right)={z}^{-k}\frac{{b}_{n}{z}^{-n}+{b}_{n-1}{z}^{-n+1}+...+{b}_{0}}{{z}^{-m}+{a}_{m-1}{z}^{-m+1}+...+{a}_{0}}.$

In discrete time, zk represents a time delay of kTs, where Ts is the sample time.

For idtf models, the denominator coefficients a0,...,am–1 and the numerator coefficients b0,...,bn can be estimable parameters. (The leading denominator coefficient is always fixed to 1.) The time delay τ (or kin discrete time) can also be an estimable parameter. The idtf model stores the polynomial coefficients a0,...,am–1 and b0,...,bn in the Denominator and Numerator properties of the model, respectively. The time delay τ or k is stored in the IODelay property of the model.

A MIMO transfer function contains a SISO transfer function corresponding to each input-output pair in the system. For idtf models, the polynomial coefficients and transport delays of each input-output pair are independently estimable parameters.

There are three ways to obtain an idtf model.

• Estimate the idtf model based on input-output measurements of a system, using tfest. The tfest command estimates the values of the transfer function coefficients and transport delays. The estimated values are stored in the Numerator, Denominator, and IODelay properties of the resulting idtf model. 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 idtf model by estimation, you can extract estimated coefficients and their uncertainties from the model. To do so, use commands such as tfdata, getpar, or getcov.

• Create an idtf model using the idtf command.

You can create an idtf model to configure an initial parameterization for estimation of a transfer function to fit measured response data. When you do so, you can specify constraints on such values as the numerator and denominator coefficients and transport delays. For example, you can fix the values of some parameters, or specify minimum or maximum values for the free parameters. You can then use the configured model as an input argument to tfest to estimate parameter values with those constraints.

• Convert an existing dynamic system model to an idtf model using the idtf command.

### Note

Unlike idss and idpoly, idtf uses a trivial noise model and does not parameterize the noise.

So, H = 1 in $y=Gu+He$.

## Examples

collapse all

Specify a continuous-time, single-input, single-output (SISO) transfer function with estimable parameters. The initial values of the transfer function are:

$G\left(s\right)=\frac{s+4}{{s}^{2}+20s+5}$

num = [1 4];
den = [1 20 5];
G = idtf(num,den);

G is an idtf model. num and den specify the initial values of the numerator and denominator polynomial coefficients in descending powers of $s$. The numerator coefficients having initial values 1 and 4 are estimable parameters. The denominator coefficient having initial values 20 and 5 are also estimable parameters. The leading denominator coefficient is always fixed to 1.

You can use G to specify an initial parameterization for estimation with tfest.

Specify a continuous-time, SISO transfer function with known input delay. The transfer function initial values are given by:

$G\left(s\right)={e}^{-5.8s}\frac{5}{s+5}$

Label the input of the transfer function with the name 'Voltage' and specify the input units as volt.

Use Name,Value input pairs to specify the delay, input name, and input unit.

num = 5;
den = [1 5];
input_delay = 5.8;
input_name = 'Voltage';
input_unit = 'volt';
G = idtf(num,den,'InputDelay',input_delay,...
'InputName',input_name,'InputUnit',input_unit);

$G$ is an idtf model. You can use G to specify an initial parameterization for estimation with tfest. If you do so, model properties such as InputDelay, InputName, and InputUnit are applied to the estimated model. The estimation process treats InputDelay as a fixed value. If you want to estimate the delay and specify an initial value of 5.8 s, use the IODelay property instead.

Specify a discrete-time SISO transfer function with estimable parameters. The initial values of the transfer function are:

$H\left(z\right)=\frac{z-0.1}{z+0.8}$

Specify the sample time as 0.2 seconds.

num = [1 -0.1];
den = [1 0.8];
Ts = 0.2;
H = idtf(num,den,Ts);

num and den are the initial values of the numerator and denominator polynomial coefficients. For discrete-time systems, specify the coefficients in ascending powers of ${z}^{-1}$.

Ts specifies the sample time for the transfer function as 0.2 seconds.

H is an idtf model. The numerator and denominator coefficients are estimable parameters (except for the leading denominator coefficient, which is fixed to 1).

Specify a discrete-time, two-input, two-output transfer function. The initial values of the MIMO transfer function are:

$H\left(z\right)=\left[\begin{array}{cc}\frac{1}{z+0.2}& \frac{z}{z+0.7}\\ \frac{-z+2}{z-0.3}& \frac{3}{z+0.3}\end{array}\right]$

Specify the sample time as 0.2 seconds.

nums = {1,[1,0];[-1,2],3};
dens = {[1,0.2],[1,0.7];[1,-0.3],[1,0.3]};
Ts = 0.2;
H = idtf(nums,dens,Ts);

nums and dens specify the initial values of the coefficients in cell arrays. Each entry in the cell array corresponds to the numerator or denominator of the transfer function of one input-output pair. For example, the first row of nums is {1,[1,0]}. This cell array specifies the numerators across the first row of transfer functions in H. Likewise, the first row of dens, {[1,0.2],[1,0.7]}, specifies the denominators across the first row of H.

Ts specifies the sample time for the transfer function as 0.2 seconds.

H is an idtf model. All of the polynomial coefficients are estimable parameters, except for the leading coefficient of each denominator polynomial. These coefficients are always fixed to 1.

Specify the following discrete-time transfer function in terms of q^-1:

$H\left({q}^{-1}\right)=\frac{1+0.4{q}^{-1}}{1+0.1{q}^{-1}-0.3{q}^{-2}}$

Specify the sample time as 0.1 seconds.

num = [1 0.4];
den = [1 0.1 -0.3];
Ts = 0.1;
convention_variable = 'q^-1';
H = idtf(num,den,Ts,'Variable',convention_variable);

Use a Name,Value pair argument to specify the variable q^-1.

num and den are the numerator and denominator polynomial coefficients in ascending powers of ${q}^{-1}$.

Ts specifies the sample time for the transfer function as 0.1 seconds.

H is an idtf model.

Specify a transfer function with estimable coefficients whose initial value is the static gain matrix:

$H\left(s\right)=\left[\begin{array}{ccc}1& 0& 1\\ 1& 1& 0\\ 3& 0& 2\end{array}\right]$

M = [1 0 1; 1 1 0; 3 0 2];
H = idtf(M);

H is an idtf model that describes a three input (Nu=3), three output (Ny=3) transfer function. Each input/output channel is an estimable static gain. The initial values of the gains are given by the values in the matrix M.

Convert a state-space model with identifiable parameters to a transfer function with identifiable parameters.

Convert the following identifiable state-space model to an identifiable transfer function.

$\begin{array}{l}\underset{}{\overset{\sim }{x}}\left(t\right)=\left[\begin{array}{cc}-0.2& 0\\ 0& -0.3\end{array}\right]x\left(t\right)+\left[\begin{array}{c}-2\\ 4\end{array}\right]u\left(t\right)+\left[\begin{array}{c}0.1\\ 0.2\end{array}\right]e\left(t\right)\\ y\left(t\right)=\left[\begin{array}{cc}1& 1\end{array}\right]x\left(t\right)\end{array}$

A = [-0.2, 0; 0, -0.3];
B = [2;4];
C = [1, 1];
D = 0;
K = [0.1; 0.2];
sys0 = idss(A,B,C,D,K,'NoiseVariance',0.1);
sys = idtf(sys0);

A, B, C, D and K are matrices that specify sys0, an identifiable state-space model with a noise variance of 0.1.

sys = idtf(sys0) creates an idtf model, sys.

Load time-domain system response data and use it to estimate a transfer function for the system.

np = 2;
sys = tfest(z1,np);

z1 is an iddata object that contains time-domain, input-output data.

np specifies the number of poles in the estimated transfer function.

sys is an idtf model containing the estimated transfer function.

To see the numerator and denominator coefficients of the resulting estimated model sys, enter:

sys.Numerator
ans = 1×2

2.4554  176.9856

sys.Denominator
ans = 1×3

1.0000    3.1625   23.1631

To view the uncertainty in the estimates of the numerator and denominator and other information, use tfdata.

Create an array of transfer function models with identifiable coefficients. Each transfer function in the array is of the form:

$H\left(s\right)=\frac{a}{s+a}.$

The initial value of the coefficient $a$ varies across the array, from 0.1 to 1.0, in increments of 0.1.

H = idtf(zeros(1,1,10));
for k = 1:10
num = k/10;
den = [1 k/10];
H(:,:,k) = idtf(num,den);
end

The first command preallocates a one-dimensional, 10-element array, H, and fills it with empty idtf models.

The first two dimensions of a model array are the output and input dimensions. The remaining dimensions are the array dimensions. H(:,:,k) represents the ${k}^{th}$ model in the array. Thus, the for loop replaces the ${k}^{th}$ entry in the array with a transfer function whose coefficients are initialized with $a=k/10$.

## Input Arguments

 num Initial values of transfer function numerator coefficients. For SISO transfer functions, specify the initial values of the numerator coefficients num as a row vector. Specify the coefficients in order of: Descending powers of s or p (for continuous-time transfer functions)Ascending powers of z–1 or q–1 (for discrete-time transfer functions) Use NaN for any coefficient whose initial value is not known. For MIMO transfer functions with Ny outputs and Nu inputs, num is a Ny-by-Nu cell array of numerator coefficients for each input/output pair. den Initial values of transfer function denominator coefficients. For SISO transfer functions, specify the initial values of the denominator coefficients den as a row vector. Specify the coefficients in order of: Descending powers of s or p (for continuous-time transfer functions)Ascending powers of z–1 or q–1 (for discrete-time transfer functions) The leading coefficient in den must be 1. Use NaN for any coefficient whose initial value is not known. For MIMO transfer functions with Ny outputs and Nu inputs, den is a Ny-by-Nu cell array of denominator coefficients for each input/output pair. Ts Sample time. For continuous-time models, Ts = 0. For discrete-time models, Ts is a positive scalar representing the sampling period. This value is expressed in the unit specified by the TimeUnit property of the model. To denote a discrete-time model with unspecified sample time, set Ts = -1. Changing this property does not discretize or resample the model. Use c2d and d2c to convert between continuous- and discrete-time representations. Use d2d to change the sample time of a discrete-time system. Default: 0 (continuous time) sys0 Dynamic system. Any dynamic system to convert to an idtf model. When sys0 is an identified model, its estimated parameter covariance is lost during conversion. If you want to translate the estimated parameter covariance during the conversion, use translatecov.

### 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 quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Use Name,Value arguments to specify additional properties of idtf models during model creation. For example, idtf(num,den,'InputName','Voltage') creates an idtf model with the InputName property set to Voltage.

## Properties

idtf object properties include: