Linköping University, SE-581 83 Linköping, Sweden

Control Systems Engineering Laboratory,

Arizona State University, Tempe, Arizona 85287-6006

** Be sure that you have downloaded the MoDMPC toolbox, unzipped
it, and placed the toolbox directory and all of the subfolders in your
MATLAB path**.

If you need a decompression utility, try WinZip.

Here is a list of the demo Simulink files, and the data used to run them:

- cstr1.mdl/demo1e.mat/demo1v.mat/demo1n.mat
- cstr2.mdl/demo1e.mat/demo1v.mat/demo1n.mat
- cstr2b.mdl/demo2e.mat/demo2v.mat/demo2n.mat
- cstr3.mdl/demo1e.mat/demo1v.mat/demo1n.mat (note: you need to load the setpoint trajectory rout.mat into the workspace to run the simulation)
- cstr4.mdl/demo1e.mat/demo1v.mat/demo1n.mat
- cstr5.mdl/demo4e.mat/demo4v.mat/demo4n.mat

In a similar manner, select "demo1v.mat", after pressing the the "Load
Validation Data" button, and then press "open".

To load the NARX structure matrix, press "Load NARX Matrix", and select
"demo1n.mat".

Having made these selections, press the "Plot Time Domain" button to generate the following figure.

If the data properties have not been specified such that they make sense with the datafile, an error message will appear in the GUI.

To get a sense for the second order information in the data, we can look at the differenced input/output spaces. To plot the differenced versions of the options selected in the Space Domains area, press "Plot Dif. Space Domains".

Pressing the "Validate" button, we get the wait bar and then see the following plots:

Note that the MoD Estimator selected an ill-conditioned model just before
time 3. The number of datapoints used at this time was 36.
So we know that *k _{min}*

should probably be raised to something above this. Let's choose 45, and validate again.

At this point, *k _{min }*has
been set high enough to provide well-conditioned local models for prediction
through the regressor spaces of the validation data. Note that this
value may still need to be raised if "bursts" are evident during control
experiments of Simulink models. By inspection of the plot, we see
that the MoD estimator does not predict the last 4 to 5 hours as well as
the first 10 hours. This is partly due to the way the input signal
was designed (to emphasize high frequency). We can look at a 15 step
ahead prediction to see how the initial time prediction of MoD performs
with this data.

Now that we are satisfied with the validation, we will use the "Save
Parameters" button to save ALL the parameters under one structure.
Then we can load this structure back into the workspace, so we can run
a MoDMPC block. As an example, we have saved the variable "demoparms".

First, 2x click on the button "2x Click to Initialize". Next,
bring up the "MoDMPC 1" parameters by double clicking on the MoDMPC 1 block.

Type in the name of the parameters structure you specified in 2.5,
we'll use "demoparms". Be sure to load the parameter set into the
workspace (i.e. type "load demoparms"). The rest of the controller
options have been prespecified, such that the controller will run with
good performance.

The Simulink window is now started. Note that there are scopes on the control and manipulated variables, so you may watch the results as they are generated. Once the simulation is done, the button "2x click to plot data" may be pressed to generate a figure of the results, along with RMS control error calculations.

In a similar manner, the other demos included with the toolbox can be
used to understand the specifics of each type of controller block, along
with the help file.