| CAGE User's Guide | ![]() |
Worked Example Optimization
There is a simple worked example provided to show you what you can do by modifying the template file to write your own optimizations. This example demonstrates a simple use of the CAGE optimization feature. The aim of this example is to obtain values of spark (SPK) and air/fuel ratio (AFR) that maximize torque at a given speed (N) and load (L). These values could then be used to fill calibration tables.
An example of a user-defined optimization algorithm is provided.
mbcweoptimizer is an example of a user-specified optimization that solves the following problem:
Maximum TQ over (AFR, SPK) at a given (N, L) point.
The syntax for this example function, mbcweoptimizer, mimics that used in the Optimization Toolbox.
[bestafr,bestspk]=mbcweoptimizer(TQ, speed, load) finds an optimal (bestafr,bestspk) that gives a maximum TQ at the given speed and load.
The optimization finds values of AFR and spark (the free variables) that give the maximum output from TQ at the values of speed and load (the fixed variables) that you specified, as shown below.
To use this optimization algorithm in CAGE, you need to include the function in a CAGE optimization function M-file. This worked example modifies the template provided to show you how to use your own user-defined algorithms. You can find detailed information on all the available CAGE optimization interface functions in Optimization Template.
The worked example optimization wraps mbcweoptimizer in a function that can be called by the CAGE optimization feature. When you run your optimization from CAGE, you can alter the search ranges of the free variables and the resolution of the search.
| Automated Tradeoff | Using the Worked Example Optimization | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |