Page 1 of 1

Tip to get optimal cylinder surface area

Posted: Tue Jun 06, 2017 1:18 am
by Psychophanta
Old wellknown problem: wanted to know the maximum volume of a cylinder with a minimum quantity of material, i.e. surface area

Code: Select all

;Old wellknown problem: wanted to know the maximum volume of a cylinder with a minimum quantity of material, i.e. surface area
;20170605 by Psychophanta

;Let A the total surface area of the cylinder
;Let V the total inner volume of the cylinder
;Let h its height
;Let r the radius of its base

Define .f V,A,h,r

V=ValF(InputRequester("Maximum volume of a cylinder with a minimum quantity of its total surface","Input the wanted amount of cubic units","350",0))

r=Pow(V/2/#PI,1/3)
h=2*r ; h=V/#PI/r/r
A=3*V/r

MessageRequester("Result","The radius cylinder base must be "+StrF(r)+" linear units,"+#CRLF$+"its height must be "+StrF(h)+" linear units,"+#CRLF$+"its total surface area will have "+StrF(A)+" square units.",#PB_MessageRequester_Ok)