A problem regarding minimax algorithm
7 views (last 30 days)
Show older comments
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 Comments
Torsten
on 8 May 2017
Edited: Torsten
on 8 May 2017
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.
Answers (0)
See Also
Categories
Find more on Linear Least Squares in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!