【求助】求解固定周长的多边形最大面积。
Show older comments
题有三问 循序渐进,但是我只会第一问,请大神们指教
第一问
固定周长的矩形,何时面积最大? 我假设了周长为2
我用了
[x,f1,key]=fminsearch('-x+x^2',0)
得出正方形时面积最大
第二问
固定周长的三角形,用heron's formula
我用的nonlinear 的解法 这是式子 但是不会用matlab
Objective Min (-1)*sqrt((1-x1)*(1-x2)*(1-x3))
s.t. -x1-x2-x3>=-2
x1+x2-x3>0
x1-x2+x3>0
-x1+x2+x3>0
x1,x2,x3>0
用Matlab解不出 不知道问题在哪求大神指教
f = @(x)(-1)*sqrt((1-x(1))*(1-x(2))*(1-x(3)));
x0 =[0,0,0];
A = [-1 -1 -1
1 1 -1
1 -1 1
-1 1 1
1 0 0
0 1 0
0 0 1];
b = [-2 0 0 0 0 0 0];
x = fmincon(f,x0,A,b);
第三问是
固定周长的图形,何时面积最大。
虽然知道是圆形面积最大,但是不知道要怎么用matlab解答,求大神帮助
Accepted Answer
More Answers (0)
Categories
Find more on Mathematics and Optimization 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!