How do I maximise Volume of a cylinder such that its Surface Area is less than 10 using fmincon by predicting only either radius or height but not both?

2 ビュー (過去 30 日間)
Volume= pi*r*r*h
Surface Area= 2*pi*r*(h+r);
i am solving a bigger problem. this simple example will help me to solve the bigger problem. The main point is Fmincon should predict only r or h but not both. The other value has to be computed through the constraint equation. Please give me the full code including function call, objective function and constraint function. Thanks

採用された回答

Torsten
Torsten 2019 年 7 月 16 日
編集済み: Torsten 2019 年 7 月 16 日
Not possible. Since r and h are interdependent, "fmincon" must be able to vary both and thus predict them simultaneously.
Of course, if we assume that maximum volume will result if we use maximum surface area, we have
10 = 2*pi*r^2 + 2*pi*r*h
and we can solve for h:
h = 5/(pi*r) - r
and insert in the volume formula
max: pi*r^2*(5/(pi*r) - r)
But for bigger problems with more constraints, this does not seem the way to go.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLighting, Transparency, and Shading についてさらに検索

タグ

製品


リリース

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by