| Model Predictive Control Toolbox | ![]() |
poly2tfd converts a transfer function (continuous or discrete) from the standard MATLAB poly format into the MPC tf format.
Syntax
Description
Consider a continuous-time (Laplace domain) transfer function such as

or a discrete-time transfer function such as

where z is the forward-shift operator. Using the MATLAB poly format, you would represent either of these as a numerator polynomial and a denominator polynomial, giving the coefficients of the highest-order terms first:
If the numerator contains leading zeros, they may be omitted, i.e., the number of elements innum can be
the number of elements in den.
poly2tfd uses num and den as input to build a transfer function, g, in the MPC tf format (see tf section for details). Optional variables you can include are:
delt
The sampling period. If this is zero or you omit it, poly2tfd assumes that you are supplying a continuous-time transfer function. If you are supplying a discrete-time transfer function you must specify delt. Otherwise g will be misinterpreted when you use it later in the MPC Toolbox functions.
delay
The time delay. For a continuous-time transfer function, delay should be in time units. For a discrete-time transfer function, delay should be specified as the integer number of sampling periods of time delay. If you omit it, poly2tfd assumes a delay of zero.
Examples
Consider the continuous-time transfer function:
G(s) = 0.5
.
It has no delay. The following command creates the MPC tf format:
Now suppose there were a delay of 2.5 time units: Next let's get the equivalent transfer function in discrete form. An easy way is to get the correct poly form usingcp2dp, then use poly2tfd to get it in the tf form. Here are the commands to do it using a sampling period of 0.75 time units:
delt=0.75; [numd,dend]=cp2dp(0.5*[3 -1],[5 2 1],delt,rem(2.5,delt)); g=poly2tfd(numd,dend,delt,fix(2.5/delt));
cp2dp is used to handle the fractional time delay and the integer number of sampling periods of time delay is an input to poly2tfd. The results are:
numd = 0 0.1232 -0.1106 -0.0607 dend = 1.0000 -1.6445 0.7408 0 g = 0 0.1232 -0.1106 -0.0607 1.0000 -1.6445 0.7408 0 0.7500 3.0000 0 0
See Also
cp2dp, tf, th2mod, tfd2step
![]() | plsr | scmpc | ![]() |