Run fmincon multiple time

3 visualizaciones (últimos 30 días)
JJ
JJ el 24 de Ag. de 2014
Editada: Matt J el 25 de Ag. de 2014
Hi
I am trying to maximize an function(x,y) over (x,y)
x^2+y^2+b, subject to 0<x<1 and 0<y<1. and b is between 0 and 20.
Now, I want to run fmincon on this function 20 times (for b=0, b=1, b=2..... and so on). I also want to save the optimal (x,y) with the coresponding b so that I can plot this function later.
I have looked up ( http://www.mathworks.com/help/optim/ug/nonlinear-equality-and-inequality-constraints.html ), How should I modify the code so that it will do the above?
  5 comentarios
Matt J
Matt J el 24 de Ag. de 2014
Editada: Matt J el 24 de Ag. de 2014
But because your example isn't similar enough to your true problem, you are unlikely to get a response that is meaningful to your true problem.
JJ
JJ el 24 de Ag. de 2014

Iniciar sesión para comentar.

Respuesta aceptada

Matt J
Matt J el 24 de Ag. de 2014
Editada: Matt J el 24 de Ag. de 2014
Your example is a straightforward application of QUADPROG
[xy, fval]=quadprog(-eye(2),[0;0],[],[],[],[],[0;0],[1;1])
b=0:20;
fval=fval+b;
  2 comentarios
JJ
JJ el 24 de Ag. de 2014
Matt J
Matt J el 25 de Ag. de 2014
Editada: Matt J el 25 de Ag. de 2014
I have the vague impression that this is what you're looking for
It will tell you how to pass 'b' to the objective function as fixed data.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Surrogate Optimization 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!

Translated by