Find maximum of function with 3 variables
9 次查看(过去 30 天)
显示 更早的评论
How to find maximum of function with 3 variables?
-1<= x1 x2 x3 <=1
function =78.4802 + 5.9976*x1 - 1.94506*x2- 1.7211*x3 - 6.89185*x1^2 - 1.9625*x1*x3 - 5.97065*x2^2 - 1.5375*x2*x3 - 7.51189*x3^2;
2 个评论
John D'Errico
2021-8-16
编辑:John D'Errico
2021-8-16
That is literally impossible to say, since you do not show only 3 variables. I see:
x1, x2, x3, x12, x1*x3, x22, x2*x3, x32
So there are some products of variables. Then there are others that you may want to be interpreted as such, but you have named them with two numbers. Should we be able to read your mind here? Hey, maybe x32 was intended to represent the square of x3, thus x3^2. The crystal ball is so fuzzy today.
Anyway, if you think that x32 should really be seen as x3*x2, then exactly how is that different from x2*x3? I'm pretty sure that multiplication is a commutative operator, ok, as long as x2 and x3 are real numbers. Admittedly, it has been many years since I worried about that, so the new math may have changed since then. Is Pi now 3? ;-)
回答(1 个)
Walter Roberson
2021-8-16
However, you have the problem that x12, x22, and x32 are not defined.
4 个评论
Walter Roberson
2021-8-18
The maximum of a continuous function over the infinite domain occurs has a positive slope on the left (increasing towards the maximum) and a negative slope towards the right (decreasing away from the maximum). It follows that the maximum on an infinite domain must be at a location where the slope is 0. The discussion I pointed to shows finding the points with slope 0. You can then assess each to determine whether it is a maximum or minimum or saddle point.
Over a finite domain, the maximum must be either at an inflection point or at a boundary.
So... catalog the inflection points and the boundary points and evaluate the function at end of the locations and whichever one is the largest is the maximum over the finite domain.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!