MTH 15 Round-End Fenced Enclosure Bruce Mayer, PE Licensed Electrical & Mechanical Engineer BMayer@ChabotCollege.edu MTH15: Applied Calculus I 1 Bruce Mayer, PE BMayer@ChabotCollege.edu • MTH15_Lec-17a_sec_3-5_Round_End_Fence_Enclosure.pptx Given Fenced Enclosure Given Parameters • Total Enclosed Area = 1600 Square Feet (1600 ft2) • Fence Costs in $/Lineal-Ft – Straight = 30 – Curved = 40 Determine Lo-Cost R & L MTH15: Applied Calculus I 2 Bruce Mayer, PE BMayer@ChabotCollege.edu • MTH15_Lec-17a_sec_3-5_Round_End_Fence_Enclosure.pptx Given Fenced Enclosure Game Plan • Solve for COST FUNCTION f(R) • Solve by BOTH of – Hand Calculus Develop Cost Function – Use min command on Cost Vector Will hunt-down LoCost & Address MTH15: Applied Calculus I 3 Bruce Mayer, PE BMayer@ChabotCollege.edu • MTH15_Lec-17a_sec_3-5_Round_End_Fence_Enclosure.pptx MTH15: Applied Calculus I 4 Bruce Mayer, PE BMayer@ChabotCollege.edu • MTH15_Lec-17a_sec_3-5_Round_End_Fence_Enclosure.pptx MTH15: Applied Calculus I 5 Bruce Mayer, PE BMayer@ChabotCollege.edu • MTH15_Lec-17a_sec_3-5_Round_End_Fence_Enclosure.pptx MTH15: Applied Calculus I 6 Bruce Mayer, PE BMayer@ChabotCollege.edu • MTH15_Lec-17a_sec_3-5_Round_End_Fence_Enclosure.pptx .m File Script % Bruce Mayer, PE % ENGR25 * 29Jan11 % P1.20: Rounded-End Fenced Enclosure % file = P2_20_RoundEnd_FencedEnclosure_1201.m % % Guess that Rmin is between 5-30 feet. %* make ve R-vector with 0.01 ft resolution R = [5:0.01:30]; % % Calculate the "Vectorized" Cost using this R-Vector %* need the DOT on the divide to indicate element-by-element division C = (25*pi+60)*R + 48000./R; % % Make a plot to "EyeBall" Solution %* convert cost $k for easier interpretation plot(R,C/1000, 'LineWidth', 2),xlabel('R (ft)'),ylabel('Total Cost (k$)'), grid % disp('showing Cost Plot; hit ANY KEY to Continue') pause % % now use min command to hunt down exactly the minimum within Cost Vector,C [Cmin, Kmin] = min(C); % [Value, Address] % % Now that we the location of Cmin, We can find Rmin and Lmin at the SAME % Location Rmin = R(Kmin); % % Recall from Hand Work => Make an L-Vector % *Don't forget the DOT on SQUARE or DIVIDE operators L = (1600 - pi*R.^2/2)./(2*R); Lmin = L(Kmin); % % Now Summarize disp('---------Answer Below-----------') disp('Rmin, Lmin in FEET; Cmink in $k') Rmin Lmin Cmink = Cmin/1000 % % Summarizing Plot plot(R,C/1000, Rmin, Cmin/1000, 'p', 'LineWidth', 2),xlabel('R (ft)'),ylabel('Total Cost (k$)'), grid MTH15: Applied Calculus I 7 Bruce Mayer, PE BMayer@ChabotCollege.edu • MTH15_Lec-17a_sec_3-5_Round_End_Fence_Enclosure.pptx Answer Graphically 11 10 Total Cost (k$) 9 8 7 6 5 5 10 15 20 25 R (ft) MTH15: Applied Calculus I 8 Bruce Mayer, PE BMayer@ChabotCollege.edu • MTH15_Lec-17a_sec_3-5_Round_End_Fence_Enclosure.pptx 30 L vs R Plot (for Fun) 160 140 120 L (ft) 100 80 60 40 20 0 5 10 15 20 25 R (ft) MTH15: Applied Calculus I 9 Bruce Mayer, PE BMayer@ChabotCollege.edu • MTH15_Lec-17a_sec_3-5_Round_End_Fence_Enclosure.pptx 30 Symbol-Based Alternative MTH15: Applied Calculus I 10 Bruce Mayer, PE BMayer@ChabotCollege.edu • MTH15_Lec-17a_sec_3-5_Round_End_Fence_Enclosure.pptx MTH15: Applied Calculus I 11 Bruce Mayer, PE BMayer@ChabotCollege.edu • MTH15_Lec-17a_sec_3-5_Round_End_Fence_Enclosure.pptx MTH15: Applied Calculus I 12 Bruce Mayer, PE BMayer@ChabotCollege.edu • MTH15_Lec-17a_sec_3-5_Round_End_Fence_Enclosure.pptx