| Simulink® Response Optimization™ | ![]() |
result=optimize(proj)
result=optimize(proj) optimizes the responses specified in the response optimization project, proj, with the constraints, parameters, and settings. The response optimization results are displayed after each iteration. The tuned parameters are changed in the workspace. Enter the parameter name at the MATLAB prompt to see its new value.
A results object, result, is also returned. The properties of this object are
Cost: The final value of the cost function.
ExitFlag: 1 if the optimization terminated successfully, 0 if it did not.
Iteration: The number of iterations.
For more information on the results properties, see the reference pages for the Optimization Toolbox functions fmincon and fminsearch and the Genetic Algorithm and Direct Search Toolbox function patternsearch.
Open the pitchrate_demo model.
pitchrate_demo
Create a response optimization project based on the current settings in the model.
proj=getsro('pitchrate_demo');Run the optimization with the following command.
results=optimize(proj)
The expected results are displayed as follows.
max Directional First-order
Iter S-count f(x) constraint Step-size derivative optimality Procedure
0 1 0 1803
1 14 0 160 0.0287 0 0.0152
2 21 0 0.2607 0.0327 0 0.00598 Hessian modified
3 28 0 0.04203 0.071 0 0.0122 Hessian modified
4 35 0 0.001894 0.0164 0 0.00112 Hessian modified
5 42 0 7.631e-006 0.000804 0 5.01e-006 Hessian modified
Successful termination.
Found a feasible or optimal solution within the specified tolerances.
k1 =
0.8674
k2 =
-0.1513
k3 =
-0.5003
results =
Cost: 0
X: [4x1 double]
ExitFlag: 1
Iteration: 5The results can differ due to changes in MATLAB numerics, Simulink solvers, optimization algorithms, and running on different platforms.
findconstr, findpar, getsro, newsro, optimget, optimset
![]() | optimget | optimset | ![]() |
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |