| Model Predictive Control Toolbox | ![]() |
Uses a model in the mod format to calculate the step response of a SISO or MIMO system in MPC step format.
Syntax
[plant,dplant] = mod2step(mod,tfinal,delt2,nout)
Description
The input variable mod is assumed to be a model in the mod format (see mod in the online MATLAB Function Reference for a description). You would normally create it using ss2mod, tfd2mod, or th2mod. The input variable tfinal is the time at which you would like to end the step response.
The optional input variable delt2 is the desired sampling period for the step response. If you use delt2=[ ] or omit it, the default is equal to the sampling period of mod (contained in the minfo vector of mod).
The optional input variable nout is the output stability indicator. For stable systems, set nout equal to the number of outputs, ny. For systems with one or more integrating outputs, nout is a column vector of length ny with nout(i)=0 indicating an integrating output and nout(i)=1 indicating a stable output. If you use nout=[ ] or omit it, the default is nout=ny (only stable outputs).
plant and dplant are matrices in MPC step format containing the calculated step responses. plant is the response to the manipulated variables, and dplant is the response to the disturbances (if any), both measured and unmeasured. The overall dimensions of these matrices are:
plant n-by-ny + ny + 2 rows, nu columns.
dplant n-by-ny + ny + 2 rows, nd + nw columns.
where n = round (tfinal/delt2)
It is assumed that stable step responses are nearly constant after n sampling periods, while integrating responses increase with a constant slope after n - 1 sampling periods.
Each column gives the step response with respect to the corresponding input variable. Within each column, the first ny elements are the response for each output at time t = T, the next ny elements give each output at time t = 2T, etc.
The last ny + 2 rows contain nout, ny and delt2, respectively (all in column 1 -- any remaining elements in these rows are set to zero). In other words, for plant the arrangement is as follows:
Skji is the ith step response coefficient describing the effect of input j on output k.
The arrangement of dplant is similar; the only difference is in the number of columns.
Example
The following process has 3 inputs and 4 outputs:
dstep:
nstep=4; delt=1.5; yu1=dstep(phi,gam,c,d,1,nstep) yu2=dstep(phi,gam,c,d,2,nstep) yu3=dstep(phi,gam,c,d,3,nstep)
We then use mod2step to do the same job:
plant = 2.0000 0 0 0 0 1.0000 0 1.0000 1.0000 0 1.0000 0 2.3000 0 0 0 0 0.3000 0 1.7000 0.3000 0 1.7000 0 2.3900 0 0 0 0 0.7900 0 2.1900 0.7900 0 2.1900 0 1.0000 0 0 1.0000 0 0 1.0000 0 0 1.0000 0 0 4.0000 0 0 1.5000 0 0
See Also
plotstep, ss2step, tfd2step
![]() | mod2ss | mpcaugss | ![]() |