필터 지우기
필터 지우기

Display constraint gradient from fmincon

조회 수: 1 (최근 30일)
Pengfei
Pengfei 2012년 5월 17일
Hi all, I am doing nonlinear optimization using "fmincon". There are both nonlinear objective function and nonlinear constraints. As we know that fmincon calculates the gradient of both the objective and constraint functions through finite differences. Now I want it to display the gradient of the constraint functions in the iteration process. I know how to display the gradient of the objective, with the help of optimValues.gradient. But there is no such a field as gradient regarding the constraint functions.
Any idea? Thank!

답변 (1개)

Alan Weiss
Alan Weiss 2012년 5월 17일
I believe you will have to write your own routine to calculate the gradient you want, and include it in your output function. It should call your constraint function at x and at x + delta for a variety of vectors delta that point in the coordinate directions. Yes, this does seem like a waste of time when you know fmincon has already done the evaluation, but I know of no way of extracting the information from fmincon without editing fmincon itself (or editing a subroutine or two).
It is difficult, in general, to evaluate gradients for all possible nonlinear constraints, because there can be many of them, both equality and inequality constraints. But you know your problem, and can take exactly the gradients you want.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by