non linear optimization with fmincon
Mostrar comentarios más antiguos
Hi, I am solving a nonlinear optimization problem: Xop=fmincon(@ident1,[0.1;0.1],[],[],[],[],[1 1],[50 5]); problem.options =optimset('Display','iter-detailed'); I found Xop= 2.6147 1.0000 I don't understand why the second value of Xop don't change although i change the upper value. If upper value is 0.5 Xop(2)=0.5 Can you help me? thanks
11 comentarios
Alexandra Harkai
el 2 de Nov. de 2016
What is your objective function?
Anoire BEN JDIDIA
el 2 de Nov. de 2016
Editada: Walter Roberson
el 2 de Nov. de 2016
Alexandra Harkai
el 2 de Nov. de 2016
Why should the optimum be at a different Xop(2) value? (Didn't decode the long function but it seems to be the an absolute value of a polynomial, so there could be bits where even though the range is wider, it will not move away from the local optimum.)
Can you plot the ident1 function for a range of [x y] values where x is fixed?
When the upper bound is 0.5, then the lower bound can't be 1, are you changing the problem config?
Anoire BEN JDIDIA
el 2 de Nov. de 2016
Alexandra Harkai
el 2 de Nov. de 2016
Editada: Alexandra Harkai
el 2 de Nov. de 2016
In addition to plotting parts of the [x y] surface, the 'iter-detailed' display carries lots of info why the second coordinate doesn't change. Using these optimalisation options it shows where the function argument moves during the iterations. With the 'PlotFcn' defined this would also be displayed:
opts = optimoptions(@fmincon, 'Display','iter-detailed', 'PlotFcn', @optimplotx); % this has to be defined first
Xop = fmincon(@ident1,[0.1;0.1],[],[],[],[],[1 1],[50 5], opts); % then calling the optimisation using those options
Anoire BEN JDIDIA
el 2 de Nov. de 2016
Alexandra Harkai
el 2 de Nov. de 2016
My bad, wrong syntax. Corrected the code now.
Anoire BEN JDIDIA
el 2 de Nov. de 2016
Alexandra Harkai
el 2 de Nov. de 2016
Editada: Alexandra Harkai
el 2 de Nov. de 2016
What does the iterative display tell you? What reason does it give for finishing the optimisation? You can try to find the exit flag:
[xop, ~, exitflag] = fmincon(...)
How do these compare to when you use a different lower/upper boundary?
These give information for you about why the algorithm stopped and help to think about how you might want to change your optimisation according to What Can Be Wrong If The Solver Succeeds?
Anoire BEN JDIDIA
el 2 de Nov. de 2016
Alexandra Harkai
el 2 de Nov. de 2016
I don't know all the parameters you are using for your optimisation, but regardless, the best advice I can give is to look at all the previous questions above and try to find out how your optimisation behaves. Check the iteration process, not just the final result. Check the linked MATLAB Documentation here too.
Respuestas (0)
Categorías
Más información sobre Problem-Based Optimization Setup 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!
