Maximization problem in MATLAB Optimisation Toolbox
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Vivek
el 2 de Feb. de 2023
Comentada: Matt J
el 5 de Feb. de 2023
Basically by default MATLAB OPtimisation Toolbox fminocon and ga algorithms minimise the objective function.
To maximise normally we use duality prinicple i.e., "multiplying objective function by -1". Will it work same here?
Becasue I have tried doing this and I couldnt get proper results. Is there any solution for this?
Thank you in advance!!
0 comentarios
Respuesta aceptada
Matt J
el 2 de Feb. de 2023
Editada: Matt J
el 2 de Feb. de 2023
Will it work same here?
Yes. Example:
fun=@(x) -x^2; %maximize this
xmax=fmincon( @(x) -fun(x) , 1)
It worked!!
But another principal is that you need a good initial guess, when the problem is non-convex. That might be why it "doesn't work" for you.
7 comentarios
Matt J
el 5 de Feb. de 2023
You're welcome, but please Accept-click the answer to indicate that question is resolved.
Más respuestas (0)
Ver también
Categorías
Más información sobre Genetic Algorithm en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!