function [r, Area, d, dd] = minsurf(r1,r2,h1,h2) % minsurf computes the radius for the minimal surface area % for a double conefrustum. Also returns the surface area and associated % partial derivatives. r = (h2*r1+h1*r2)/(h1+h2) ; % start with the single frustum hypothesis for i = 1:4 [Area,d,dd] = doubleconesurf(r1,r,r2,h1,h2) ; r = r - d/dd ; if r < 0 r = 0 ; end end [Area,d,dd] = doubleconesurf(r1,r,r2,h1,h2) ; return