Categories &

Functions List

Class Definition: tf

Function File: s = tf ('s')
Function File: z = tf ('z', tsam)
Function File: sys = tf (sys)
Function File: sys = tf (mat, …)
Function File: sys = tf (num, den, …)
Function File: sys = tf (num, den, tsam, …)

Create or convert to transfer function model.

Inputs

sys

LTI model to be converted to transfer function.

mat

Gain matrix to be converted to static transfer function.

num

Numerator or cell of numerators. Each numerator must be a row vector containing the coefficients of the polynomial in descending powers of the transfer function variable. num{i,j} contains the numerator polynomial from input j to output i. In the SISO case, a single vector is accepted as well.

den

Denominator or cell of denominators. Each denominator must be a row vector containing the coefficients of the polynomial in descending powers of the transfer function variable. den{i,j} contains the denominator polynomial from input j to output i. In the SISO case, a single vector is accepted as well.

tsam

Sampling time in seconds. If tsam is not specified, a continuous-time model is assumed.

Optional pairs of properties and values. Type set (tf) for more information.

Outputs

sys

Transfer function model.

Option Keys and Values

’num’

Numerator. See ’Inputs’ for details.

’den’

Denominator. See ’Inputs’ for details.

’tfvar’

String containing the transfer function variable.

’inv’

Logical. True for negative powers of the transfer function variable.

’tsam’

Sampling time. See ’Inputs’ for details.

’inname’

The name of the input channels in sys. Cell vector of length m containing strings. Default names are {'u1', 'u2', ...}

’outname’

The name of the output channels in sys. Cell vector of length p containing strings. Default names are {'y1', 'y2', ...}

’ingroup’

Struct with input group names as field names and vectors of input indices as field values. Default is an empty struct.

’outgroup’

Struct with output group names as field names and vectors of output indices as field values. Default is an empty struct.

’name’

String containing the name of the model.

’notes’

String or cell of string containing comments.

’userdata’

Any data type.

Example

 
 
 octave:1> s = tf ('s');
 octave:2> G = 1/(s+1)

 Transfer function 'G' from input 'u1' to output ...
 
         1  
  y1:  -----
       s + 1
 
 Continuous-time model.

 octave:3> z = tf ('z', 0.2);
 octave:4> H = 0.095/(z-0.9)
 
 Transfer function 'H' from input 'u1' to output ...
 
        0.095 
  y1:  -------
       z - 0.9
 
 Sampling time: 0.2 s
 Discrete-time model.

 octave:5> num = {[1, 5, 7], [1]; [1, 7], [1, 5, 5]};
 octave:6> den = {[1, 5, 6], [1, 2]; [1, 8, 6], [1, 3, 2]};
 octave:7> sys = tf (num, den)
 
 Transfer function 'sys' from input 'u1' to output ...
 
       s^2 + 5 s + 7
  y1:  -------------
       s^2 + 5 s + 6
 
           s + 7    
  y2:  -------------
       s^2 + 8 s + 6
 
 Transfer function 'sys' from input 'u2' to output ...
 
         1  
  y1:  -----
       s + 2
 
       s^2 + 5 s + 5
  y2:  -------------
       s^2 + 3 s + 2
 
 Continuous-time model.
 octave:8> 
 
 

See also: filt, ss, dss

Source Code: tf

Method: tf

Function File: s = tf ('s')
Function File: z = tf ('z', tsam)
Function File: sys = tf (sys)
Function File: sys = tf (mat, …)
Function File: sys = tf (num, den, …)
Function File: sys = tf (num, den, tsam, …)

Create or convert to transfer function model.

Inputs

sys

LTI model to be converted to transfer function.

mat

Gain matrix to be converted to static transfer function.

num

Numerator or cell of numerators. Each numerator must be a row vector containing the coefficients of the polynomial in descending powers of the transfer function variable. num{i,j} contains the numerator polynomial from input j to output i. In the SISO case, a single vector is accepted as well.

den

Denominator or cell of denominators. Each denominator must be a row vector containing the coefficients of the polynomial in descending powers of the transfer function variable. den{i,j} contains the denominator polynomial from input j to output i. In the SISO case, a single vector is accepted as well.

tsam

Sampling time in seconds. If tsam is not specified, a continuous-time model is assumed.

Optional pairs of properties and values. Type set (tf) for more information.

Outputs

sys

Transfer function model.

Option Keys and Values

’num’

Numerator. See ’Inputs’ for details.

’den’

Denominator. See ’Inputs’ for details.

’tfvar’

String containing the transfer function variable.

’inv’

Logical. True for negative powers of the transfer function variable.

’tsam’

Sampling time. See ’Inputs’ for details.

’inname’

The name of the input channels in sys. Cell vector of length m containing strings. Default names are {'u1', 'u2', ...}

’outname’

The name of the output channels in sys. Cell vector of length p containing strings. Default names are {'y1', 'y2', ...}

’ingroup’

Struct with input group names as field names and vectors of input indices as field values. Default is an empty struct.

’outgroup’

Struct with output group names as field names and vectors of output indices as field values. Default is an empty struct.

’name’

String containing the name of the model.

’notes’

String or cell of string containing comments.

’userdata’

Any data type.

Example

 
 
 octave:1> s = tf ('s');
 octave:2> G = 1/(s+1)

 Transfer function 'G' from input 'u1' to output ...

         1
  y1:  -----
       s + 1

 Continuous-time model.

 octave:3> z = tf ('z', 0.2);
 octave:4> H = 0.095/(z-0.9)

 Transfer function 'H' from input 'u1' to output ...

        0.095
  y1:  -------
       z - 0.9

 Sampling time: 0.2 s
 Discrete-time model.

 octave:5> num = {[1, 5, 7], [1]; [1, 7], [1, 5, 5]};
 octave:6> den = {[1, 5, 6], [1, 2]; [1, 8, 6], [1, 3, 2]};
 octave:7> sys = tf (num, den)

 Transfer function 'sys' from input 'u1' to output ...

       s^2 + 5 s + 7
  y1:  -------------
       s^2 + 5 s + 6

           s + 7
  y2:  -------------
       s^2 + 8 s + 6

 Transfer function 'sys' from input 'u2' to output ...

         1
  y1:  -----
       s + 2

       s^2 + 5 s + 5
  y2:  -------------
       s^2 + 3 s + 2

 Continuous-time model.
 octave:8>
 
 

See also: filt, ss, dss