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


num = [b0 b1 ... bn ]; den = [a0 a1 ... an ];If the numerator contains leading zeros, they may be omitted, i.e., the number of elements in
num 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
.
g=poly2tfd(0.5*[3 -1],[5 2 1]);Now suppose there were a delay of 2.5 time units: G(s) = 0.5
. You could use:
g=poly2tfd(0.5*[3 -1],[5 2 1],0,2.5);Next let's get the equivalent transfer function in discrete form. An easy way is to get the correct poly form using
cp2dp, 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]=Note thatcp2dp(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 | ![]() |