A problem regarding minimax algorithm
7 次查看(过去 30 天)
显示 更早的评论
I have a problem trying to use fminimax to simultaneously maximize the cylinder volume V and minimize its surface area. So to minimize 2*pi*r*(r+h) while maximizing pi*r^2*h. I have tried the following:
%myFunction
function f = myCylinder(x)
f(2)= 2*pi*x(1)*(x(1)+x(2));
f(1)=-pi*x(1)^2*x(2);
end
%main script
clc;clear all;
nvars=2;
lb=[0.05 0.1 ];
ub=[2 2];
x0 = [2; 2];
[x,fval] = fminimax(@myCylinder,x0,[],[],[],[],lb,ub);
The algorithm just seems to always give the lower bound as the answer to the problem... Can someone help me understand this??
2 个评论
Torsten
2017-5-8
编辑:Torsten
2017-5-8
1. The surface area A of a cylinder is 2*pi*r*h, not 2*pi*r*(r+h).
2. "fminimax" returns the values for r and h for which max{V,A} is minimal. This is the case when r and h are minimal - so the answer that r=0.05 and h=0.1 is correct.
3. The task to minimize surface area while maximizing volume does not make sense. What makes sense is to maximize volume for a given surface area or to minimize surface area for a given volume.
Best wishes
Torsten.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear Least Squares 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!