Model Predictive Control Toolbox    
ss2mod

Converts a discrete-time state-space system model into the MPC mod format.

Syntax

Description

Consider the process shown in the above block diagram. ss2mod assumes the following state-space representation:

where x is a vector of n state variables, u represents nu manipulated variables, d represents nd measured disturbances, w represents nw unmeasured disturbances, y is a vector of ny plant outputs, z is measurement noise, and , u, etc., are constant matrices of appropriate size. The variable (k) represents the plant output before the addition of measurement noise. We further define:

    D = [Du Dd Dw]

     = [u d w]

ss2mod uses the , , C, and D matrices you supply to build a model, pmod, in the MPC mod format. See the mod section for more details.

You can also divide the outputs into nym measured outputs and nyu unmeasured outputs, where nym + nyu = ny. Then the first nym elements in y and the first nym rows in C and D are assumed to be for the measured outputs, and the rest are for the unmeasured outputs.

minfo is an optional variable that allows you to specify certain characteristics of the system. The general form is a row vector with 7 elements, the interpretation of which is as follows:

minfo (1)
T, the sampling period used to create the model.
(2)
n, the number of states.
(3)
nu, the number of manipulated variable inputs.
(4)
nd, the number of measured disturbances.
(5)
nw, the number of unmeasured disturbances.
(6)
nym, the number of measured outputs.
(7)
nyu, the number of unmeasured outputs.

If you specify minfo as a scalar, ss2mod takes it as the sampling period and sets the remaining elements of minfo as follows:

In other words, the default is to assume that all inputs are manipulated variables and all outputs are measured. If you omit minfo, ss2mod sets the sampling period to 1 and uses the defaults for the remaining elements.

Example

Suppose you have the situation shown in the above diagram where u, d, w, and y are scalar signals, and the three transfer functions are first-order:


The sampling period is T = 2.

One way to build the model of the complete system is to convert these to state-space form and use ss2mod:

You must be careful to build up the parallel structure in the correct order. For example, the columns corresponding to u must always come first in .

Another, more foolproof way is to use the addmd and addumd functions:

Using either approach, the result is:

See Also
mod format, mod2ss



smpcsim ss2step