How do I optimise a nonlinear objective function which doesn't have an analytical expression
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (2)
Alan Weiss
el 8 de Mayo de 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
el 10 de Mayo de 2013
0 votos
Categorías
Más información sobre Choose a Solver en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!