What is the order that fmincon uses to evaluate objective and nonlinear constraint functions?
Show older comments
Hi everyone, I'm working in dynamic optimization using fmincon as a solver and control vector parametrizaton approach. This means that in every iteration I must solve a ODE set with the value of the decision variables given by the optimizer in order to obtain the value of the objective function.
Also, the problem is constrained in the state variables at the final time, therefore, to evaluate the constraints it is necessary to solve again the same ODE set that was simulated in the objective function.
I was thinking in skipping the simulation step in the evaluation of the nonlinear constraints, by using global variables with the value of the states variables obtained previously at the objective function. Nevertheless, this would be valid, ony if in all the iterations, the optimizer first evaluates the objective function and in a second step the nonlinear constraint. Is this true? If not, do you know if the solver has some internal variable indicating if the iteration is evaluating only the nonlinear constraint?
Thanks in advance Best Regards.
Answers (1)
Alan Weiss
on 2 Nov 2012
Edited: Alan Weiss
on 2 Nov 2012
0 votes
There is a new documentation example related to this, on avoiding evaluating an objective and constraint function twice.
And there is an example in Global Optimization Toolbox that shows using this technique in optimizing an ODE. You are free to use fmincon as your solver, of course. You might want to consult this section of the documentation for suggestions on optimizing ODEs.
Alan Weiss
MATLAB mathematical toolbox documentation
Categories
Find more on Solver Outputs and Iterative Display in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!