90 likes | 195 Views
Symbolic Math. only available in MATLAB. Design Problem:. Surface area of a cylinder= S = rh + 2 p r 2 Volume of a cylinder = V= p r 2 h. Must hold 3 cubic meters of gasoline What is the smallest surface area that will hold 3 cubic meters? (will be cheapest to build). Solution:.
E N D
Symbolic Math only available in MATLAB
Design Problem: Surface area of a cylinder= S = rh + 2pr2 Volume of a cylinder = V= pr2h. Must hold 3 cubic meters of gasoline What is the smallest surface area that will hold 3 cubic meters? (will be cheapest to build)
Solution: • We know: V= pr2h = 3 so h = 3/(pr2), S= 2prh + 2pr2 = 6/r + 2pr2 • We want to find the r that minimizes S • We could plot S vs r • We could find when dS/dr = 0
Plotting S vs r r=[0.1:0.01:2] S=6./r+2*pi*r.^2; plot(r,S) xlabel('r, m'); ylabel('S, m^2'); title('Surface area vs r for cylinder with Volume 3m^3')
Using Symbolic toolbox s = 6/r + 2*pi*r^2 set up polynom s1 = diff(s,1) take derivative solve(s1) find root of deriv pretty(ans) clean up rmin = double(solve(s1)) 0.7816 Smin = subs(s,r,0.7815926) 11.51 hmin = 3/(pi*rmin(1)^2) 1.563
A similar problem • Suppose you have a wire of length L • You cut a length x to make a square • You use remaining L-x to make a circle • Use Matlab to find the length x to maximize the areas enclosed by the square and the circle