maximization nonlinear problem and local maximum solution
Mostrar comentarios más antiguos
Hi,
I have the following code to solve nonlinear maximization problem
objective = @(x) ( -1.167*x(1)-.03127*x(2)- 1.645*sqrt(0.8495263*x(1).^2 + 0.2517729*x(1)*x(2) +0.3102907*x(2).^2 ) );
Aeq = [1,1];
beq = 1;
lb = [0,0];
ub = ones(1,2);
x0 = ones(1,2)/2;
x = fmincon(@(x) - objective(x),x0,[],[],Aeq,beq,lb,ub)
After runing the above code I received :
Local minimum found that satisfies the constraints.
Optimization completed because the objective function is non-decreasing in
feasible directions, to within the value of the optimality tolerance,
and constraints are satisfied to within the value of the constraint tolerance.
<stopping criteria details>
x =
0.0000 1.0000
Can I find global solution not a local? the results in not satisfying because I don't want my x to have 0 and 1 only, I want it to be inbetween 0 and 1. Any advice to improve my solution ?
Respuesta aceptada
Más respuestas (1)
John D'Errico
el 10 de En. de 2023
Editada: John D'Errico
el 10 de En. de 2023
Whenever I try to squeeze blood from a rock, all I ever do is get my hands all bloody with my own blood from my own fingers. The darn rocks never seem to bleed!
We can look more carefully at your function.
syms x [1 2]
f = ( -1.167*x(1)-.03127*x(2)- 1.645*sqrt(0.8495263*x(1).^2 + 0.2517729*x(1)*x(2) +0.3102907*x(2).^2 ) );
% The constraint is x(1) + x(2) == 1
fx = subs(f,x(2),1-x(1))
fplot(fx,[0 1])
xlabel 'x'
ylabel 'objective(x,1-x)')
You are trying to MAXIMIZE the objective, where x and y live on the interval [0,1].
Do you see the maximum occurs at the point (x,y) = (0,1)? fmincon found the global solution that lies within the bounds you supplied. How much better could it possibly do?
Wanting fmincon to find some other solution is a task of futility. And it will just tend to get your hands all bloody. Honestly, I've tried many times. But, maybe I should try squeezing some garnets (rubies are too expensive for this.) At least they are already red. Next time...
Categorías
Más información sobre Systems of Nonlinear Equations 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!


