How do I optimise a nonlinear objective function which doesn't have an analytical expression
이전 댓글 표시
I have an objective function that for particular design variables( say s1 and s2) gives a value, but I don't exactly have any analytical expression.( It goes through a lot of nonlinear newton iteration and converges to find the a solution). How do I proceed to optimize such objective function? Its a unconstrained optimization problem. I tried using conjugate gradient, but as i don't have any analytical expression, its difficult to find alpha
채택된 답변
추가 답변 (2개)
Alan Weiss
2013년 5월 8일
As long as you have a program that eventually gives the value of the objective function, you can use fminsearch or (with Optimization Toolbox) fminunc to minimize the function. Just be sure to put your design variables, s1 and s2, into a vector that is usually called x.
Suppose your objective function is
function obj = myfunction(x)
s1 = x(1)
s2 = x(2)
% now do your calculations that give obj
Then to find the minimum, call
solution = fminsearch(@myfunction,x0)
where x0 is an initial guess for the minimization. See the fminsearch function reference page or the documentation on minimizing functions of several variables.
Alan Weiss
MATLAB mathematical toolbox documentation
카테고리
도움말 센터 및 File Exchange에서 Choose a Solver에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!