|
|
|
| R2012a Documentation → Model Predictive Control Toolbox | |
Learn more about Model Predictive Control Toolbox |
|
| Contents | Index |
To import a plant model, do one of the following:
Select the MPC/Import/Plant Model menu option.
Select the MPC project/task node in the tree (see Tree View), and then click the Import Plant button.
Right-click the MPC project/task node and select the Import Plant Model menu option.
If you've already imported a model, select the Plant models node, and then click the Import button, or right-click the Plant models node and select the Import Model menu option.
The Plant Model Importer dialog box opens (see the dialog box in Import from for an example). Within the dialog box you can import an LTI model from the workspace or, when you have Simulink Control Design software, you can import a linearized plant model from the Simulink model.
Note Once you have imported a model, any additional models you import to the same MPC project or task must have the identical structure, i.e., the same number of input and output signals, each appearing in the same sequence and having the same signal type designations. If you attempt to import a model that violates one of these conditions, the design tool issues a warning message. If you persist, all previously loaded models will be deleted and the controller design will be re-initialized using the latest model. |
The following sections describe model import options:
Use these options to set the location from which the model will be imported.

This is the default option and is the case shown in the above example. The Items in your workspace area in the upper-right corner lists all candidate models in your MATLAB workspace. Select one by clicking it. The Properties area lists the selected model's properties (the DC model in the above example).
The upper part of the dialog box changes as shown below.

The MAT-file name edit box becomes active. Type the desired MAT-file name (if it's not on the MATLABpath, enter the complete file path). You can also use the Browse button which opens a file chooser window.
In the above example, file DCmodels.mat contains two models. Their names appear in the Items in your MAT-file area in the upper-right corner. As with the workspace option, the selected model's properties appear in the Properties area.
The combo box at the bottom of the dialog box allows you to specify the MPC project/task into which the plant model will be imported (see example below). It defaults to the active project.
![]()
Select the model you want to import from the Items list in the upper-right corner of the dialog box. Verify that the Import to option designates the correct project/task. Click the Import button to import the model.
To verify that the model has been loaded, select Plant models in the tree. (See Tree View, and Plant Models View.)
The import dialog box remains visible until you close it so you can import additional models.
Click Close to close the dialog box. You can also click the Close icon on the title bar.
Open the design tool from within a Simulink model as discussed in Opening the MPC Design Tool.
Open the Plant Model Importer dialog box (see Importing a Plant Model).
Click the Linearized Plant from Simulink tab (see the following example).
Note If you haven't activated the design tool within Simulink, the Linearized Plant from Simulink tab is unavailable. |

If you click OK, the design tool uses Simulink Control Design software to create a linearized plant model. It performs the following tasks automatically:
Temporarily inserts linearization input and output points in the Simulink model at the inputs and outputs of the MPC block.
When the Create a new operating condition from MPC I/O values option is selected, the Model Predictive Control Toolbox software temporarily inserts output constraints at the inputs/outputs of the MPC block.
Finds a steady state operating condition based on the constraints or uses the specified operating condition.
The linearized plant model appears as a new node under Plant Models. For details of the linearization process, refer to the Simulink Control Design documentation.
You can customize the linearization process in several ways:
To specify a name for the linearized plant model, enter the name in the Linearization model name edit box.
To use an alternative operating condition, you can:
Select one from the menu next to Use the previously computed operating condition. This list contains all operating conditions that exist within the current project.
Select Create a new operating condition from MPC I/O values to compute an operating condition by optimization, using the nominal plant values as constraints. See the Getting Started for an example involving a nonlinear chemical reactor (CSTR).
To replace the nominal plant values with the operating point used in the linearization, select the check box next to Replace the MPC nominal I/O values with those derived from the operating condition.
When there are multiple MPC blocks in the Simulink diagram, use the Import to menu to select the one that will receive the plant model.
Note The above linearization process automatically identifies the plant's input and output variables according your signal connections in the Simulink model. The controller block does not allow signals corresponding to unmeasured disturbance or unmeasured output variables. Consequently, such variables cannot be included in a model created via the above linearization procedure. If you must include such variables in your controller design, use the Simulink Control Design tool to designate the signals to be used, linearize the plant, and then import this linearized model into the MPC design tool. See the Getting Started for an example of this procedure. |
![]() | Tree View | Importing a Controller | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |