A problem regarding minimax algorithm
9 ビュー (過去 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!