Changing stepsize of fmincon algorithm applied to an undefined function
이전 댓글 표시
Hi,
I need your help using the fmincon function at a specific application. I don't want to apply the fmincon algorithm to a defined function of the type f(x,y)=... but commit a special function that reads the output of a scope. Depending on the measured value of the scope, I then want to move a x-y-table to another position (x_new | y_new). At the end I want to find the position at which the highest value is measured. At the moment i am calling the fmincon function like this:
[x,fval,exitflag,output] = fmincon(@(position)myScopeFunction(position,handles,wait_time),[0,0],[],[],[],[],[-2,-2],[2,2]);
position is a vector that defines the x and y coordinate of the xy-table. The start position is 0|0 and I want to find the optimal position in an area that is bounded by
x = [-2,2] and y = [-2,2]
The "myScopeFunction" returns the measured value of the scope and configures the position of the xy-table depending on the input "position" that is defined by the fmincon algorithm.
The problem is, that i don't find any way to define the minimum stepsize that fmincon uses to change the xy position. I want the position to change in a range of 0.1-0.5 but fmincon causes position changes of something like 1e-6 and below.
Do you have any idea how i could solve this problem?
Thanks!
답변 (2개)
Torsten
2017년 5월 2일
1 개 추천
If you use a position change of 0.1, e.g., and you use a double for-loop, you will need appr. 1700 calls to "myScopeFunction" to scan the complete area of interest. So no need to use "fmincon" for this task.
Best wishes
Torsten.
댓글 수: 1
Alan Weiss
2017년 5월 2일
I think that Torsten has an excellent idea. But, if you want to try to save some time, you could try patternsearch instead of fmincon, and set the MeshTolerance option to 0.05 or so. Requires a Global Optimization Toolbox license.
Alan Weiss
MATLAB mathematical toolbox documentation
Walter Roberson
2017년 5월 2일
0 개 추천
You want discrete optimization, but fmincon is for continuous optimization.
However, you could set the StepTolerance option https://www.mathworks.com/help/optim/ug/fmincon.html#input_argument_d0e49295
카테고리
도움말 센터 및 File Exchange에서 Choose a Solver에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!