필터 지우기
필터 지우기

Controlling stepsize of fmincon

조회 수: 105 (최근 30일)
Mads
Mads 2011년 5월 3일
댓글: AM 2018년 11월 29일
Hi
Im am trying to shape optimize a heating surface using MATLAB fmincon and a CFD software. My problem is that the computational costs of a function evaluation (ie a CFD analysis) is very high and thus I want to make a rater rough search of my solution space.
When I iniate fmincon it seems that some ver small steps (in the order of 10^-5 of a mm) are done in order to determine a search direction. This is a waste of function evalutaion since this does not changes the results at all.
My question: Is their any way to avoid these useless function evalution and start out by making large steps?
  댓글 수: 1
Matt J
Matt J 2018년 11월 27일
편집: Matt J 2018년 11월 27일
If you know that the small steps are done in order to determine a search direction, then why would you consider them useless or wasteful? Isn't determining a search direction important? How can the algorithm make any progress without knowing in which direction to step? Rather than saying that they are "useless", I think what you really mean to say is that they are "costly".

댓글을 달려면 로그인하십시오.

답변 (3개)

Richard Alcock
Richard Alcock 2011년 5월 6일
Take a look at the documentation for fmincon: http://www.mathworks.com/help/toolbox/optim/ug/fmincon.html#f854721 and the options available for the optimization functions: http://www.mathworks.com/help/toolbox/optim/ug/f19175.html
Reading those, I think you want to set the DiffMinChange option to something larger than it's default.
DiffMinChange Minimum change in variables for finite-difference gradients (a positive scalar). The default is 0
  댓글 수: 2
Pablo
Pablo 2013년 1월 9일
DiffMinChange not define de mínimum step size
Sean de Wolski
Sean de Wolski 2013년 1월 9일
@Pablo, all though it does not define a minimum step size it does encourage fmincon() to look further away where the gradient might be steeper. This will cause it to take bigger steps.

댓글을 달려면 로그인하십시오.


Radomir
Radomir 2017년 5월 9일
Hello,
I understand that this topic is no longer up to date, but I believe that it could still help to somebody.
Solving similar problem (also CFD software ivolved) I used FiniteDifferenceStepSize as an optimset parametr to avoid small parameters increase.
Radomir
  댓글 수: 8
Matt J
Matt J 2018년 11월 27일
What I meant is that I do not have an analytical expression of F
That does make things more difficult. But what I really was trying to understand is if you know the algorithm used to compute F. Could you write your own version of it if you had to? If for example, F is not computed by an explicit formula, but instead your external software somehow obtains F as the solution of an implicit equation,
phi(x,F)=0
then the gradient of F could still be obtained using the implict function theorem.
AM
AM 2018년 11월 29일
I will look into this, thank you for your help Matt!

댓글을 달려면 로그인하십시오.


Matt J
Matt J 2018년 11월 27일
편집: Matt J 2018년 11월 27일
My question: Is their any way to avoid these useless function evalution and start out by making large steps?
The additional function evaluations are caused by finite difference calculations that fmincon (and other Optimization Toolbox solvers) use to compute derivatives of the objective and constraints, which in turn are used to compute search directions. You can avoid finite differencing, and often save computation, by providing analytic gradient calculations and/or analytic Hessian calculations for algorithms that use them.
However, if you must rely on the default finite difference calculations, then it is usually a bad idea to increase the differencing stepsize in the hope of taking larger steps. The finite differencing controls the direction of search in each iteration, not the distance moved. Typically, reducing the step size will just degrade the finite difference approximation, causing fmincon to choose an inferior search direction. A non-accurate gradient calculation would also prevent fmincon from recognizing when a point of zero-gradient has been reached, and that it is time to stop iterating.

카테고리

Help CenterFile Exchange에서 Computational Fluid Dynamics (CFD)에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by