| CAGE User's Guide | ![]() |
Using the Worked Example Optimization
In order to run any optimization, you first need to set up your CAGE session. You need the following:
For this example, the CAGE session requires
N, L, AFR, and SPK)
There is a preconfigured session provided that contains the model, variable dictionary, and data set.
optimworkedexample.cag. This should be in the mbctraining directory.
tq model was fitted to the Holliday engine data and exported from the Model Browser quick start tutorial (also used in the CAGE feature calibration tutorial). It can be found in tutorial.exm in the mbctraining directory. To view this model in your current session, click the Models button in the Data Objects pane.
Worked Example, and click Next.
spark in the left and right lists, and then click the large Select button. Similarly associate Speed with N, Load with L, and afr with A. Click Next.
tq model selected and Maximize chosen; these are specified in the function. Click the button to match the tq CAGE model with the Torque optimization model, then click Next.
New_Dataset selected (as it is the only one in the session). Click the button to match it to the operating point set SpeedLoadPoints, then click Finish.
This completes the optimization setup. CAGE switches to the Optimization view and the new WorkedExample node appears in the tree. The setup details appear in the right pane: the model to be maximized and the operating point set to use, as shown in the following example.
The Free Variable Set Up dialog box appears. These bounds and initial values are taken from the Variable Dictionary (where you also could change them if you wanted). Click OK to accept these values.
You will see the Optimization progress bar as the optimization runs.
WorkedExample_Output node in the tree. First you must expand the WorkedExample node as shown below.
The output display should look like the following. The optimization has found the values of SPK and AFR that give the maximum model value of torque at each operating point specified. Select different operating points by clicking in the table: the model plots at the selected operating point are shown. There is only one solution per operating point, so you cannot scroll through the solutions.
For a discussion of the worked example code and how the external optimization algorithm is implemented in the CAGE optimization, see About the Worked Example Optimization Algorithm. For a detailed walk-through of incorporating an example user-defined optimization algorithm into a CAGE optimization function, see the next tutorial section, Creating an Optimization from Your Own Algorithm.
| Worked Example Optimization | Creating an Optimization from Your Own Algorithm | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |