How do I optimise a nonlinear objective function which doesn't have an analytical expression
Show older comments
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
Accepted Answer
More Answers (2)
Alan Weiss
on 8 May 2013
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
Ayan
on 10 May 2013
0 votes
Categories
Find more on Choose a Solver in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!