Model Predictive Control Toolbox | ![]() ![]() |
Converts a SISO or MISO model from the theta format (as used in the System Identification Toolbox) to one in the MPC mod format. Can also combine such models to form a MIMO system.
Syntax
umod =th2mod
(th) [umod,emod] =th2mod
(th1,th2,...,thN)
Description
The System Identification Toolbox allows you to identify single-input, single-output (SISO) and multi-input, single-output (MISO) transfer functions from data. The MISO form relating an output, y, to m inputs, u1 to um, and a noise input, e, is:
th2mod
converts one or more MISO theta models into the MPC mod format, which you can then use with the MPC Toolbox functions. If you supply a single input argument, th
, and a single output argument, umod
, then umod
will model the response of a single output, y, to m inputs, u1 to um, where m th
. Note that umod
will reflect the values of the A(z), B(z), and F(z) polynomials in eq. 1.
If you supply a second output argument, emod
, it will model the response of y to the noise, e, i.e., the A(z), C(z) and D(z) polynomials in eq. 1.
If you supply p input models (1 tfd2mod
assumes that they define a MIMO system in the following form:umod
output model (and the emod
model, if used).
If the th
models are auto-regressive (i.e., m = 0), then umod
will be set to an empty matrix and only emod
will be nonempty.
Example
The following commands create three SISO theta models using the mktheta
command (System Identification Toolbox), then converts them to the equivalent mod form:
th1=mktheta([1 0 -.2],[0 0 -1]);
th2=mktheta([1 -.8 .1],[0 -.5 .3],1,1,1);
th3=mktheta([1 -.2],[0 1],[1 2 0],[1 -1.2 .3], 1);
[umod,emod]=th2mod
(th1,th2,th3)
The results are:
umod = 1.0000 5.0000 1.0000 0 0 3.0000 0 NaN 0 0.2000 0 0 0 1.0000 0 1.0000 0 0 0 0 0 0 0 0 0.8000 -0.1000 0 1.0000 0 0 0 1.0000 0 0 0 0 0 0 0 0 2.0000 1.0000 0 0 -1.0000 0 0 0 0 0 0 0 -0.5000 0.3000 0 0 0 0 0 0 0 1.0000 emod = Columns 1 through 7 1.0000 7.0000 3.0000 0 0 3.0000 0 NaN 0 0.2000 0 0 0 0 0 1.0000 0 0 0 0 0 0 0 0 0.8000 -0.1000 0 0 0 0 0 1.0000 0 0 0 0 0 0 0 0 1.4000 -0.5400 0 0 0 0 0 1.0000 0 0 0 0 0 0 0 1.0000 0 0 0.2000 0 0 0 0 0 0 0 0.8000 -0.1000 0 0 0 0 0 0 0 3.4000 -0.5400 Columns 8 through 11 0 0 0 0 0 1.0000 0 0 0 0 0 0 0 0 1.0000 0 0 0 0 0 0.0600 0 0 1.0000 0 0 0 0 0 0 0 0 0 1.0000 0 0 0 0 1.0000 0 0.0600 0 0 1.0000
Restriction
The System Identification Toolbox must be installed to use this function.
![]() | tfd2step | validmod | ![]() |